<!--
function dialog(rooturl){
	var titile = '';
	var width = 300;
	var height = 150;
	var src = "";
	var rooturl = SystemAbsolutPath;
	var path = rooturl+"images/dialog/";
	var sFunc = '<input id="dialogOk" type="button" style="font:12px \'Microsoft YaHei\',Verdana; width:71px; height:22px; line-height:24px; border-style:none; background:transparent url('+path+'button_out.jpg);"  onmouseover=\'BtnOver(this,"'+path+'");\' onmouseout=\'BtnOut(this,"'+path+'");\' value="确 认" onclick="new dialog(\''+rooturl+'\').reset();" /> <input id="dialogCancel" type="button" style="font:12px \'Microsoft YaHei\',Verdana; width:71px; height:22px; line-height:24px; border-style:none; background:transparent url('+path+'button_out.jpg);" onmouseover=\'BtnOver(this,"'+path+'");\' onmouseout=\'BtnOut(this,"'+path+'");\' value="取 消" onclick="new dialog(\''+rooturl+'\').reset();" />';
	var sClose = '<input type="image" title="关闭当前窗口" id="dialogBoxClose" onclick="new dialog(\''+rooturl+'\').reset();" src="' + path + 'dialogClose0.gif" border="0" onmouseover="this.src=\'' + path + 'dialogCloseF.gif\';" onmouseout="this.src=\'' + path + 'dialogClose0.gif\';" align="absmiddle" />';
	var sBody = '\
		<table id="dialogBodyBox" style="border:1px solid #54B1F7; border-top:0; background:url('+path+'sBody_bg.png) repeat-x left bottom;" border="0" align="center" cellpadding="0" cellspacing="0" width="100%" height="100%" >\
			<tr height="10"><td colspan="4"></td></tr>\
			<tr>\
				<td width="10"></td>\
				<td width="80" align="center" valign="top" id="ob_boxface" style="padding-top:3px;"><img id="dialogBoxFace" src="' + path + '1.png"  valign="absmiddle" style="behavior:url('+path+'png.htc);" /></td>\
				<td align="left" id="dialogMsg" valign="top" style="font:12px/1.5em \'Microsoft YaHei\',Verdana; color:#000; padding-top:11px;"></td>\
				<td width="10"></td>\
			</tr>\
			<tr height="10"><td colspan="4" align="center"></td></tr>\
			<tr><td id="dialogFunc" colspan="4" align="center">' + sFunc + '</td></tr>\
			<tr height="10"><td colspan="4" align="center"></td></tr>\
		</table>\
	';
	var sBox = '\
		<table id="dialogBox" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #1F3F94; display:none; position:absolute; z-index:20;">\
			<tr height="18" bgcolor="#1577D2" >\
				<td style="border:1px solid #91DEFA; border-bottom:none;">\
					<table onselectstart="return false;" style="-moz-user-select:none; background: url('+path+'win_top.png) repeat-x;" height="27" width="100%" border="0" cellpadding="0" cellspacing="0">\
						<tr>\
							<td width="6" ></td>\
							<td id="dialogBoxTitle" onmousedown="new dialog().moveStart(event, \'dialogBox\')" style="color:#fff; cursor:move; font:bold 12px \'Microsoft YaHei\',Verdana;">提示信息</td>\
							<td id="dialogClose" width="27" align="right" valign="middle">\
								' + sClose + '\
							</td>\
							<td width="6"></td>\
						</tr>\
					</table>\
				</td>\
			</tr>\
			<tr id="dialogHeight" height="' + height + '">\
				<td id="dialogBody" style="background:#fff; color:#000; border:1px solid #91DEFA; border-top:none;">' + sBody + '</td>\
			</tr>\
		</table>\
		<div id="dialogBoxShadow" style="display:none; z-index:9;"></div>\
		<iframe id="dialogBoxDivShim" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;">\
	';
	
	function $(_sId){return document.getElementById(_sId)}
	this.show = function(){$('dialogBodyBox') ? function(){} : this.init();this.middle('dialogBox');this.shadow();}
	this.reset = function(){$('dialogBox').style.display='none';$('dialogBoxShadow').style.display = "none";$('dialogBoxDivShim').style.display = "none";$('dialogBody').innerHTML = sBody;}
	this.html = function(_sHtml){$("dialogBody").innerHTML = _sHtml;this.show();}
	this.init = function(){
		$('dialogCase') ? $('dialogCase').parentNode.removeChild($('dialogCase')) : function(){};
		var oDiv = document.createElement('div');
		oDiv.id = "dialogCase";
		oDiv.style.display = '';
		oDiv.innerHTML = sBox;
		document.body.appendChild(oDiv);
	}
	this.button = function(_sId, _sFuc){
		if($(_sId)){
			$(_sId).style.display = '';
			if($(_sId).addEventListener){
				if($(_sId).act){$(_sId).removeEventListener('click', function(){eval($(_sId).act)}, false);}
				$(_sId).act = _sFuc;
				$(_sId).addEventListener('click', function(){eval(_sFuc)}, false);
			}else{
				if($(_sId).act){$(_sId).detachEvent('onclick', function(){eval($(_sId).act)});}
				$(_sId).act = _sFuc;
				$(_sId).attachEvent('onclick', function(){eval(_sFuc)});
			}
		}
	}
	this.shadow = function(){
		var oShadow = $('dialogBoxShadow');
		var oDialog = $('dialogBox');
		var IfrRef = $('dialogBoxDivShim');
		oShadow.style.position = "absolute";
		oShadow.style.background	= "#000";
		oShadow.style.display	= "";
		oShadow.style.opacity	= "0.2";
		oShadow.style.filter = "alpha(opacity=20)";
		oShadow.style.top = oDialog.offsetTop + 0+"px";
		oShadow.style.left = oDialog.offsetLeft + 0+"px";
		oShadow.style.width = oDialog.offsetWidth+"px";
		oShadow.style.height = oDialog.offsetHeight+"px";
		
		IfrRef.style.width = oDialog.offsetWidth+0+"px";
		IfrRef.style.height = oDialog.offsetHeight+0+"px";
		IfrRef.style.top = oDialog.offsetTop+"px";
		IfrRef.style.left = oDialog.offsetLeft+"px";
		//IfrRef.style.zIndex = DivRef.style.zIndex - 1;
		IfrRef.style.display = "block";
	}
	this.open = function(_sUrl, _sMode){
		this.show();
		if(!_sMode || _sMode == "no" || _sMode == "yes"){
			$("dialogBody").innerHTML = "<iframe id='dialogFrame' width='100%' height='100%' frameborder='0' scrolling='" + _sMode + "'></iframe>";
			$("dialogFrame").src = _sUrl;
		}
	}
	this.event = function(_sMsg, _sOk, _sCancel, _sClose){
		$('dialogFunc').innerHTML = sFunc;
		$('dialogClose').innerHTML = sClose;
		$('dialogBodyBox') == null ? $('dialogBody').innerHTML = sBody : function(){};
		$('dialogMsg') ? $('dialogMsg').innerHTML = _sMsg  : function(){};
		this.show();
		_sOk ? this.button('dialogOk', _sOk) | $('dialogOk').focus() : $('dialogOk').style.display = 'none';
		_sCancel ? this.button('dialogCancel', _sCancel) : $('dialogCancel').style.display = 'none';
		_sClose ? this.button('dialogBoxClose', _sClose) : function(){};
		//_sOk ? this.button('dialogOk', _sOk) : _sOk == "" ? function(){} : $('dialogOk').style.display = 'none';
		//_sCancel ? this.button('dialogCancel', _sCancel) : _sCancel == "" ? function(){} : $('dialogCancel').style.display = 'none';
	}
	this.set = function(_oAttr, _sVal){
		var oShadow = $('dialogBoxShadow');
		var oDialog = $('dialogBox');
		var oHeight = $('dialogHeight');
		if(_sVal != ''){
			switch(_oAttr){
				case 'title':
					$('dialogBoxTitle').innerHTML = _sVal;
					title = _sVal;
					break;
				case 'width':
					oDialog.style.width = _sVal;
					width = _sVal;
					break;
				case 'height':
					oHeight.style.height = _sVal;
					height = _sVal;
					break;
				case 'src':
					if(parseInt(_sVal) > 0){
						$('dialogBoxFace') ? $('dialogBoxFace').src = path + _sVal + '.png' : function(){};
					}else{
						$('dialogBoxFace') ? $('dialogBoxFace').src = _sVal : function(){};
					}
					src = _sVal;
					break;
			}
		}
		this.middle('dialogBox');
		oShadow.style.top = oDialog.offsetTop + 0+"px";
		oShadow.style.left = oDialog.offsetLeft + 0+"px";
		oShadow.style.width = oDialog.offsetWidth+"px";
		oShadow.style.height = oDialog.offsetHeight+"px";
	}
	this.moveStart = function (event, _sId){
		var oObj = $(_sId);
		oObj.onmousemove = mousemove;
		oObj.onmouseup = mouseup;
		oObj.setCapture ? oObj.setCapture() : function(){};
		oEvent = window.event ? window.event : event;
		var dragData = {x : oEvent.clientX, y : oEvent.clientY};
		var backData = {x : parseInt(oObj.style.top), y : parseInt(oObj.style.left)};
		function mousemove(){
			var oEvent = window.event ? window.event : event;
			var iLeft = oEvent.clientX - dragData["x"] + parseInt(oObj.style.left);
			var iTop = oEvent.clientY - dragData["y"] + parseInt(oObj.style.top);
			oObj.style.left = iLeft+"px";
			oObj.style.top = iTop+"px";
			$('dialogBoxShadow').style.left = iLeft + 0+"px";
			$('dialogBoxShadow').style.top = iTop + 0+"px";
			
			$('dialogBoxDivShim').style.left = iLeft+"px";
			$('dialogBoxDivShim').style.top = iTop +"px";
			
			dragData = {x: oEvent.clientX, y: oEvent.clientY};
			

		}
		function mouseup(){
			var oEvent = window.event ? window.event : event;
			oObj.onmousemove = null;
			oObj.onmouseup = null;
			if(oEvent.clientX < 1 || oEvent.clientY < 1 || oEvent.clientX > document.body.clientWidth || oEvent.clientY > document.body.clientHeight){
				oObj.style.left = backData.y +"px";
				oObj.style.top = backData.x +"px";
				$('dialogBoxShadow').style.left = backData.y + 0+"px";
				$('dialogBoxShadow').style.top = backData.x + 0+"px";
				
				$('dialogBoxDivShim').style.left = backData.y +"px";
				$('dialogBoxDivShim').style.top = backData.x +"px";
			}
			oObj.releaseCapture ? oObj.releaseCapture() : function(){};
		}
	}
	this.middle = function(_sId){	
		var theWidth;
		var theHeight;
		if (document.documentElement && document.documentElement.clientWidth) { 
			theWidth = document.documentElement.clientWidth+document.documentElement.scrollLeft*2;;
			theHeight = document.documentElement.clientHeight+document.documentElement.scrollTop*2;; 
		} else if (document.body) { 
			theWidth = document.body.clientWidth;
			theHeight = document.body.clientHeight; 
		}else if(window.innerWidth){
			theWidth = window.innerWidth;
			theHeight = window.innerHeight;
		}
		document.getElementById(_sId).style.display = '';
		document.getElementById(_sId).style.position = "absolute";
		document.getElementById(_sId).style.left = (theWidth / 2) - (document.getElementById(_sId).offsetWidth / 2)+"px";
		//alert(in_ob_useradmin);
		if(document.all||document.getElementById("user_page_top")){
			document.getElementById(_sId).style.top = (theHeight / 2 + document.body.scrollTop) - (document.getElementById(_sId).offsetHeight / 2)+"px";
		}else{
			var sClientHeight = parent ? parent.document.body.clientHeight : document.body.clientHeight;
			var sScrollTop = parent ? parent.document.body.scrollTop : document.body.scrollTop;
			var sTop = -80 + (sClientHeight / 2 + sScrollTop) - (document.getElementById(_sId).offsetHeight / 2);
			document.getElementById(_sId).style.top = sTop > 0 ? sTop : (sClientHeight / 2 + sScrollTop) - (document.getElementById(_sId).offsetHeight / 2)+"px";
			//document.getElementById(_sId).style.top = (theHeight / 2 + document.body.scrollTop) - (document.getElementById(_sId).offsetHeight / 2)+"px";
		}
	}
		
}

BtnOver=function(obj,path) {obj.style.backgroundImage = "url("+path+"button_over.jpg)";}
BtnOut=function(obj,path) {obj.style.backgroundImage = "url("+path+"button_out.jpg)";}

function MsgBox(as_msg)
{
    if(browser.msie)
    {
	    var oDialog = new dialog("");
	    oDialog.init();
	    oDialog.set('src',1);
	    oDialog.event(as_msg, "");
	    oDialog.button("dialogOk", "");
	}
	else
	{
	    alert(as_msg);
	}
}

function MessageBox(as_msg, as_url)
{
	if(browser.msie)
	{
		var oDialog = new dialog(as_url);
		oDialog.init();
		oDialog.set('src',1);
		oDialog.event(as_msg, "");
		oDialog.button("dialogOk", "");
	}
	else
	{
		alert(as_msg);
	}
}

function MsgBoxGoUrl(as_msg, as_url)
{
    if(browser.msie)
    {
	    var oDialog = new dialog("");
	    oDialog.init();
	    oDialog.set('src',1);
	    oDialog.event(as_msg, "");
	    oDialog.button("dialogOk", "gourl('" + as_url + "')");
	}
	else
	{
	    alert(as_msg);
	    gourl(as_url);
	}
}

function ConfirmGoUrl(as_msg, as_url)
{
    if(browser.msie)
    {
	    var oDialog = new dialog("");
	    oDialog.init();
	    oDialog.set('src',1);
	    oDialog.event(as_msg, "");
	    oDialog.button("dialogOk", "gourl('" + as_url + "')");
	    oDialog.button("dialogCancel","");
	}
	else
	{
	    if(confirm(as_msg))
	        gourl(as_url);
	}
}

function gourl(as_url)
{
	location.href = as_url;
}

//选择对话框，确定后指定form的action，form提交-----------------------
//function vb_select_form(as_msg, as_url, as_form)
//{
//	var oDialog = new dialog("");
//	oDialog.init();
//	oDialog.set('src',1);
//	oDialog.event(as_msg, "");
//	oDialog.button("dialogOk", "form_action('" + as_url + "', " + as_form + ")");
//	oDialog.button("dialogCancel","");
//}

//function form_action(as_url, as_form)
//{
//	as_form.action = as_url;
//	as_form.submit();
//}
//-----------------------------------------------------------------
-->

