<!-------BOX-----
var prox;var proy;var proxc;var proyc;
var drag_=false;
var isIe=(document.all)?true:false;
function Move_div(obj){
	var A=new Function('obj','return document.getElementById(obj);')
	var B=new Function('e','if (!e) e = window.event;return e')
	var x,y;
	A(obj).onmousedown=function(e){
		drag_=true;
		with(this){
			style.position="absolute";var temp1=offsetLeft;var temp2=offsetTop;
			x=B(e).clientX;y=B(e).clientY;
			document.onmousemove=function(e){
				if(!drag_)return false;
				with(this){
					style.left=temp1+B(e).clientX-x+"px";
					style.top =temp2+B(e).clientY-y+"px";
				}
			}
		}
		document.onmouseup=new Function("drag_=false");
	}
}
function getPosition() {
        var top    = document.documentElement.scrollTop;
        var left   = document.documentElement.scrollLeft;
        var height = document.documentElement.clientHeight;
        var width  = document.documentElement.clientWidth;
        return {top:top,left:left,height:height,width:width};
}

function setSelectState(state){
        var objl=document.getElementsByTagName('select');
        for(var i=0;i<objl.length;i++){
                objl[i].style.visibility=state;
        }
}

function openWindow(_sUrl,ow,oh,txt,t){
  	clearInterval(prox);clearInterval(proy);clearInterval(proxc);clearInterval(proyc);
	var Hx=document.getElementById("HxUserMsnDiv");
	if(Hx){document.body.removeChild(Hx);}
        var bWidth=parseInt(document.documentElement.scrollWidth);
        var bHeight=parseInt(document.documentElement.scrollHeight);
        if(isIe){setSelectState('hidden');}
        var back=document.createElement("div");
        back.id="back";
        var styleStr="top:0px;left:0px;position:absolute;background:#666666;width:"+bWidth+"px;height:"+bHeight+"px;";
       	styleStr+=(isIe)?"filter:alpha(opacity=50);":"opacity:0.5;";
        back.style.cssText=styleStr;
        document.body.appendChild(back);
	var imagespath = web_url+"img/Dialog/";
	var iwidth  = parseInt(ow);
        var iheight = parseInt(oh);
	if(t=="1") {
        	iwidth  = iwidth+26;
        	var Msg='<div id="dialogMsgDiv" style="overflow:hidden;"><div id="dialogMsg" style="margin:5px;">' + _sUrl + '</div></div>';
	}else {	
        	var Msg='<div id="dialogMsgDiv" style="overflow:hidden;background-color:#fff;"><iframe width="100%" height="100%" src="' + _sUrl + '" frameborder="0" scrolling="no"></iframe></div>';
	}
        var str='\
	<table width="100%" cellspacing="0" cellpadding="0" border="0" style="font-size:12px;line-height:1.8;border-collapse: collapse;">\
	<tr onselectstart="return false;" style="-moz-user-select: -moz-none;cursor:move;" onmousedown="Move_div(&quot;HxUserMsnDiv&quot;)">\
	<td width="13" height="33" style="background-image: url('+imagespath+'dialog_lt.png) !important;background: url('+imagespath+'dialog_lt.gif) no-repeat 0 0;">\
	<div style="width: 13px;"></div></td>\
	<td height="33" style="background-image:url('+imagespath+'dialog_ct.png) !important;background: url('+imagespath+'dialog_ct.gif) repeat-x top;">\
	<div style="padding: 9px 0 0 4px; float: left; font-weight: bold; color:#fff;"><img align="absmiddle" src="'+imagespath+'icon_dialog.gif"/><span id="dialogBoxTitle">'+txt+'</span></div>\
	<div onmouseout="this.style.backgroundImage=\'url({DIALOGIMGPATH}dialog_closebtn.gif)\'" onmouseover="this.style.backgroundImage=\'url({DIALOGIMGPATH}dialog_closebtn_over.gif)\'" style="margin: 6px 0 0;position: relative;top:auto; cursor: pointer; float: right; height: 17px; width: 28px; background: url('+imagespath+'dialog_closebtn.gif) 0 0;" onclick="CloseDiv();"></div></td>\
	<td width="13" height="33" style="background-image: url('+imagespath+'dialog_rt.png) !important;background: url('+imagespath+'dialog_rt.gif) no-repeat right 0;"><div style="width: 13px;"></div></td>\
	</tr><tr valign="top">\
	<td width="13" style="background-image: url('+imagespath+'dialog_mlm.png) !important;background: url('+imagespath+'dialog_mlm.gif) repeat-y left;"></td>\
	<td align="center" bgcolor="#ffffff">' + Msg + '</td>\
	<td width="13" style="background-image: url('+imagespath+'dialog_mrm.png) !important;background: url('+imagespath+'dialog_mrm.gif) repeat-y right;"></td>\
	</tr><tr>\
	<td width="13" height="13" style="background-image: url('+imagespath+'dialog_lb.png) !important;background: url('+imagespath+'dialog_lb.gif) no-repeat 0 bottom;"></td>\
	<td style="background-image: url('+imagespath+'dialog_cb.png) !important;background: url('+imagespath+'dialog_cb.gif) repeat-x bottom;"></td>\
	<td width="13" height="13" style="background-image: url('+imagespath+'dialog_rb.png) !important;background: url('+imagespath+'dialog_rb.gif) no-repeat right bottom;"></td>\
	</tr></table>\
	';
	str=str.replace(/\{DIALOGIMGPATH\}/gm,imagespath);
        var o = document.createElement("div");
	o.id  = "HxUserMsnDiv";
        o.style.display  = "block";
        o.style.position = "absolute";
        o.style.zindex   = "999";
        o.style.width    = "1px";
        o.style.height   = "1px";
        var Position = getPosition();
        var leftadd = (Position.width-ow)/2;
        var topadd  = (Position.height-oh)/2;
        o.style.top  = (Position.top  + topadd)  + "px";
        o.style.left = (Position.left + leftadd) + "px";
        window.onscroll = function (){
                var Position   = getPosition();
                o.style.top  = (Position.top  + topadd)  +"px";
                o.style.left = (Position.left + leftadd) +"px";
        };
        o.innerHTML = str;
        document.body.appendChild(o);
	var q = document.getElementById("dialogMsgDiv");
	q.style.width="1px";
	q.style.height="1px";
	prox = setInterval(function(){openx(o,q,iwidth,iheight,t)},10);
}

function openx(o,q,x,y,t){
  	var cx = parseInt(o.style.width);
  	if(cx < x){
		q.style.width = o.style.width = (cx + Math.ceil((x-cx)/1.5)) +"px";
  	}else{
   		clearInterval(prox);
		var h=t==1?parseInt(document.getElementById("dialogMsg").offsetHeight)+20:y-26;
   		proy = setInterval(function(){openy(o,q,h)},10);
  	}
} 
function openy(o,q,y){
  	var cy = parseInt(o.style.height);
  	if(cy < y){
		q.style.height = o.style.height = (cy + Math.ceil((y-cy)/1.5)) +"px";
  	}else{
		clearInterval(proy);  
	}
} 
function CloseDiv(){
  	clearInterval(prox);clearInterval(proy);clearInterval(proxc);clearInterval(proyc);
	if(isIe){setSelectState('');}
	var b = document.getElementById("back");  
  	var o = document.getElementById("HxUserMsnDiv");
	var q = document.getElementById("dialogMsgDiv");
	if(b){document.body.removeChild(b);}
  	if(o){document.getElementById("dialogBoxTitle").innerHTML = "";proyc = setInterval(function(){closey(o,q)},10);}  
} 

function closey(o,q){
  	var cy = parseInt(o.style.height);
  	if(cy > 0){
		q.style.height = o.style.height = (cy - Math.ceil(cy/1.5)) +"px";
  	}else{
   		clearInterval(proyc);    
   		proxc = setInterval(function(){closex(o,q)},10);
  	}
} 
function closex(o,q){
  	var cx = parseInt(o.style.width);
  	if(cx > 0){
		q.style.width = o.style.width = (cx - Math.ceil(cx/1.5)) +"px";
  	}else{
   		clearInterval(proxc);
		document.body.removeChild(o);
  	}
} 
//=======BOX END=====-->
