 
function $(obj) 
{ 
return document.getElementById(obj); 
} 
function showWin(n,oW,oH,oL,oT,title,con) 
{ 
var win="win"; 
if(!$(win+n)) 
{ 
var obj=document.createElement("div"); 
obj.id=win+n; 
obj.className="win"; 
obj.onMouseDown=function(){ 
this.style.zIndex=999; 
} 
document.body.appendChild(obj); 
} 
var str=''; 
str+='<div class="title" onDblClick="sma(this.parentNode)" onmousedown="moveSele(this.parentNode,event)" onmouseup="stopMoveSele(this.parentNode,event)" title="双击最小化"><div class="l">'+title+'</div><div class="r"><a href="javascript:void(0);" onclick="closeWin(this)">关闭</a></div></div>'; 
str+='<div class="con">'+con+'</div>'; 
$(win+n).innerHTML=str; 

with($(win+n)) 
{ 
style.width=oW+"px"; 
//style.height=oH+"px"; 
style.left=oL+"px"; 
style.top=oT+"px"; 
style.zIndex=996; 
style.display="block"; 
} 
} 
function closeWin(o) 
{ 
o.parentNode.parentNode.parentNode.style.display="none"; 
} 
function sma(o) 
{ 
for(var i=0; i<o.childNodes.length; i++) 
{ 
var node=o.childNodes[i]; 
if(node.className.toLowerCase()=="con") 
node.style.display=node.style.display!="none"?'none':'block'; 
else if(node.className.toLowerCase()=="title") 
node.style.background="#CCC"; 
} 
} 
function moveSele(o,e) //移动所选对象 
{ 
var wb; 
if(document.all && e.button==1) wb=true; 
else if(e.button==0) wb=true; 
if(wb) 
{ 
var off_x=parseInt(e.clientX-o.offsetLeft); 
var off_y=parseInt(e.clientY-o.offsetTop); 

document.documentElement.onmousemove=function(me) 
{ 
var ee; 
if(document.all) ee=event; 
else ee=me; 
o.style.left=ee.clientX-off_x+"px"; 
o.style.top=ee.clientY-off_y+"px"; 
} 
} 
} 

function stopMoveSele(o,e) //停止移动所选对象 
{ 
document.documentElement.onmousemove=null; 
} 
 
