﻿function showDivWindow(winName)
{
    var win1 = document.getElementById(winName);
    if (win1) 
    {
        win1.style.display = "block";
        win1.style.left=window.screen.availWidth*0.4+"";
        win1.style.top="150";
    }
    screenConvert();
}

function hideDivWindow(winName)
{
    screenClean();
    var win1 = document.getElementById(winName);
    if (win1) 
    {
        win1.style.display = "none";
    }
}
        
function screenConvert()
{
	 var objScreen = document.getElementById("ScreenOver");
	 if(!objScreen) 
	 {
	    objScreen = document.createElement("div");
	 }

	 var oS = objScreen.style;
	 objScreen.id = "ScreenOver";
	 oS.display = "block";
	 oS.position = "absolute";
	 oS.zIndex = "3";
     oS.background = "#cccccc";
     oS.top = oS.left = oS.margin = oS.padding = "0px";
     oS.width = "100%";
	 oS.height = "100%";
	 
	 oS.filter = "alpha(opacity=50)";
	 oS.opacity = 40/100;
	 oS.MozOpacity = 40/100;
	 document.body.appendChild(objScreen);
	 var allselect = document.getElementsByTagName("select");
	 for (var i=0; i<allselect.length; i++) 
	 {
	    allselect[i].style.visibility = "hidden";
	 }
}

function screenClean()
{
	 var objScreen = document.getElementById("ScreenOver");
	 if (objScreen) objScreen.style.display = "none";
	 var allselect = document.getElementsByTagName("select");
	 for (var i=0; i<allselect.length; i++) 
	 allselect[i].style.visibility = "visible";
}

/////////////////////////////////////////////////
function downLayer(e,_Id) {
    m = document.getElementById(_Id);
    if (m.attributes["down"].nodeValue == "0") {
        m.attributes["down"].nodeValue = "1";
        
        e=e||event;   //IE & FireFox        
        m.attributes["divleft"].nodeValue = e.clientX - parseInt(m.style.left);
        m.attributes["divtop"].nodeValue = e.clientY - parseInt(m.style.top);
    }
}
function moveLayer(e,_Id) {
    e=e||event;   //IE & FireFox 
    m = document.getElementById(_Id);
    if (m.attributes["down"].nodeValue == "1") {
        m = document.getElementById(_Id);
        m.style.left = e.clientX - parseInt(m.attributes["divleft"].nodeValue);
        m.style.top = e.clientY - parseInt(m.attributes["divtop"].nodeValue);
    }
}
function upLayer(e,_Id) {
    e=e||event;   //IE & FireFox 
    m = document.getElementById(_Id);
    m.attributes["down"].nodeValue="0";
}


