﻿// JScript 文件
function ShowDialog(ControlID)
{
    var width = document.getElementById(ControlID).style.width; 
    var height = document.getElementById(ControlID).style.height;
    width = width.substr(0,width.length - 2);
    height = height.substr(0,height.length - 2);
    document.getElementById(ControlID).style.left=((screen.width-width)/2) + "px";
    document.getElementById(ControlID).style.top=(screen.height/2-200) + "px";
    //document.getElementById(ControlID).style.top=screen.height/2-0;
    document.getElementById(ControlID).style.display = "block";
}

function HidSelect(strNone)
{
     var  selList = document.getElementsByTagName("select");
     if (selList.length  >  0)
     {
         for (var i = 0 ; i < selList.length ; i ++ )
         {
                selList[i].style.display=strNone;
         }
     }


}


function Estop(id)
{



    if(document.getElementById("Estop")) 
    {
        var objEstop = document.getElementById("Estop");
        objEstop.style.zIndex = 10;
        objEstop.style.display = "";
        if(window.ActiveXObject){
            objEstop.style.width = document.body.offsetWidth + 'px';  
            objEstop.style.height = document.body.offsetHeight + 'px';
        }else if(window.XMLHttpRequest){
            objEstop.style.width = document.body.offsetWidth + 'px';  
            objEstop.style.height = document.documentElement.scrollHeight + 'px';
        }
    }
    else
    {
        var str = document.createElement("div");  
        str.id = "Estop";  
        str.style.position = "absolute";
        if(window.ActiveXObject){
            str.style.width = document.body.offsetWidth + 'px';  
            str.style.height = document.body.offsetHeight + 'px'; 
        }
        else if(window.XMLHttpRequest){
            str.style.width = document.body.offsetWidth + 'px';  
            str.style.height = document.documentElement.scrollHeight + 'px'; 
        }
        str.style.backgroundColor = "Black";
        str.style.zIndex = 10;
        str.style.top="0";
        str.style.left="0";   
        if(navigator.userAgent.indexOf("MSIE")>0)
        {
            str.style.filter = "alpha(opacity=60)";
        }
        else
        {
            str.style.opacity = 0.6;
        }
        str.innerHTML = str.innerHTML + "<!--[if IE]><iframe style='border:0;opacity:0;+filter:alpha(opacity=0); position:absolute;top:0;left:0;width:" + str.style.width + "; height:" + str.style.height + "'></iframe><![endif]-->";
        
        
        
        if(document.getElementsByTagName("form").length > 0 )
        {
            document.getElementsByTagName("form")[0].insertBefore(str,document.getElementsByTagName("form")[0].firstChild);   
        }
    }
        var objTemp = document.getElementById(id).cloneNode(true);
        var obj = document.getElementById(id);
        obj.parentNode.removeChild(obj);
        objTemp.style.display = "block";
        objTemp.style.zIndex = 11;
        var width = objTemp.style.width;
        width = width.substr(0,width.length - 2);
        objTemp.id = id;
        objTemp.style.left=((screen.width-width)/2) + "px";
        objTemp.style.top=(document.documentElement.scrollTop + 150) + "px"; 
        if(document.getElementsByTagName("form").length > 0 )
        {
            document.getElementsByTagName("form")[0].insertBefore(objTemp,document.getElementsByTagName("form")[0].firstChild);
        }
}

function removeEstop(id)
{
    if(document.getElementById("Estop")) document.getElementById("Estop").style.display = "none";
    if(document.getElementById(id)) document.getElementById(id).style.display = "none";

}



