//设置遮罩层样式
	function styleLayer(ostr)
	{
		var o=window.document.getElementById(ostr);
		o.style.position="absolute";
		o.style.height=window.document.body.scrollHeight;
		o.style.width=window.document.body.clientWidth;
		o.style.filter="alpha(opacity=40)";
		o.style.top=0;
		o.style.left=0;
		o.style.backgroundColor="#ffffff";
	}



//打开窗口内容
function winContent(parent_obj,obj,content,scrollflag,o)
{

	var newWin=window.document.createElement("iframe");
	newWin.id="winIframe"
	newWin.style.position="absolute";
	newWin.style.width="100%";
	newWin.style.height="100%";
	newWin.style.zIndex=100;
	newWin.scrolling=scrollflag; //是否出现滚动条
	newWin.frameBorder=0;
	newWin.style.margin="0mm";
	newWin.src=content;
	obj.appendChild(newWin);
 
}


//建立窗口,sleeptime是延迟时间
function createWin(winWidth,winHeight,winTitle,winC,scrollflag,sleepTime)
{
	var o=window.document.getElementById("overLayer");

	o.style.display="inline";
	var divobj=window.document.createElement("div");
	divobj.id="objwin";
	divobj.style.position="absolute";
	divobj.style.width=winWidth;
	divobj.style.height=winHeight;
	divobj.style.zIndex=100;
	divobj.style.margin="0";
	divobj.style.top=(window.document.body.scrollTop+(window.document.body.clientHeight-winHeight)/2)+"px";
	divobj.style.left=(window.document.body.clientWidth-winWidth)/2+"px";
	divobj.style.border="#00CCFF 1px solid";
	divobj.style.backgroundColor="#ffffff";
	var tabobj=window.document.createElement("table");
	 tabobj.border=0;
	 tabobj.cellSpacing=0;
	 tabobj.cellPadding=0;
	 tabobj.width="100%";
	 tabobj.height="35";
	 thR=tabobj.insertRow();
	 thR.height="25";
	 thC=thR.insertCell();
	 thC.innerHTML="<img src='../images/control.gif'>";
	 thC.width=28;
	 thC=thR.insertCell();
	 thC.background="../images/titlebg.gif";
	 thC.onmousedown=function(){
		 flag=true;
	 };

	 thC.onmouseup=function(){
		 flag=false;
	 };
	 thC.innerHTML="<b>"+winTitle+"</b>";
     thC=thR.insertCell();
	 thC.innerHTML="<img onclick=\"closeWin('"+"objwin"+"')\" onmouseover=\"this.src='../images/close2.gif'\" onmouseout=\"this.src='../images/close1.gif'\" src='../images/close1.gif' style='cursor:hand'>";
	 thC.width=40;
	 thR=tabobj.insertRow();
	 thR.height="10";
	 thC=thR.insertCell();
	 thC.colSpan="3";
	 thC.background="../images/titlespt.gif";
	 divobj.appendChild(tabobj);


	 //显示"载入..."
	var disInfo=window.document.createElement("div");
	disInfo.id="disInfo";
	disInfo.style.position="absolute";
	disInfo.style.width="100%";
	disInfo.style.height="30"
	disInfo.style.top=(winHeight-60)/2;
	disInfo.align="center";
	disInfo.innerHTML="<img src='../images/loading.gif' height='16' border='0'>&nbsp;数据载入......";
	divobj.appendChild(disInfo);

	 window.document.body.appendChild(divobj);

	var divobj_sub=window.document.createElement("div");
	divobj_sub.id="objwins";
	divobj_sub.style.width="100%";
	divobj_sub.style.height="100%";
	divobj_sub.style.zIndex=125;
	divobj_sub.style.margin="0";
	divobj_sub.style.display="none";
	
		winContent(divobj,divobj_sub,winC,scrollflag,disInfo);
		divobj.appendChild(divobj_sub);	

		if (sleepTime>0)
		{
			setTimeout("sleepLoadObj('disInfo','objwins')",sleepTime);
			//alert(divobj);
		}
		else
		{
			sleepLoadObj("disInfo","objwins");
		}
		
}

//关闭窗口
function closeWin(ostr)
{
	 var o=window.document.getElementById(ostr);
	 window.document.body.removeChild(o);
	 window.document.getElementById("overLayer").style.display="none";
}

//建立窗口方式2
function createWin2(winWidth,winHeight,winTitle,winC,scrollflag,sleepTime)
{
	
	var o=document.createElement("div");
	o.style.zIndex=120;
	o.id="zlay";
	o.name="zlay";
	o.style.position="absolute";
		o.style.height=document.body.scrollHeight;
		o.style.width=document.body.clientWidth;
		o.style.filter="alpha(opacity=20)";
		o.style.top=0;
		o.style.left=0;
		o.style.backgroundColor="#ffffff";
	document.body.appendChild(o); //加载显示遮罩层

	var divobj=document.createElement("div"); //创建窗口层
	divobj.id="objwinsub";
	divobj.style.position="absolute";
	divobj.style.width=winWidth;
	divobj.style.height=winHeight;
	divobj.style.zIndex=125;
	divobj.style.margin="0";
	divobj.style.top=(document.body.scrollTop+(document.body.clientHeight-winHeight)/2)+"px";
	divobj.style.left=(document.body.clientWidth-winWidth)/2+"px";
	divobj.style.border="#99CCFF 1px solid";
	divobj.style.backgroundColor="#ffffff";
	var tabobj=document.createElement("table"); //创建窗口标题,利用表格实现
	 tabobj.border=0;
	 tabobj.cellSpacing=0;
	 tabobj.cellPadding=0;
	 tabobj.width="100%";
	 tabobj.height="30";
	 thR=tabobj.insertRow(); //标题行
	 thC=thR.insertCell(); //控制菜单栏
	 thC.innerHTML="<img src='../images/wincontrol.gif'>";
	 thC.width=43;
	 thC=thR.insertCell(); //标题内容区
	 thC.background="../images/wintitlebg.gif";
	 thC.onmousedown=function(){
		 flag=true;
	 };

	 thC.onmouseup=function(){
		 flag=false;
	 };
	 thC.innerText=winTitle;
     thC=thR.insertCell(); //关闭按钮区
	 thC.innerHTML="<img onclick=\"closeWin2('"+"objwinsub"+"')\" onmouseover=\"this.src='../images/winclosebt2.gif'\" onmouseout=\"this.src='../images/winclosebt1.gif'\" src='../images/winclosebt1.gif' style='cursor:hand'>";
	 thC.width=85;
	divobj.appendChild(tabobj);//加载显示标题栏

	 //显示"数据载入..."信息
	var disInfo=document.createElement("div");
	disInfo.id="dispInfo"
	disInfo.style.position="absolute";
	disInfo.style.width="100%";
	disInfo.style.height="30"
	disInfo.style.top=(winHeight-60)/2;
	disInfo.align="center";
	disInfo.innerHTML="<img src='../images/loading.gif' height='16' border='0'>&nbsp;数据载入......";
	divobj.appendChild(disInfo);

	 document.body.appendChild(divobj);

		var divobj_sub=document.createElement("div");//建立内容层
		divobj_sub.id="objwin_sub";
		divobj_sub.style.width="100%";
		divobj_sub.style.height="100%";
		divobj_sub.style.zIndex=100;
		divobj_sub.style.margin="0";
		divobj_sub.style.display="none";
			
		winContent(divobj,divobj_sub,winC,scrollflag,disInfo); //建立IFRAME对象,加载页面
		divobj.appendChild(divobj_sub);	//加载至窗口层中

		if (sleepTime>0)
		{
			setTimeout("sleepLoadObj('dispInfo','objwin_sub')",sleepTime); //延迟显示Iframe对象
		}
		else
		{
			sleepLoadObj("dispInfo","objwin_sub");
		}

}

//关闭窗口
function closeWin2(ostr)
{
	 var o=document.getElementById(ostr);
	 document.body.removeChild(o);
	 document.body.removeChild(document.getElementById("zlay"));
}

//延迟加载对象
function sleepLoadObj(d,o)
{
    window.document.getElementById(d).style.display="none";
	
	window.document.getElementById(o).style.display="inline";
}
//打开等级考试专页
		function openNcreWin()
		{
			var o=document.createElement("a");
			o.target="_blank";
			o.href="ncre/";
			document.body.appendChild(o);
			o.click();
			document.body.removeChild(o);
		}