//测试脚本
var atimer;
function showerrtoolbox(srcurl,widthxx,heightxx,wtitle)
{
	var tblackdiv = document.getElementById("blackdiv");
	var tdialogdiv = document.getElementById("dialogdiv");
	//alert(srcurl);
	var caption = wtitle;
	var frameURL = "App.do?Service=" + srcurl;
	//var frameURL = srcurl;
	var ajaxContentW = widthxx;
	var ajaxContentH = heightxx;
	tdialogdiv.innerHTML = "<div id=\"popupTitleBar\"><div id=\"popupTitle\">" 
		+ caption + "</div><div id=\"popupControls\">"
		+ "<a href='#' id='TB_closeWindowButton' title='Close' onclick='closeme()'>"
		+ "<img class=\"TB_CloseButton\" style=\"margin:0px; border-width:0px\" "
				+"src=\"Images/t.gif\" alt=\"close\" border=\"0\" width=\"24\" height=\"24\" />"
		+ "</a></div></div>"
		+ "<div id=\"TB_ContentShadow\">&nbsp;</div>"
		+   "<iframe frameborder='0' SCROLLING='no' width='100%' hspace='0' src='"+frameURL+"' "
				+"id='TB_iframeContent' name='TB_iframeContent' "
				+"style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' "
				+"onload=''> </iframe>";
		//TB_showIframe()
	//alert(tdialogdiv.innerHTML);
	changePos();
	tblackdiv.style.display="block";
	tdialogdiv.style.display="block";
	
	//var ttitle = document.getElementById("popupTitleBar");
	//tdialogdiv.style.width=widthxx + 30 + "px";
	//ttitle.style.width=widthxx + 30 + "px";
}
function changePos(){

	var tblackdiv = document.getElementById("blackdiv");
	var tdialogdiv = document.getElementById("dialogdiv");
	//alert(1);
	//tblackdiv.style.height=document.body.clientHeight + "px";
	tblackdiv.style.height=Geometry.getDocumentHeight() + "px";
	if (Geometry.getDocumentHeight() < 1024){
		tblackdiv.style.height="600px";
	}
	tblackdiv.style.width="100%";
	
	//alert(2);
	//tdialogdiv.style.left=(document.body.clientHeight/2-200)+"px";
	tdialogdiv.style.left=(Geometry.getDocumentWidth()/2-200)+"px";
	//alert(3);
	//tdialogdiv.style.top=((document.documentElement.scrollTop+document.body.clientHeight/2)-150)+"px";
	tdialogdiv.style.top=((Geometry.getVerticalScroll()+Geometry.getViewportHeight()/2)-150)+"px";
	if (tdialogdiv.style.top.indexOf('-')>=0) tdialogdiv.style.top = "100px";
	//alert(4);
	clearTimeout(atimer);
	atimer = setTimeout('changePos()', 200);
}
function clickbutton2()
{
	//alert("getWindowX: " + Geometry.getWindowX()); //window的x坐标
	//alert("getWindowY: " + Geometry.getWindowY()); //window的y坐标
	//alert(Geometry.getDocumentHeight);
	
//	alert("getViewportHeight: " + Geometry.getViewportHeight());  //可视区域的大小
	//alert("getViewportWidth: " + Geometry.getViewportWidth());    //可视区域的大小
//	alert("getHorizontalScroll: " + Geometry.getHorizontalScroll());//垂直滚动条的位置 
	//alert("getVerticalScroll: " + Geometry.getVerticalScroll());  //水平滚动条的位置 
	
	alert("clientHeight: " + document.body.clientHeight);  //可视区域的大小
	alert("scrollWidth: " + document.documentElement.scrollWidth);  //可视区域的大小
	alert("scrollHeight: " + document.documentElement.scrollHeight);  //可视区域的大小
}

function closeme(){
	var tblackdiv = document.getElementById("blackdiv");
	var tdialogdiv = document.getElementById("dialogdiv");
		tblackdiv.style.display="none";
	tdialogdiv.style.display="none";
	clearTimeout(atimer);
}