﻿// JScript 文件

var dividname="netoa";

/*******************************/
function fnMessageBox(Container,MsgObjectDiv)
{
    Container.style.top = 0;
    Container.style.left = 0;
    Container.style.display="block";
    MsgObjectDiv.style.display="block";
    
    //alert(document.body.clientHeight);
    //alert(MsgObjectDiv.clientWidth);
    MsgObjectDiv.style.top=(document.body.clientHeight-MsgObjectDiv.clientHeight)/2;
    MsgObjectDiv.style.left=(document.body.clientWidth-MsgObjectDiv.clientWidth)/2;
    
    Container.style.width=document.body.scrollWidth;
    Container.style.height=document.body.scrollHeight;
    

    
    return false;
}

function fnDispose(Container,MsgObjectDiv)
{
    MsgObjectDiv.style.display="none";
    Container.style.display="none";    
}
/*******************************/



function startLongProcess()
{
   makediv(dividname,90);//DIV层ID，遮罩部分透明度70-80为宜。
   resizeModal(dividname);
}

function stopLongProcess(myid)
   {
    document.getElementById(myid).style.display="none";
    //window.onresize=null;
    //window.onbeforeunload=null;
   }
  
function resizeModal(myid)
{
   if(document.getElementById(myid))
   {
    document.getElementById(myid).style.width=document.body.scrollWidth;
    document.getElementById(myid).style.height=document.body.scrollHeight;
   }
}

//输出一个层
function makediv(myid,myopacity){
   if(!document.getElementById(myid))
   {
    var inner="";
    //inner="<div id=\""+myid+"\" style=\"BACKGROUND: #D4D0C8; FILTER: alpha(opacity="+myopacity+");Z-INDEX: 5;cursor:default;LEFT: 0px; POSITION:absolute; TOP: 0px; \" onclick=\"window.event.cancelBubble=true;window.event.returnValue=false;\">";
    inner="<div id=\""+myid+"\" style=\"BACKGROUND: #D4D0C8; FILTER: alpha(opacity="+myopacity+");Z-INDEX: 5;cursor:default;LEFT: 0px; POSITION:absolute; TOP: 0px; \" >";
    inner+=document.getElementById("divModalHtml").innerHTML;
    inner+="</DIV>";
   
    document.getElementsByTagName("body")[0].innerHTML+=inner;

    document.getElementById(myid).style.display="";
   }else{
    document.getElementById(myid).style.display="";
   }
}
function fnLoading()
{
    var intBodyWidth;
    var intBodyHeight;
    
    intBodyWidth = document.body.scrollWidth;
    intBodyHeight = document.body.scrollHeight;
    
    if(document.getElementById("ifrLoading"))
    {
        document.body.removeChild(document.getElementById("ifrLoading"));
    }
    var objIframe = document.createElement("<iframe id=\"ifrLoading\" src=\"/include/loading.htm\" frameborder=0 marginheight=0 marginwidth=0 hspace=0 vspace=0 scrolling=no style=\"display:none;FILTER:alpha(opacity=80);background:#D4D0C8;position:absolute;z-index:20;top:0px;left:0px;width:" + intBodyWidth + ";height:" + intBodyHeight + ";\"></iframe>");
    document.body.appendChild(objIframe);
    
    if(document.getElementById("divLoadingImage")!=null&&document.getElementById("divLoadingImage"))
    {
        document.body.removeChild(document.getElementById("divLoadingImage"));
    }
    var objDiv = document.createElement("<div id=\"divLoadingImage\" style=\"display:none;top:0px;left:0px;width:200px;height:200px;z-index:30;position:absolute;\"></div>");
    document.body.appendChild(objDiv);
    
    objDiv.style.innerHTML = "<img src=\"/include/loading.gif\" border=0>";
    objIframe.style.display="block";
    objDiv.style.display="block";
    
    //objIframe.src="/include/loading.htm";
}

