document.write('<iframe id=areaFrame name=areaFrame frameborder=0 src="/css/area.jsp" width=300 height=270 style=display:none;position:absolute;z-index:100 style=" border-right: 1px solid #336699; border-top: 1px solid #336699; border-left: 1px solid #336699; border-bottom: 1px solid #336699;"></iframe>');
var sel_id_area = "";
function areaOnFocus(sImg,bOpenBound,sFld1,sFld2,sCallback){
	showArea(sImg,bOpenBound,sFld1,sFld2,sCallback, 2);
}
function showArea(sImg,bOpenBound,sFld1,sFld2,sCallback){
	showArea(sImg,bOpenBound,sFld1,sFld2,sCallback, 1);
}
function showArea(sImg,bOpenBound,sFld1,sFld2,sCallback, type)
{

	document.onclick=hideArea;
	var fld1,fld2,fld3;

	var cf=document.getElementById("areaFrame");
	var oImg=document.getElementById(sImg);
	sel_id_area = oImg.id;
	if (type == 2)
		oImg=document.getElementById(sFld1);
	
	if(!oImg){alert("控制对象不存在！");return;}

	fld1=document.getElementById(sFld1);



	if(cf.style.display=="block"){cf.style.display="none";return;}
	
	var eT=0,eL=0,p=oImg;
	var sT=document.body.scrollTop,sL=document.body.scrollLeft;
	var eH=oImg.height,eW=oImg.width;
	while(p&&p.tagName!="BODY"){eT+=p.offsetTop;eL+=p.offsetLeft;p=p.offsetParent; }
	cf.style.top=(document.body.clientHeight-(eT-sT)-eH>=cf.height)?eT+eH:eT-cf.height;
	cf.style.left=(document.body.clientWidth-(eL-sL)>=cf.width)?eL-cf.width+oImg.width:eL+eW-cf.width;

	cf.style.display="block";

}        
function hideArea()
{	
	try {
		if (sel_id_area != "") {
			if (event.srcElement != null)
				if (event.srcElement.id == sel_id_area) return;
		}
		sel_id_area = "";
		hideArea_base();
	}catch(err) {
		hideArea_base();
	}
}
function hideArea_base()
{	
	var cf=document.getElementById("areaFrame");
	cf.style.display="none";
}