function disableDiv(){
		var getDisdiv = document.getElementById("oDisDiv");
 		if(!getDisdiv){
 		var mainHeight = document.body.clientHeight;
 		var mainWidth = document.body.clientWidth;
		var oDisDiv = document.createElement("DIV");
		oDisDiv.style.position = "absolute";
		oDisDiv.style.background	= "#dfecfd";
		oDisDiv.style.opacity = "0.5";
		oDisDiv.style.filter = "alpha(opacity=50)";
		oDisDiv.style.top = 0;
		oDisDiv.style.left = 0;
		oDisDiv.style.width = mainWidth;
		oDisDiv.style.height = mainHeight;
		oDisDiv.style.zIndex = 901;
		oDisDiv.id="oDisDiv";
		document.body.appendChild(oDisDiv);
	} else {
		document.getElementById("oDisDiv").style.display="";
	}
}
function removeDisdiv(){
		var getDisdiv = document.getElementById("oDisDiv");
   	if(getDisdiv){
   		getDisdiv.style.display="none";
   	}
};
 function dialog(){
	var titile = '';
	var width = 300;
	var height = 180;
	var src = "";
	var path ="./images/";
	var sFunc = '<input id="dialogOk" type="button" class="btnNormal" value="确认" onclick="new dialog().reset();" /> <input id="dialogCancel" type="button" class="btnNormal" value="取消" onclick="new dialog().reset();" />';
	var sClose = '<input type="image" id="dialogBoxClose" onclick="new dialog().reset();removeDisdiv();" src="'+prjContextPath+'/images/BtnGb.gif" border="0" width="15" height="15" onmouseover="this.src=\''+prjContextPath+'/images/BtnGb2.gif\';" onmouseout="this.src=\''+prjContextPath+'/images/BtnGb.gif\';" align="absmiddle" />';
	var sBody = '\
		<table  id="dialogBodyBox" border="0" align="center" cellpadding="0" cellspacing="0" width="100%" style="background:#fff; height:90px;">\
			<tr height="10"><td colspan="4" align="center"></td></tr>\
			<tr height="10"><td colspan="4" align="center"></td></tr>\
			<tr>\
				<td width="10"></td>\
				<td width="80" align="center" valign="middle"><img id="dialogBoxFace" src="' + path + '6.gif" /></td>\
				<td id="dialogMsg" style="font-size:14px;color:#06559b;"></td>\
				<td width="10"></td>\
			</tr>\
			<tr height="10"><td colspan="4" align="center"></td></tr>\
			<tr></tr>\
		</table>\
		<table style="width:100%; height:40px; background:url(./images/btnTableBG.gif) repeat-x; ">\
		<tr><td id="dialogFunc" colspan="4" align="center">' + sFunc + '</td></tr>\
		</table>\
	';
	
	var sBox = '\
		<table id="dialogBox" class="" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="display:none;z-index:999; border:none;border-collapse:collapse; ">\
			<tr>\
				<td class="">\
					<table onselectstart="return false;" class="ideal-window-header-Bg" style="-moz-user-select:none;" width="100%" border="0" cellpadding="0" cellspacing="0">\
						<tr>\
							<td class="ideal-window-header-LeftBg"></td>\
								<td id="dialogBoxTitle" onmousedown="new dialog().moveStart(event, \'dialogBox\')" style="color:#0a3353;cursor:move;font-size:12px;font-weight:bold;padding-top:2px;padding-left:13px;">系统提示信息</td>\
							<td id="dialogClose" width="27" align="right" valign="middle">\
								' + sClose + '\
							</td>\
							<td width="6" class="ideal-window-header-RightBg" style="border:1px solid red;"></td>\
						</tr>\
					</table>\
				</td>\
			</tr>\
			<tr id="dialogHeight" style="height:' + height + '">\
				<td id="dialogBody" style="background:#fff;color:#000; padding:0px; border:1px solid #8db3e4;border-top:0px none;">' + sBody + '</td>\
			</tr>\
		</table>\
		<div id="dialogBoxShadow" onmousedown="new dialog().moveStart(event, \'dialogBox\')" style="display:none;z-index:998;cursor:move;"></div>\
	';
	
	/***
	 * add by hongpeng_dong 2007.12.18
	 * 消息和confirm框
	 *
	 * 去掉了标题上左边的图片 by hongpeng_dong at 2008.3.7
	 * <td class="windApp"></td>\ 本放在系统提示信息之前
	 */
	var messageBody = '\
		<table id="dialogBox" class="windBg" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="display:none;z-index:999;border-collapse:collapse;">\
			<tr height="22" >\
				<td class="windLeftBg">\
					<table onselectstart="return false;" style="-moz-user-select:none;" width="100%" border="0" cellpadding="0" cellspacing="0">\
						<tr>\
							<td id="dialogBoxTitle" onmousedown="new dialog().moveStart(event, \'dialogBox\')" style="color:#000;cursor:move;font-size:12px;padding-top:2px;padding-left:7px;">系统提示信息</td>\
							<td id="dialogClose" width="27" align="right" valign="middle">\
								' + sClose + '\
							</td>\
							<td width="6" class="windRightBg"></td>\
						</tr>\
					</table>\
				</td>\
			</tr>\
			<tr id="dialogHeight" style="height:' + height + '">\
				<td id="dialogBody" valign="top" style="background:#eef2f6;color:red; padding:0px;font-size:14px;color:#06559b;">\
				' + sBody + '\
				</td>\
			</tr>\
		</table>\
		<div id="dialogBoxShadow" onmousedown="new dialog().moveStart(event, \'dialogBox\')" style="display:none;z-index:998;cursor:move;"></div>\
	';
	function $(_sId){return document.getElementById(_sId)}
	this.show = function(){$('dialogBodyBox') ? function(){} : this.init();this.middle('dialogBox');this.shadow();}
	//for setMessage
	this.messageShow = function(){$('dialogBodyBox') ? function(){} : this.messageInit();this.middle('dialogBox');this.shadow();}
	this.reset = function(){
		this.hideModule('select', '');
		$('dialogBox').style.display='none';
		$('dialogBoxShadow').style.display = "none";
		$('dialogBody').innerHTML = sBody;
		removeDisdiv();
		}
	this.html = function(_sHtml){$("dialogBody").innerHTML = _sHtml;this.show();}
	this.init = function(){
		$('dialogCase') ? $('dialogCase').parentNode.removeChild($('dialogCase')) : function(){};
		var oDiv = document.createElement('span');
		oDiv.id = "dialogCase";
		oDiv.innerHTML = sBox;
		this.hideModule('select', 'none');
		document.body.appendChild(oDiv);
	}
	/**
	 * add by hongpeng_dong 2007.12.18
	 * 为了和弹出页面分离 专门为setMessage和代替confirm设计
	 */
	this.messageInit = function(){
		$('dialogCase') ? $('dialogCase').parentNode.removeChild($('dialogCase')) : function(){};
		var oDiv = document.createElement('span');
		oDiv.id = "dialogCase";
		oDiv.innerHTML = messageBody;
		this.hideModule('select', 'none');
		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');
		oShadow['style']['position'] = "absolute";
		oShadow['style']['background']	= "#b5c6d1";
		oShadow['style']['display']	= "";
		oShadow['style']['opacity']	= "0.5";
		oShadow['style']['filter'] = "alpha(opacity=50)";
		oShadow['style']['top'] = oDialog.offsetTop + 3;
		oShadow['style']['left'] = oDialog.offsetLeft + 3;
		oShadow['style']['width'] = oDialog.offsetWidth;
		oShadow['style']['height'] = oDialog.offsetHeight;
	}
	//for setMessage
	this.messageOpen = function(_sUrl){
		this.messageShow();
			$("dialogBody").innerHTML = "<iframe id='dialogFrame' width='100%' height='100%' frameborder='0' style='overflow:auto;'></iframe>";
			$("dialogFrame").src = _sUrl;
	}
	this.open = function(_sUrl){
		this.show();
			$("dialogBody").innerHTML = "<iframe id='dialogFrame' width='100%' height='100%' frameborder='0' style='overflow:auto;'></iframe>";
			$("dialogFrame").src = _sUrl;
	}
	this.showWindow = function(_sUrl, _iWidth, _iHeight, _sMode){
		var oWindow;
		var sLeft = (screen.width) ? (screen.width - _iWidth)/2 : 0;
		var sTop = (screen.height) ? (screen.height - _iHeight)/2 : 0;
		if(window.showModalDialog && _sMode == "m"){
			oWindow = window.showModalDialog(_sUrl,"","dialogWidth:" + _iWidth + "px;dialogheight:" + _iHeight + "px");
		} else {
			oWindow = window.open(_sUrl, '', 'height=' + _iHeight + ', width=' + _iWidth + ', top=' + sTop + ', left=' + sLeft + ', toolbar=no, menubar=no, scrollbars=' + _sMode + ', resizable=no,location=no, status=no');
		}
	}
	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 + '.gif' : function(){};
					}else{
						$('dialogBoxFace') ? $('dialogBoxFace').src = _sVal : function(){};
					}
					src = _sVal;
					break;
			}
		}
		this.middle('dialogBox');
		oShadow['style']['top'] = oDialog.offsetTop + 3;
		oShadow['style']['left'] = oDialog.offsetLeft + 3;
		oShadow['style']['width'] = oDialog.offsetWidth;
		oShadow['style']['height'] = oDialog.offsetHeight;
	}
	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;
			oObj.style.top = iTop;
			$('dialogBoxShadow').style.left = iLeft + 3;
			$('dialogBoxShadow').style.top = iTop + 3;
			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;
				oObj.style.top = backData.x;
				$('dialogBoxShadow').style.left = backData.y + 6;
				$('dialogBoxShadow').style.top = backData.x + 6;
			}
			oObj.releaseCapture ? oObj.releaseCapture() : function(){};
		}
	}
	this.hideModule = function(_sType, _sDisplay){
		//var aIframe = parent.document.getElementsByTagName("iframe");aIframe=0;
		//控制上层弹出窗口 屏蔽iframe中的下拉框
		var aIframe = document.getElementsByTagName("iframe");//aIframe=0;
		var aType = document.getElementsByTagName(_sType);
		var iChildObj, iChildLen;
		for (var i = 0; i < aType.length; i++){
			aType[i].style.display	= _sDisplay;
		}
		for (var j = 0; j < aIframe.length; j++){
			iChildObj = document.frames ? document.frames[j] : aIframe[j].contentWindow;
			iChildLen = iChildObj.document.body.getElementsByTagName(_sType).length;
			for (var k = 0; k < iChildLen; k++){
				iChildObj.document.body.getElementsByTagName(_sType)[k].style.display = _sDisplay;
			}
		}
	}
	this.middle = function(_sId){
		document.getElementById(_sId)['style']['display'] = '';
		document.getElementById(_sId)['style']['position'] = "absolute";
		document.getElementById(_sId)['style']['left'] = (document.body.clientWidth / 2) - (document.getElementById(_sId).offsetWidth / 2);
		document.getElementById(_sId)['style']['top'] = (document.body.clientHeight / 2 + document.body.scrollTop) - (document.getElementById(_sId).offsetHeight / 2);
	}
	this.get=function(_id)
	{
		var s = "dialogFrame";
		var win=document.frames?document.frames[s]:$(s).contentWindow;
		return win.document.getElementById(_id);
	}
}
/**
 *  add by hongpeng_dong 2007.12.18
 *	open a message window
 *  为了和弹出页面的样式分离 单独为setMessage设计
 *	@param: _sUrl
 *	@param: _sWidth
 *	@param: _sHeight
 *	@param: _sTitle
 *	@param: _sScroll
 */
function openMessageWindow(_sUrl, _sWidth, _sHeight, _sTitle)
{
	disableDiv();
	if(_sTitle == 'uploadImg')
		_sTitle = '图片上传页面';
	var oEdit = new dialog();
	oEdit.messageInit();
	oEdit.set('title', _sTitle ? _sTitle : "系统提示信息" );
	oEdit.set('width', _sWidth);
	oEdit.set('height', _sHeight);
	oEdit.messageOpen(_sUrl);
	return oEdit;
}
/**
 *	open a custom window
 *	@param: _sUrl
 *	@param: _sWidth
 *	@param: _sHeight
 *	@param: _sTitle
 *	@param: _sScroll
 */

function openWindow(_sUrl, _sWidth, _sHeight, _sTitle,_sEventSource)
{
	disableDiv();
	if(_sTitle == 'uploadImg')
		_sTitle = '图片上传页面';
	var oEdit = new dialog();
	oEdit.init();
	oEdit.set('title', _sTitle ? _sTitle : "系统提示信息" );
	oEdit.set('width', _sWidth);
	oEdit.set('height', _sHeight);
	oEdit.open(_sUrl);
	return oEdit;
}
function openWindowNoTitle(_sUrl, _sWidth, _sHeight, _sTitle)
{
	var oEdit = new dialogNoTitle();
	oEdit.init();
	oEdit.set('title', _sTitle ? _sTitle : "系统提示信息" );
	oEdit.set('width', _sWidth);
	oEdit.set('height', _sHeight);
	oEdit.open(_sUrl);
	return oEdit;
}

function _confirm_msg_show(msg, click_ok, click_no, title)
{
	disableDiv();
    click_ok = click_ok ? click_ok : ' ';
    click_no = click_no ? click_no : ' ';
   // title = title ? title : '【系统提示信息】';
    //title = '<span class=MenuWhite>'+title+'</span>';
    dg=new dialog();
    dg.messageInit();
    dg.set('src', 8);	// smile
    //dg.set('title', title ? title : "【系统提示信息】" );
    dg.set('title', title ? title : "【系统提示信息】" );
    //dg.set('title', title);
    dg.set('width', '300');
    dg.set('height', '120');
    dg.event(msg, click_ok, click_no, click_no);
}