﻿

	//定义显示open页面的层
	document.write("<div id='open_div1' onMouseDown='catchFlyBar()' onMouseUp='releaseFlyBar()' style='z-index:8001;background-color:white;position:absolute;display:none;border:#808080 1px ridge;overflow:none;'></div>");
	document.write("<div id='open_div2' onMouseDown='catchFlyBar()' onMouseUp='releaseFlyBar()' style='z-index:8101;background-color:white;position:absolute;display:none;border:#808080 1px ridge;overflow:none;'></div>");
	document.write("<div id='open_div3' onMouseDown='catchFlyBar()' onMouseUp='releaseFlyBar()' style='z-index:8201;background-color:white;position:absolute;display:none;border:#808080 1px ridge;overflow:none;'></div>");
	document.write("<div id='open_div4' onMouseDown='catchFlyBar()' onMouseUp='releaseFlyBar()' style='z-index:8301;background-color:white;position:absolute;display:none;border:#808080 1px ridge;overflow:none;'></div>");
	document.write("<div id='open_div5' onMouseDown='catchFlyBar()' onMouseUp='releaseFlyBar()' style='z-index:8401;background-color:white;position:absolute;display:none;border:#808080 1px ridge;overflow:none;'></div>");
	document.write("<div id='open_div6' onMouseDown='catchFlyBar()' onMouseUp='releaseFlyBar()' style='z-index:8501;background-color:white;position:absolute;display:none;border:#808080 1px ridge;overflow:none;'></div>");
	document.write("<div id='open_div7' onMouseDown='catchFlyBar()' onMouseUp='releaseFlyBar()' style='z-index:8601;background-color:white;position:absolute;display:none;border:#808080 1px ridge;overflow:none;'></div>");
	//定义覆盖层
	document.write("<div id='FG_div1' style='z-index:8000;display:none;position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#656565;filter:alpha(opacity:30);border:none;'><iframe src='bg.html' height=100% width=100% frameborder=0 marginwidth=0 marginheight=0></iframe></div>");
	document.write("<div id='FG_div2' style='z-index:8100;display:none;position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#656565;filter:alpha(opacity:30);border:none;'><iframe src='bg.html' height=100% width=100% frameborder=0 marginwidth=0 marginheight=0></iframe></div>");
	document.write("<div id='FG_div3' style='z-index:8200;display:none;position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#656565;filter:alpha(opacity:30);border:none;'><iframe src='bg.html' height=100% width=100% frameborder=0 marginwidth=0 marginheight=0></iframe></div>");
	document.write("<div id='FG_div4' style='z-index:8300;display:none;position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#656565;filter:alpha(opacity:30);border:none;'><iframe src='bg.html' height=100% width=100% frameborder=0 marginwidth=0 marginheight=0></iframe></div>");
	document.write("<div id='FG_div5' style='z-index:8400;display:none;position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#656565;filter:alpha(opacity:30);border:none;'><iframe src='bg.html' height=100% width=100% frameborder=0 marginwidth=0 marginheight=0></iframe></div>");
	document.write("<div id='FG_div6' style='z-index:8500;display:none;position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#656565;filter:alpha(opacity:30);border:none;'><iframe src='bg.html' height=100% width=100% frameborder=0 marginwidth=0 marginheight=0></iframe></div>");
	document.write("<div id='FG_div7' style='z-index:8600;display:none;position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#656565;filter:alpha(opacity:30);border:none;'><iframe src='bg.html' height=100% width=100% frameborder=0 marginwidth=0 marginheight=0></iframe></div>");
		
	//无open打开新页面,pageName代表页面path,width代表页面宽度,height代表页面的高
	function myOpen(pageName,width,height,win)
	{
		var d;
		var d2;
		var f;
		var i=1;

		for(i=1;i<8;i++)
		{
			var div="open_div"+i.toString(); //显示div
			var div2="FG_div"+i.toString(); //覆盖div
			var frame="myFrame"+i.toString(); // 显示窗体 
			if(document.getElementById(div).style.display=="none")
			{
				d=document.getElementById(div);
				d2=document.getElementById(div2);
				divFlyBar=document.getElementById(div);
				break;
			}
		}
		
	    // 控制窗体的现实位置
		height=parseInt(height)+22;
		wi=document.body.offsetWidth;
		hi=document.body.scrollTop;
		
		if(width>wi)
			width=wi-50;
		if(height>hi)
			height=hi-50;
			
		//hi-=30;
		top2 = hi + 100;
		//top2=(hi-height)/2;
		left=(wi-width)/2;

		d.style.top=top2;
		d.style.left=left;
		d.style.width=width;
		d.style.height=height;
		
		
		//定义窗体头
		var title="";
		title+="<table id='tab_"+d.id+"' background='IMG/pageTitle.bmp' width="+width+" height=22 border=0 cellspacing=0 cellpadding=0>";
		title+="<tr>";
		title+="<td style='font-size:9pt;padding-left:5px;'>"+win+"</td>";
		title+="<td height=16 width=42 style='padding-right:3px'><img src='IMG/close.bmp' width=42 onmouseover=this.src='IMG/close_over.bmp' onmouseout=this.src='IMG/close.bmp' onclick=myClose()></td>";
		title+="</tr>";
		title+="</table>"

		d.innerHTML="<table border=0 cellspacing=0 cellpadding=0 width=100% height=100%>";
		d.innerHTML+="<tr>";
		d.innerHTML+="<td height=22 width=100%>";
		d.innerHTML+=title; // 存放头部表格（模式狂标题）
		d.innerHTML+="</td>";
		d.innerHTML+="</tr>";
		d.innerHTML+="<tr>";
		d.innerHTML+="<td width=100% valign=top>";
		// 要显示的窗体
		d.innerHTML+="<iframe id='myFrame"+i.toString()+"' src='about:blank' height='"+height+"' width='"+width+"'% frameborder=0 marginwidth=0 marginheight=0></iframe>";
		d.innerHTML+="</td>";
		d.innerHTML+="</tr>";
		d.innerHTML+="</table>";

		f=document.getElementById(frame);
		if(pageName.indexOf("?")==-1)
			pageName+="?tmp="+Math.random();
		else
			pageName+="&tmp="+Math.random();
		f.src=pageName;
		d.style.display="block";
		d2.style.display="block";
	}
	
	//关闭窗体
	function myClose()
	{
		var frame;
		for(i=7;i>0;i--)
		{
			var div="";
			var frame="myFrame"+i.toString();
			var divID="open_div"+i.toString();
			var frameID="FG_div"+i.toString();
			if(parseInt(i)>parseInt(0))
			{
				var j=i-1
				div="open_div"+j.toString();
			}
			if(document.getElementById(divID).style.display=="block")
			{
				document.getElementById(divID).style.display="none";
				document.getElementById(frameID).style.display="none";
				divFlyBar=document.getElementById(div);
				document.getElementById(frame).src="bg.html";
				break;
			}
		}
	}
