﻿// JScript 文件
//窗口计数
var _G_WindowCount=0;
var _G_WindowString="";
_G_WindowString+="<div style='position:absolute;z-index:100; width:[$AreaWidth]; height: [$AreaHight];left:[$AreaLeft];top:[$AreaTop];' onselectstart='return false'>";
_G_WindowString += "<div style='position:absolute;z-index:100;text-align:center:left:0px;top:0px; height:25px;display:[$TitleDisp]; ' onselectstart='return false'>";
_G_WindowString += 	"<table width='100%' height='25' border='0' cellspacing='0' cellpadding='0'>";
_G_WindowString +=       	"<tr>";
_G_WindowString +=               	"<td class=[$TitleLeftCss]>";
_G_WindowString +=				"[$TitleLeftContent]";
_G_WindowString +=			"</td>";
_G_WindowString +=			"<td class=[$TitleCenterCss]>";
_G_WindowString +=				"[$TitleCenterContent]";
_G_WindowString +=			"</td>";
_G_WindowString +=			"<td class=[$TitleRightCss]>";
_G_WindowString +=				"[$TitleRightContent]";
_G_WindowString +=			"</td>";
_G_WindowString +=       	"</tr>";
_G_WindowString += 	"</table>";
_G_WindowString += "</div>";
_G_WindowString += "<div style='position:absolute;z-index:100;text-align:center:left:0px;top:[$Iframe_Top];width:100%; height:100%' onselectstart='return false'>";
_G_WindowString += 	"<iframe id='[$WindowID]_frame' name='[$WindowID]_frame' src='./loading.htm' frameborder=0 noresize scrolling=[$ContentScrol] height='100%' width='100%'></iframe>";
_G_WindowString += "</div>";
_G_WindowString +="</div>";

function PWGS_Window()
{
    _G_WindowCount++;
    this.WindowID="PWGS_Window_"+_G_WindowCount;
    //区域属性
    this.AreaHight="100px";
    this.AreaWidth="100px";
    this.AreaLeft="0px";
    this.AreaTop="0px";
    //标题属性
    this.TitleDisp="none";
    this.TitleLeftCss="";
    this.TitleLeftContent="";
    this.TitleCenterCss="";
    this.TitleCenterContent="";
    this.TitleRightCss="";
    this.TitleRightContent="";
    //内容区
    this.ContentScrol="none";
    this.ContentUrl="";
    //方法
    //初始化窗体
    this.InitWindow=function()
    {
	var pWindowString=_G_WindowString;
	pWindowString=pWindowString.replace('[$AreaHight]',this.AreaHight);
	pWindowString=pWindowString.replace('[$AreaWidth]',this.AreaWidth);
	pWindowString=pWindowString.replace('[$AreaLeft]',this.AreaLeft);
	pWindowString=pWindowString.replace('[$AreaTop]',this.AreaTop);
	pWindowString=pWindowString.replace('[$TitleDisp]',this.TitleDisp);
	pWindowString=pWindowString.replace('[$TitleLeftCss]',this.TitleLeftCss);
	pWindowString=pWindowString.replace('[$TitleLeftContent]',this.TitleLeftContent);
	pWindowString=pWindowString.replace('[$TitleCenterCss]',this.TitleCenterCss);
	pWindowString=pWindowString.replace('[$TitleCenterContent]',this.TitleCenterContent);
	pWindowString=pWindowString.replace('[$TitleRightCss]',this.TitleRightCss);
	pWindowString=pWindowString.replace('[$TitleRightContent]',this.TitleRightContent);
	pWindowString=pWindowString.replace('[$ContentScrol]',this.ContentScrol);
	pWindowString=pWindowString.replace('[$WindowID]',this.WindowID);
	pWindowString=pWindowString.replace('[$WindowID]',this.WindowID);

	var pAreaTop=this.AreaTop.replace('px','');
	pAreaTop=pAreaTop.replace('pt','');
	//var pIframeTop=(pAreaTop+18)+'px';
	var pIframeTop='25px';
	if('none'==this.TitleDisp)
	{
		pIframeTop='0px';	
		//pIframeTop=pAreaTop+'px';	
		//alert(pIframeTop);
	}
	//alert(pIframeTop);
	pWindowString=pWindowString.replace('[$Iframe_Top]',pIframeTop);
	window.document.write(pWindowString); 
	//alert(pWindowString);
	//alert(screen.height);
    }
    //显示窗体
    this.DispWindow=function()
    {
	var pWindowIframeID=this.WindowID+"_frame";
	var pWindowIframeObject=document.getElementById(pWindowIframeID);
	pWindowIframeObject.src = this.ContentUrl;
    }
}