
/**
 * 弹出窗口
 * 用于提示错误、成功信息、警告等
 * 创建日期 2007-4-9
 * @author Harold.HH
 * @version 1.0
 */

<!--根据元素编号来获取元素，私有方法-->
/*和prototype.js冲突
function $(_sId){return document.getElementById(_sId)}
*/
function $E(id,targetDoc){
	var doc = targetDoc ? targetDoc : document;
	return doc.getElementById(id);
}
var dialog = function(targetWin,targetDoc){
	this.win= targetWin ? targetWin : window;
	this.doc= targetDoc ? targetDoc : window.document;
	this.win.ebDialog = null;
	this.elt = null;
	<!--弹出窗口的标题-->
	var titile = '';
	<!--弹出窗口的宽度-->
	var width = 300;
	<!--弹出窗口的高度-->
	var height = 180;
	<!--弹出窗口的展示图片的地址动态使用-->
	var src = "";
	<!--使用皮肤的路经-->
	//var path = _contextPath+"/image/face1/";
	//var path = _contextPath + "/website/base/img/";
	var path = _templatePath + "img/";
	<!--确定按钮-->
	var sFunc = '<input id="dialogOk" type="button" style="{width:62px;height:22px;border:0;background:url(\''+path+'smb_btn_bg.gif\');line-height:20px;" value="'+I18n.dialogOKButton+'" onclick="new dialog().reset();" /> <input id="dialogCancel" type="button" style="{width:62px;height:22px;border:0;background:url(\''+path+'smb_btn_bg.gif\');line-height:20px;" value="'+I18n.dialogCancelButton+'" onclick="new dialog().reset();" />';
	//alert(sFunc);
	<!--关闭按钮-->
	var sClose = '<input type="image" id="dialogBoxClose" onclick="new dialog().reset();" src="' + path + 'dialogClose0.gif" border="0" width="17" height="17" onmouseover="this.src=\'' + path + 'dialogCloseF.gif\';" onmouseout="this.src=\'' + path + 'dialogClose0.gif\';" align="absmiddle" />';
		<!--弹出窗口体内容和操作-->
	var sBody = '\
		<table id="dialogBodyBox" style border="0" align="center" cellpadding="0" cellspacing="0">\
			<tr height="10"><td colspan="4"></td></tr>\
			<tr>\
				<td width="10"></td>\
				<td width="80" align="center" valign="absmiddle"><img id="dialogBoxFace"  src="' + path + '3.gif" /></td>\
				<td id="dialogMsg" style="font-size:12px;"></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 #000;display:none;z-index:10;" alt="dialog">\
			<tr height="1" bgcolor="#FFFFFF"><td></td></tr>\
			<tr height="25" bgcolor="#000000">\
				<td>\
					<table onselectstart="return false;" style="-moz-user-select:none;" 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-size:12px;font-weight:bold;">&nbsp;</td>\
							<td id="dialogClose" width="27" align="right" valign="middle">\
								' + sClose + '\
							</td>\
							<td width="6"></td>\
						</tr>\
					</table>\
				</td>\
			</tr>\
			<tr height="2" bgcolor="#EDEDED"><td></td></tr>\
			<tr id="dialogHeight" style="height:' + height + 'px">\
				<td id="dialogBody" valign="top" bgcolor="#ffffff">' + sBody + '</td>\
			</tr>\
		</table>\
		<div id="dialogBoxIframe" width="300px" style="position:absolute;display:none;" frameborder="2"></div>\
		<div id="dialogBoxShadow" style="display:none;z-index:9;"></div>\
	';
	<!--背影-->
	var sBG = '\
		<div id="dialogBoxBG" style="position:absolute;top:0px;left:0px;width:100%;height:200px;background:url('+path+'blank.gif);"></div>\
	';

	<!--具体的表现方式处理一些加广告，带阴影等-->
	this.show = function(){
	
		this.middle('dialogBox');
		this.shadow();
		//$E('adframe').src = '/lm/iframe/20/20070406/16.html';
		$E("dialogBoxBG",this.doc).style.width = this.doc.body.scrollWidth;
		$E("dialogBoxBG",this.doc).style.height = this.doc.body.scrollHeight;
		
		
	}
	<!--重设置方法，元素重新赋值-->
	this.reset = function(){
		$E('dialogBox',this.doc).style.display='none';
		$E('dialogBoxBG',this.doc).style.display='none';
		$E('dialogBoxShadow',this.doc).style.display = "none";
		$E('dialogBoxIframe',this.doc).style.display = "none";
		$E('dialogBody',this.doc).innerHTML = sBody;
		changeShow(this.win,this.doc);
		//this.doc.body.removeChild($('_dgc'));
		//alert($('_dgc').outerHTML);//.outerHYML='';
//		var elt=$('pDiv');
//		if (elt)
//	    {
//		    elt.style.display = "none";
//		    elt.parentNode.removeChild(elt);
//  		    this.win.clearInterval(timer)  
//	    }
	     this.win.neatDialog = null;
		}
	<!--接收外部的Html作为信息展示-->
	this.html = function(_sHtml){$E("dialogBody",this.doc).innerHTML = _sHtml;this.show();}
	<!--初始化方法，创建一个span并加入-->
	this.init = function(){
		
		$E('dialogCase',this.doc) ? $E('dialogCase',this.doc).parentNode.removeChild($E('dialogCase',this.doc)) : function(){};
		  
		var oDiv = this.doc.createElement('div');
		oDiv.id = "dialogCase";
		oDiv.style.zIndex="100";
		oDiv.innerHTML = sBG + sBox;	
		
		if(!this.doc.getElementById('pDiv')){
		var bgDiv = this.doc.createElement('div');
		bgDiv.id="pDiv";
		bgDiv.style.position = 'absolute';
		bgDiv.style.top="0px";
	  	bgDiv.style.left="0px";
	  
		bgDiv.style.width = getBodySize(this.doc).width+"px";
		bgDiv.style.height = getBodySize(this.doc).height+"px";//this.doc.body.clientHeight;//getBodyHeight()<screen.height?screen.height:getBodyHeight()+"px";
		bgDiv.style.zIndex="7";
		bgDiv.style.display="none";
		

	
		this.doc.body.appendChild(bgDiv);

		}

		  this.doc.body.appendChild(oDiv);
		
             

		 hide(this.win,this.doc);
		
	   
	}

function check(_sFuc){
    var sFuc = String(eval(_sFuc));
    if(sFuc != "undefined"){
      var url;
      if(sFuc.indexOf('#')){
         url =  sFuc.split('#')[0];
      }else{
         url = sFuc;
      }
      this.win.location = url;
    }
}

	<!--按钮初始化－可定制按钮的反应值-->
	this.button = function(_sId, _sFuc){
		if($E(_sId,this.doc)){
			$E(_sId,this.doc).style.display = '';
			if($E(_sId,this.doc).addEventListener){

				if($E(_sId,this.doc).act){$E(_sId,this.doc).removeEventListener('click', function(){eval($E(_sId,this.doc).act)}, false);}
				$E(_sId,this.doc).act = _sFuc;
        $E(_sId,this.doc).addEventListener('click', function(){check(_sFuc);}, false);

			}else{

				if($E(_sId,this.doc).act){$E(_sId,this.doc).detachEvent('onclick', function(){eval($E(_sId,this.doc).act)});}
				$E(_sId,this.doc).act = _sFuc;
        $E(_sId,this.doc).attachEvent('onclick', function(){check(_sFuc);});

			}
		}
	}




	<!--设置效果-->
	this.shadow = function(){
		var oShadow = $E('dialogBoxShadow',this.doc);
		var oDialog = $E('dialogBox',this.doc);
		var oIframe = $E('dialogBoxIframe',this.doc);
		oShadow.style.position = "absolute";
		oIframe.style.position = "absolute";
		oShadow.style.background	= "#000000";
		oShadow.style.display	= "";
		oIframe.style.display	= "";
		oShadow.style.opacity	= "0.2";
		oShadow.style.filter = "alpha(opacity=20)";

		oShadow.style.top = (oDialog.offsetTop + 6)+"px";
		oShadow.style.left = (oDialog.offsetLeft + 6)+"px";
		oShadow.style.width = oDialog.offsetWidth;
		oShadow.style.height = oDialog.offsetHeight;
		oIframe.style.top = oDialog.offsetTop+"px";
		oIframe.style.left = oDialog.offsetLeft+"px";
		oIframe.style.width = oDialog.offsetWidth+"px";
		oIframe.style.height = oDialog.offsetHeight+"px";
	
	}
	<!--展示-->
	this.open = function(_sUrl, _sMode){
		this.show();
		if(!_sMode || _sMode == "no" || _sMode == "yes"){
			$E("dialogBody",this.doc).innerHTML = "<iframe id=\"_openIframe\" style=\"margin:0px;padding:0px;height:"+height+"px \"  src='" + _sUrl + "' frameborder='0' scrolling='" + _sMode + "'></iframe>";
		}
	}
	this.showWindow = function(_sUrl, _iWidth, _iHeight, _sMode, _sTitle){
		var oWindow;
		var sLeft = (screen.width) ? (screen.width - _iWidth)/2 : 0;
		var iTop = -80 + (screen.height - _iHeight)/2;
		iTop = iTop > 0 ? iTop : (screen.height - _iHeight)/2;
		var sTop = (screen.height) ? iTop : 0;
		if(this.win.showModalDialog && _sMode == "m"){
			oWindow = this.win.showModalDialog(_sUrl,_sTitle,"dialogWidth:" + _iWidth + "px;dialogheight:" + _iHeight + "px");
		} else {
			oWindow = this.win.open(_sUrl, _sTitle, 'height=' + _iHeight + ', width=' + _iWidth + ', top=' + sTop + ', left=' + sLeft + ', toolbar=no, menubar=no, scrollbars=' + _sMode + ', resizable=no,location=no, status=no');
			this.reset();
		}
	}
	<!--增加按钮，更换按钮-->
	this.event = function(_sMsg, _sOk, _sCancel, _sClose){
		$E('dialogFunc',this.doc).innerHTML = sFunc;
		$E('dialogClose',this.doc).innerHTML = sClose;
		$E('dialogBodyBox',this.doc) == null ? $E('dialogBody',this.doc).innerHTML = sBody : function(){};
		$E('dialogMsg',this.doc) ? $E('dialogMsg',this.doc).innerHTML = _sMsg  : function(){};
		_sOk && _sOk != "" ? this.button('dialogOk', _sOk)| $E('dialogOk',this.doc).focus() : $E('dialogOk',this.doc).style.display = 'none';
		_sCancel && _sCancel != "" ? this.button('dialogCancel', _sCancel) : $E('dialogCancel',this.doc).style.display = 'none';
		//_sOk ? this.button('dialogOk', _sOk) : _sOk == "" ? function(){} : $E('dialogCancel').style.display = 'none';
		//_sCancel ? this.button('dialogCancel', _sCancel) : _sCancel == "" ? function(){} : $E('dialogCancel').style.display = 'none';
		_sClose ? this.button('dialogBoxClose', _sClose) : function(){};
		this.show();
		this.middle('dialogBox');
	}
	this.set = function(_oAttr, _sVal){
		var oShadow = $E('dialogBoxShadow',this.doc);
		var oDialog = $E('dialogBox',this.doc);
		var oHeight = $E('dialogHeight',this.doc);
		var oIframe = $E('dialogBoxIframe',this.doc);
		if(_sVal != ''){
			switch(_oAttr){
				case 'title':
					$E('dialogBoxTitle',this.doc).innerHTML = _sVal;
					title = _sVal;
					break;
				case 'width':
					oDialog.style.width = _sVal+"px";
					width = _sVal;
					break;
				case 'height':
					oHeight.style.height = _sVal+"px";
					height = _sVal;
					break;
				case 'src':
					if(parseInt(_sVal) > 0){
						$E('dialogBoxFace',this.doc) ? $E('dialogBoxFace',this.doc).src = path + _sVal + '.gif' : function(){};
					}else{
						$E('dialogBoxFace',this.doc) ? $E('dialogBoxFace',this.doc).src = _sVal : function(){};
					}
					src = _sVal;
					break;
			}
		}
		this.middle('dialogBox');
		oShadow.style.top = (oDialog.offsetTop + 6)+"px";
		oShadow.style.left = (oDialog.offsetLeft + 6)+"px";
		oShadow.style.width = oDialog.offsetWidth+"px";
		oShadow.style.height = oDialog.offsetHeight+"px";
		oIframe.style.top = oDialog.offsetTop+"px";
		oIframe.style.left = oDialog.offsetLeft+"px";
		oIframe.style.width = oDialog.offsetWidth+"px";
		oIframe.style.height = oDialog.offsetHeight+"px";
	}
	this.moveStart = function (e, _sId){
		function fixE(e) {
			if (typeof e == 'undefined') e = window.event;
			if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
			if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
			return e;
		}
		function getX(e){ return fixE(e).clientX; };
		function getY(e){	return fixE(e).clientY; };
		function drag(e){
			v = document.getElementById(_sId);
			var nX = getX(e);
			var nY = getY(e);
			var ll = v.rL + nX - v.oX;
			var tt = v.rT + nY - v.oY;
			v.style.left = ll + 'px';
			v.style.top  = tt + 'px';
			$E('dialogBoxShadow',this.doc).style.left = ll + 6 +'px';
			$E('dialogBoxShadow',this.doc).style.top = tt + 6 + 'px';
			$E('dialogBoxIframe',this.doc).style.left = ll + 'px';
			$E('dialogBoxIframe',this.doc).style.top = tt + 'px';
			return false;
		}
		function end() {
			document.onmousemove	= null;
			document.onmouseup		= null;
		}
		v = $E(_sId,document);
		v.oX = getX(e);
		v.oY = getY(e);
		v.rL = parseInt(v.style.left ? v.style.left : 0);
		v.rT = parseInt(v.style.top  ? v.style.top  : 0);
		document.onmousemove = drag;
		document.onmouseup	 = end;
		return false;
	}
	/**
	 * 隐藏或显示模块，将某类型的元素设置为显示或隐藏
	 * @param _sType tagName
	 * @param _sDisplay showModel
	 */
	this.hideModule = function(_sType, _sDisplay){
		var aIframe = this.win.parent.document.getElementsByTagName("iframe");aIframe=0;
		var aType = this.doc.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 = this.doc.frames ? this.doc.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;
			}
		}
	}
	/**
	 * 将对象在其容器中居中显示，目前用于摆正按钮body的位置
	 * @param _sId 对象名称
	 */
	this.middle = function(_sId){
		var obj = this.doc.getElementById(_sId);
		var sClientWidth = getWinSize(this.doc).width;
		var sClientHeight = this.win.parent ? getWinSize(this.win.parent.document).height - 200 : getWinSize(this.doc).height ;
		var sScrollTop ;//= parent ? parent.this.doc.body.scrollTop : this.doc.body.scrollTop;
		if (this.doc.documentElement && this.doc.documentElement.scrollTop)
		 sScrollTop = this.doc.documentElement.scrollTop; 
		 else if (this.doc.body) sScrollTop = this.doc.body.scrollTop;
		obj.style.display = "";
		obj.style.position = "absolute";
		obj.style.left = (sClientWidth - obj.offsetWidth)<0?0:(sClientWidth - obj.offsetWidth)/2 + 'px';
		obj.style.top = (sClientHeight - obj.offsetHeight)<0?0:(sClientHeight - obj.offsetHeight)/2+sScrollTop  + 'px';
		
	}
}
/**
 * 得到当前窗口的body的高度
 * @return body的长度 一般用于计算scroll
 */
 function getBodyHeight(_target){
	 var target = _target ? _target : document;
		if (target.documentElement && target.documentElement.scrollTop){
		 return target.documentElement.scrollTop; 
		}
		 else if (target.body) {
		 	return target.body.scrollHeight;
		 }
 }
/**
 * 得到当前窗口的大小
 * @param _target document 对象
 */

function getWinSize(_target) {
	var windowWidth, windowHeight;
	/*
	if(_target) target = _target.document;
	else	target = document;
	*/
	 var target = _target ? _target : document;
	 /*
	if (self.innerHeight) { //all except Explorer IE支持
		//if(_target) target = _target.self;
		//else	target = self;
		windowWidth = target.innerWidth;
		windowHeight = target.innerHeight;
	} else 
	*/
	if (target.documentElement && target.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = target.documentElement.clientWidth;
		windowHeight = target.documentElement.clientHeight;
	} else if (target.body) { // other Explorers
		windowWidth = target.body.clientWidth;
		windowHeight = target.body.clientHeight;
	}
	
	return {width:parseInt(windowWidth),height:parseInt(windowHeight)};
}
/**
 * 得到当前窗口的body的size
 * getBodySize()
 */

function getBodySize(_target) {
	var windowWidth, windowHeight;
	/*
	if(_target) target = _target.document;
	else	target = document;
	*/
	 var target = _target ? _target : document;
	
	if(browser.isIE){
		windowWidth = target.body.clientWidth;
		windowHeight =target.body.clientHeight;
	}else if(browser.isNS){
		windowWidth = target.documentElement.scrollWidth;
		windowHeight = target.documentElement.scrollHeight;//.clientHeight;
	}else{
		windowWidth = target.body.clientWidth;
		windowHeight = target.body.clientHeight;
	}
		
	return {width:parseInt(windowWidth),height:parseInt(windowHeight)};
}
/**
 * 弹出窗口的入口程序－一般用于错误显示
 * @param msg 将要在弹出窗口显示的消息
 * @param click ok按钮的innerHTML
 * @param icon 要显示图标的名称
 * @param title 窗口上方标题的显示

 */
function _error_msg_show(msg, click, icon, title)
{
    click = click ? click : ' ';
    icon = icon ? icon : '';
    title = title ? title : I18n.dialogDefaultTip;

    switch (icon)
    {
    case 'forbid':
        icon = 1;
        break;

    case 'succ':
        icon = 2;
        break;

    case 'smile':
        icon = 3;
        break;

    case 'forget':
        icon = 4;
        break;

    case 'sorry':
        icon = 5;
        break;

    case 'care':
        icon = 6;
        break;

    case '':
        icon = 3;
        break;
    }

    dg=new dialog();
    
    dg.init();
       
    dg.set('src', icon);
      
    dg.set('title', title);
      
    msg = "<font color='#000'>"+msg+"</font>";//为提示信息统一加上默认的字体颜色（临时解决黑色模版下，提示信息显示不出来的问题）
      
    dg.event(msg, click, '', click);
}
/**
 * 弹出窗口的入口程序－一般用于错误信息
 * @param msg 将要在弹出窗口显示的消息
 * @param click ok按钮的innerHTML
 * @param icon 按钮的名称
 * @param top 离窗口上方的距离
 * @param left 离窗口左方的距离
 * @param width 宽度
 * @param height 高度
 */
function _win_error_msg_show(msg, click, icon, top, left, width, height)
{
    click = click ? click : ' ';
    icon = icon ? icon : '';
    title = I18n.dialogDefaultTip;
    top = top ? top : 80;
    switch (icon)
    {
    case 'forbid':
        icon = 1;
        break;

    case 'succ':
        icon = 2;
        break;

    case 'smile':
        icon = 3;
        break;

    case 'forget':
        icon = 4;
        break;

    case 'sorry':
        icon = 5;
        break;

    case 'care':
        icon = 6;
        break;

    case '':
        icon = 5;
        break;
    }
    dg=new dialog();
    dg.init();

    dg.set('src', icon);

    dg.set('title', title);
	
    if (width)
    {
    	
        dg.set('width', width);
    }
    if (height)
    {
        dg.set('height', height);
    }

   

	
    if (left)
    {
    	 document.getElementById('dialogBox').style.left = left+"px";
         document.getElementById('dialogBoxShadow').style.left = left+"px";
    }
    if (top)
    {
		 document.getElementById('dialogBox').style.top = top+"px";
		 document.getElementById('dialogBoxShadow').style.top = top+"px";
    }
    dg.event(msg, click, '', click);
  
 
}
/**
 * 弹出窗口的入口程序－一般用于确认
 * @param msg 将要在弹出窗口显示的消息
 * @param click_ok ok按钮的innerHTML
 * @param clcik_no 取消按钮的innerHTML
 * @param title 窗口上方标题的显示

 */
function _confirm_msg_show(msg, click_ok, click_no, title)
{
	//_disabled_bg();
    click_ok = click_ok ? click_ok : ' ';
    click_no = click_no ? click_no : ' ';
    title = title ? title : I18n.dialogDefaultTip;

    dg=new dialog();
   
    dg.init();
    dg.set('src', 3);	// smile
    dg.set('title', title);
    dg.event(msg, click_ok, click_no, click_no);
}

/**
 * 弹出窗口的入口程序－一般用于确认
 * @param msg 将要在弹出窗口显示的消息
 * @param click_ok ok按钮的innerHTML
 * @param clcik_no 取消按钮的innerHTML
 * @param top 离窗口上方的距离
 * @param left 离窗口左方的距离
 * @param width 宽度
 * @param height 高度
 */
function _win_confirm_msg_show(msg, click_ok, click_no, top, left, width, height)
{
    click_ok = click_ok ? click_ok : ' ';
    click_no = click_no ? click_no : ' ';
    title = I18n.dialogDefaultTip;
    top = top ? top : 80;

    dg=new dialog();
    dg.init();
    dg.set('src', 3);   // smile
    dg.set('title', title);

    if (width)
    {
        dg.set('width', width);
    }
    if (height)
    {
    	dg.set('height', height);
    }

    dg.event(msg, click_ok, click_no, click_no);

    if (left)
    {
         document.getElementById('dialogBox').style.left = left+"px";
         document.getElementById('dialogBoxShadow').style.left = left+"px";
    }
    if (top)
    {
         document.getElementById('dialogBox').style.top = top+"px";
         document.getElementById('dialogBoxShadow').style.top = top+"px";
    }
  
}

	  
  var   timer   
  var   Opacity   =   0   
  
  function   hide(_targetWin,_target)   {   
	  var target = _target ? _target : document;
	  var targetWin = _targetWin ? _targetWin : window;
      target.getElementById('pDiv').style.display   =   "block"   

      Opacity   =   0   
   	  
   
      //changeHidden(); 
	  if(target==document){
      timer   =   targetWin.setInterval("changeHidden()",   5);
	  }else{
		changeHidden(_targetWin,_target);
	  }
	
  }   
    
  function   changeHidden(_targetWin,_target)   
  {   
	  var target = _target ? _target : document;
	  var targetWin = _targetWin ? _targetWin : window;
    /**  if   (Opacity   ==   50)   
      {   
          this.win.clearInterval(timer)   
          return   
      }   
      */

      //Opacity   = 50;//  (   Opacity   +   50   )   >   50   ?   50   :   Opacity   +   3   
      //       document.getElementById('pDiv').style.filter   =   "Alpha(Opacity="     +   Opacity   +   ")"   
	  if(timer == undefined){
		Opacity = 0.5;
	  }else{
		  if   (Opacity   >=   0.5)   
			  {   
				  targetWin.clearInterval(timer);
				  return;   
			  }   
			Opacity+=0.06;
	  }
     if(browser.isIE){
     	 target.getElementById('pDiv').style.filter  ="progid:DXImageTransform.Microsoft.Alpha(opacity=0,finishOpacity=50,style=0)"
       //document.getElementById('pDiv').style.opacity =Opacity;
         target.getElementById('pDiv').filters.item('DXImageTransform.Microsoft.Alpha').opacity=Opacity*100;
     	
     }else if(browser.isNS){
     	 //target.getElementById('pDiv').style.filter  ="progid:DXImageTransform.Microsoft.Alpha(opacity=0,finishOpacity=50,style=0)"
         target.getElementById('pDiv').style.opacity =Opacity;     	
     }
       target.getElementById('pDiv').style.backgroundColor="#f0f0f0";
  }    
  function   changeShow(_targetWin,_target)   
  {   
	  var target = _target ? _target : document;
	  var targetWin = _targetWin ? _targetWin : window;
		target.getElementById('pDiv').style.backgroundColor="";
		Opacity=0;	
     if(browser.isIE){
       target.getElementById('pDiv').filters.item('DXImageTransform.Microsoft.Alpha').opacity=Opacity*100;
     	
     }else if(browser.isNS){
       target.getElementById('pDiv').style.opacity =Opacity;     	
     }
       target.getElementById('pDiv').style.display="none";
	if(timer != undefined){
		targetWin.clearInterval(timer);
	}
	return   
        
  }   
    
  function   cc(_targetWin,_target)   
  {   
	  var target = _target ? _target : document;
	  var targetWin = _targetWin ? _targetWin : window;
	  if(target==document){
		timer   =   targetWin.setInterval('changeShow()',   5); 
	  }else{
		changeShow(_targetWin,_target);
	  }
  
  }   
function showWindow(_sUrl, _sWidth, _sHeight, _sTitle, _sScroll,_login)

{

var oEdit = new dialog();
		oEdit.init();
		if(!_login && _needlogin){
		oEdit.set('title', _sTitle ? _sTitle : I18n.dialogDefaultTip );
		oEdit.set('width', 280);oEdit.set('height', 220);
		oEdit.open(_contextPath+"/Base?tf=loginshow", _sScroll ? 'no' : 'yes');
		}else{
		
		oEdit.set('title', _sTitle ? _sTitle : I18n.dialogDefaultTip );
		oEdit.set('width', _sWidth);oEdit.set('height', _sHeight);
		oEdit.open(_sUrl, _sScroll ? 'no' : 'yes');
		
	}	
	
	return ;
}
function closWindow(){
  new dialog().reset();
}
  
