﻿// JScript 文件

var objDivScreen = null;
var objDivMsg = null;
document.write('<div id="divPublicMsgInfo" style="position:absolute;display:none;z-index:101;background-color:#ffffff;border:1px solid #cccccc;">');
document.write('<table width="100%"><tr><td height="40"><img src="/images/logo/02.jpg" height="40"/></td><td style="font-weight: bold; font-size: 14px;" align="left">wiseman温馨提示您</td><td></td></tr>');
document.write('<tr><td id="cellPublicMsgInfo" colspan="2" align="center" valign="middle" style="height:20px; color:#ffb019;"></td></tr>');
document.write('</table>');
document.write("</div>");


//客户端的高度
function ClientH()
{
	return document.body.scrollHeight;	
}

//客户端的宽度
function ClientW()
{
	return document.body.clientWidth;	
}


function DisplaySelect(strStyle)
{
    //隐藏所有select 
    var objSelect = document.getElementsByTagName("select");
    for(var iLoop = 0; iLoop < objSelect.length; iLoop++)
    {
        objSelect[iLoop].style.display = strStyle;
    }
}

//满屏
function FullScreen()
{   
    if (objDivMsg == null)
    {
        var objDiv = document.createElement("Div");
        document.body.appendChild(objDiv);
		objDivScreen = objDiv;
    };

    with(objDiv)
    {
        id = "divPublicFullScreen";
        with (style)
        { 
            zIndex = 100;
            width = ClientW();
            height = ClientH();
            top = "0px";
            left = "0px";
            display = "block";
            position = "absolute";
            background = "AliceBlue";
            filter = "alpha(opacity=80)";
            opacity = 40/100;
            MozOpacity = 40/100
        };
    }
    DisplaySelect("none");
	document.body.onresize = function()
	{
		objDiv.style.width = ClientW();
		objDiv.style.height = ClientH();
	}
}

function Loading(strMsg)
{
	var strLogin = '<img src="/Images/loading.gif" />&nbsp;&nbsp;';
	var h = 100;
	var w = 250;
	var x = (ClientH() - h) / 2;
	var y = (ClientW() - w) / 2;
	strMsg = strLogin + strMsg;
	MsgBox(strMsg, x, y , h, w); 
}

function MsgBox(strMsg, intX, intY, intHeight, intWidth)
{
	//alert(cellPublicMsgInfo.innerText);
    with(divPublicMsgInfo.style)
    {
		display = "inline";
		width = intWidth;
		height = intHeight;
		top = intX;
		left = intY;
    };
	FillMsgBox(strMsg);
}

function ClearFullScreen()
{
    DisplaySelect("inline");
    if(objDivScreen != null)
    {
	    objDivScreen.style.display = "none";
	    divPublicMsgInfo.style.display = "none";
	}
}


//填充MsgBox的内容
function FillMsgBox(strMsg)
{
	cellPublicMsgInfo.innerHTML = strMsg;
	cellPublicMsgInfo.focus();
}

function FillMsgBoxAndClose(strMsg)
{
    strMsg = strMsg + '<br /><br /><a href="###" onClick="ClearFullScreen();">关闭</a>';
    FillMsgBox(strMsg);
}

//显示一个错误的信息
function MsgBoxError(strErrMsg)
{
    ClearFullScreen();
    alert(strErrMsg);
    return;
    FillMsgBoxAndClose('<img src="Images/pic11.gif">&nbsp;' + strErrMsg);
    divPublicMsgInfo.style.display = "inline";
}
