var FormTitle="系统提示";

var FormContent="";

var FormButton="";

var Form='<div id="Lock"></div>';

Form=Form+'<div id="Window">';

Form=Form+'<div id="WindowTitle" onMouseDown="MDown(event)"></div>';

Form=Form+'<div id="WindowContent"></div>';

Form=Form+'<div id="WindowButton"></div>';

Form=Form+'</div>';

window.load=document.write(Form);

//================================================================================================================================================================

function Window(Width,Height,Body){
	
	var Lock=document.getElementById("Lock");
	
	var Window=document.getElementById("Window");
	
	if(document.body.scrollHeight<document.documentElement.clientHeight){
	
		Lock.style.height=document.documentElement.clientHeight+'px';
		
	}else{
		
		Lock.style.height=document.body.scrollHeight+'px';
	}
	
	Window.style.width=Width+'px';
	
	Window.style.height=Height+'px';
			
	Window.style.left=document.documentElement.clientWidth/2-Width/2+'px';

	Window.style.top=document.documentElement.clientHeight/2-Height/2+document.documentElement.scrollTop+'px';	
	
	Lock.style.display='block';
	
	Window.style.display='block';
	
	document.getElementById("WindowTitle").innerHTML=FormTitle;
	
	document.getElementById("WindowContent").innerHTML=FormContent;
	
	document.getElementById("WindowButton").innerHTML=FormButton;
	
}

//===============================================================================================================================================================

function CloseWindow(){
	
	document.getElementById("Window").style.display="none";
	
	document.getElementById("Lock").style.display="none";
	
}

//移动函数=======================================================================================================================================================

var  M_Object="";

var pX,pY;

document.onmouseup=MUp;

document.onmousemove=MMove;

function  MDown(E){
	
	M_Object="Window";
		
	if(document.all){
		
		document.getElementById("Window").setCapture()
		
	    pX=E.x-document.getElementById("Window").style.pixelLeft;
		
    	pY=E.y-document.getElementById("Window").style.pixelTop;			
				
	}else{
		
	    pX=E.pageX-parseInt(document.getElementById("Window").style.left);
		
    	pY=E.pageY-parseInt(document.getElementById("Window").style.top);					
		
	}
	
}


function  MMove(E){

	if(M_Object!=""){
		
		if(document.all){
		
			document.getElementById("Window").style.left=event.x-pX;
			
		    document.getElementById("Window").style.top=event.y-pY;
		
		}else{
		
	    	document.getElementById("Window").style.left=(E.pageX-pX)+'px';
		
    	    document.getElementById("Window").style.top=(E.pageY-pY)+'px';
		
		}
		
	}
		
}

function  MUp(){

	if(document.all) document.getElementById("Window").releaseCapture();
      
	M_Object='';
	 
}