function editContent(tagName,cid,xtcsid) {
	tag = document.getElementById(tagName);
	dims = getDims(tag);
	tag.innerHTML = "<iframe frameborder='0' width='760' height='"+Math.max(400,dims.h)+"' src='admin/edit_content_front.php?cId="+cid+"&XTCsid="+xtcsid+"'></iframe>";
}

function stopEdit() {
	top.location.reload();
}

function getypos(obj) {
  y=0;
  while (obj!=null) {
    y+=obj.offsetTop;
	//if (!document.all)
	  //obj=obj.parentNode; else
	    obj=obj.offsetParent;
  }
  return y;
}
function getxpos(obj) {
  x=0;
  while (obj!=null) {
    x+=obj.offsetLeft;
	//if (!document.all)
	  //obj=obj.parentNode; else
	    obj=obj.offsetParent;
  }
  return x;
}

function getDims(e) {
	aw = e.offsetWidth.toString().replace(/px/,"")*1;
	if (document.all) {
		debug("style: " + e.currentStyle.hasLayout);
		if (!e.currentStyle.hasLayout)
		  e.style.width = "100%";
	}
	ah = e.offsetHeight.toString().replace(/px/,"");
	return {x:getxpos(e), y:getypos(e), w:aw*1, h:ah*1 };
}