Dialog = {
	height:400,
	width:600,
	bg:"",
	wh:function(){return Math.max(document.body.clientHeight,document.body.scrollHeight);},
	ww:function(){return Math.max(document.body.clientWidth,document.body.scrollWidth);},
	top:function(){return parseInt((document.body.clientHeight-this.height)/2)+document.body.scrollTop},
	left:function(){return parseInt((this.ww()-this.width)/2)},
	msg:function(title,str){
		var sels = document.body.getElementsByTagName("SELECT")
		for (var i=0;i<sels.length;i++){
			sels[i].style.display="none";
		}
		var masker = document.getElementById("Masker");
		if (!masker){
			var div = document.createElement("DIV");
			div.style.backgroundColor="#000000";
			div.style.width=this.ww()+"px";
			div.style.height=this.wh()+"px";
			div.style.position="absolute";
			div.style.top="0px";
			div.style.left="0px";
			div.style.zIndex="99";
			div.style.opacity="0.50";
			div.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50,finishOpacity=100)";
			div.setAttribute("id","Masker");
			document.body.appendChild(div);
			div=null;
		}else{
			masker.style.display='';
			masker.style.height="0px";
			masker.style.width=this.ww()+"px";
			masker.style.height=this.wh()+"px";
		}
		var win = document.getElementById("Win");
		if (!win){
			var div = document.createElement("DIV");
			div.style.backgroundColor="#FFFFFF";
			div.style.width=this.width+"px";
			div.style.height=this.height+"px";
			div.style.position="absolute";
			div.style.top=this.top()+"px";
			div.style.left=this.left()+"px";
			div.style.zIndex="999";
			div.style.border="1px solid #8A8A8A";
			div.setAttribute("id","Win");
			document.body.appendChild(div);
			var ttldiv =  document.createElement("DIV");
			ttldiv.style.backgroundColor="#d29649";
			if (document.all) ttldiv.style.width=this.width+"px"; else ttldiv.style.width=(this.width-12)+"px";
			if (document.all) ttldiv.style.height="28px"; else ttldiv.style.height="15px";
			ttldiv.style.border = "1px solid #ffffff";
			ttldiv.style.color="#ffffff";
			ttldiv.style.paddingTop="7px";
			ttldiv.style.paddingLeft="5px";
			ttldiv.style.paddingRight="5px";
			ttldiv.style.textAlign="right";
			ttldiv.style.fontWeight="bold";
			ttldiv.setAttribute("id","Win_title")
			ttldiv.innerHTML += "<span style='float:left;color:#ffffff;'>"+title+"</span>";
			ttldiv.innerHTML += "<span style='background-color:#FEFEFE;padding:1px;color:#000000;border:1px solid #999999;font-size:7px;cursor:pointer;' onclick='Dialog.close()' onmouseover=\"this.style.border='1px solid #ffffff';\" onmouseout=\"this.style.border='1px solid #999999';\" title='¹Ø±Õ'>&#9587;</span>";
			div.appendChild(ttldiv);
			var bodydiv = document.createElement("DIV");
			if (document.all) bodydiv.style.width=(this.width-2)+"px"; else bodydiv.style.width=(this.width-11)+"px";
			if (document.all) bodydiv.style.height=(this.height-24)+"px"; else bodydiv.style.height=(this.height-35)+"px";
			bodydiv.style.borderTop = "1px solid #999999";
			bodydiv.style.padding="5px";
			bodydiv.style.marginLeft="1px";
			bodydiv.style.marginRight="1px";
			bodydiv.style.color="#333333";
			bodydiv.style.overflow="auto";
			bodydiv.style.textAlign="left";
			bodydiv.innerHTML = str;
			bodydiv.setAttribute("id","Win_body")
			if (this.bg!=''){
				bodydiv.style.backgroundImage="url('"+this.bg+"')";
			}
			div.appendChild(bodydiv);
			div=null;
		}else{
			win.style.display='';
			win.style.width=this.width+"px";
			win.style.height=this.height+"px";
			win.style.top=this.top()+"px";
			win.style.left=this.left()+"px";

			var wt = document.getElementById("Win_title");
			var wb = document.getElementById("Win_body");

			if (document.all) wt.style.width=(this.width)+"px"; else wt.style.width=(this.width-12)+"px";
			if (document.all) wb.style.width=(this.width-2)+"px"; else wb.style.width=(this.width-11)+"px";
			if (document.all) wb.style.height=(this.height-24)+"px"; else wb.style.height=(this.height-35)+"px";

			wt.getElementsByTagName("SPAN")[0].innerHTML = title;
			wb.innerHTML = str;
		}
	},
	close:function(){
		var sels = document.body.getElementsByTagName("SELECT")
		for (var i=0;i<sels.length;i++){
			sels[i].style.display="";
		}
		var masker = document.getElementById("Masker");
		var win = document.getElementById("Win");
		masker.style.display='none';
		win.style.display='none';
	}
}