var highlighting;
function MSDClose(obj){
	if(typeof(obj)=="string") obj=document.getElementById(obj);
	document.body.removeChild(obj);
	
	//close bar
	xs=document.all.xpStatusBar;
	c=xs.children.length;
	for(ci=0;ci<c;ci++){
		bar=xs.children[ci];
		if(bar.target==obj.uniqueID){
		 	xs.removeChild(bar);
		 	break;
		 }	
	}
	resizeBar();
}
function MSDResizeTo(sobj,height,width){
	obj=document.getElementById(sobj);
	
	
	obj.lastChild.firstChild.style.pixelWidth=width;
	obj.lastChild.firstChild.style.pixelHeight=height-29;
	
	
	ts=obj.firstChild.getElementsByTagName("DIV");
	ts[1].style.pixelWidth=width-4;
	ts[2].style.pixelLeft=width+1;

	//--------------resize button
	btns=ts[1].getElementsByTagName("A");
	for(ri=btns.length-2;ri>=0;ri--){
		btns[ri].firstChild.style.pixelLeft=width-24*(btns.length-ri-1)-5;
	}
		
	if(height!=null) obj.style.pixelHeight=height;
	if(width!=null) obj.style.pixelWidth=width;
}
function high(which2)//¸ßÁÁÏÔÊ¾
{
	if(typeof(which2)=="string") which2=document.getElementById(which2);
	which2.filters.alpha.opacity=50;
	theobject=which2;
	highlighting=setInterval("highlightit(theobject)",50);
}
function low(which2)//»Ö¸´µÍÁÁ
{
	if(typeof(which2)=="string") which2=document.getElementById(which2);
	alert(typeof(which2));
	clearInterval(highlighting);
	alert(which2.filters.item[0]);
	which2.filters.alpha.opacity=50;
	
}

function highlightit(cur2)
{
	if (cur2.filters.alpha.opacity<100)
	{
		cur2.filters.alpha.opacity+=50;
	}
	else if (window.highlighting)
		clearInterval(highlighting)
}
function maxDialog(obj){
	if(obj==null) obj=this;
	if(typeof(obj)=="string") obj=document.getElementById(obj);
	

	if(obj.status=="max"){
		restoreDialog(obj);
		return;
	}
	
	
	if(!obj.canResize) return;
	
	var h=obj.style.pixelHeight;
	var w=obj.style.pixelWidth;
	var t=obj.offsetTop;
	var l=obj.offsetLeft;
	
	obj.h=h;
	obj.w=w;
	obj.t=t;
	obj.l=l;
	obj.status="max";
	
	obj.style.pixelTop=0;
	obj.style.pixelLeft=0;
	
	doc=document.parentWindow.document;
	xpql=document.parentWindow.document.all.xpStatus;
	
	MSDResizeTo(obj.uniqueID,xpql.style.pixelTop-7,xpql.style.pixelWidth-10);
	
}

function restoreDialog(obj){
	if(obj==null) obj=this;
	if(typeof(obj)=="string") obj=document.getElementById(obj);
	
	if(obj.style.display=="none") obj.style.diaplay="";
	if(!obj.canResize) return;
	obj.style.pixelTop=obj.t;
	
	obj.style.pixelLeft=obj.l;
	obj.status="normal";
	
	MSDResizeTo(obj.uniqueID,obj.h,obj.w)
	
}
function MSDMin(obj){
	if(typeof(obj)=="string") obj=document.getElementById(obj);
	obj.style.display="none";
}

