// JScript 文件

window.onload=function(){
drag(document.getElementById('drag'),document.getElementById('lstd'));
if(document.getElementById("Dis").value == "1")
{
    document.getElementById("drag").style.visibility = "visible";
}
};
function drag(o,ot){
ot.onmousedown=function(a){
var d=document;if(!a)a=window.event;
var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
if(ot.setCapture)
   o.setCapture();
else if(window.captureEvents)
   window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);

d.onmousemove=function(a){
   if(!a)a=window.event;
   if(!a.pageX)a.pageX=a.clientX;
   if(!a.pageY)a.pageY=a.clientY;
   var tx=a.pageX-x,ty=a.pageY-y;
   o.style.left=tx;
   o.style.top=ty;
};

d.onmouseup=function(){
   if(o.releaseCapture)
    o.releaseCapture();
   else if(window.captureEvents)
    window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
   d.onmousemove=null;
   d.onmouseup=null;
};
};
}
//-->

function showwin()
{
//visibility: visible;
if(document.getElementById('drag').style.visibility!="visible")
{
document.getElementById('drag').style.visibility="visible";
document.getElementById('drag').style.left=((document.body.clientWidth-400)/2);
document.getElementById('drag').style.top=50;
}

}
function closewin()
{
//visibility: visible;
if(document.getElementById('drag').style.visibility!="hidden")
{
document.getElementById('drag').style.visibility="hidden";
document.getElementById('drag').style.left=((document.body.clientWidth-400)/2);
document.getElementById('drag').style.top=100;
}
}
function showMe(){
    var drag=document.getElementById("drag");
	if(drag.style.visibility == "visible")
	{
		drag.style.visibility = "hidden";
	}
	else
	{
	    var sClientHeight;
        sClientHeight=window.event.y+document.documentElement.scrollTop;
        var sScrollTop=document.body.scrollTop;
        var sleft=(document.body.clientWidth/2)-(drag.offsetWidth/2);
        var iTop=sClientHeight-(drag.offsetHeight/2);//高度
        var sTop=iTop>0?iTop:(sClientHeight/2+sScrollTop)-(drag.offsetHeight/2);
        drag.style.top=sTop-100+"px";
		drag.style.visibility = "visible";
	}
}

