  function $(s){return document.getElementById(s);}
  function dialog()
  {
  	var titile = '';
		var width = 300;
		var height = 180;
		var src = "";
		var path = "";
		var f=returnFlash("Loading.swf","0px","0px","loadingswf");
  	var sBox = '\
		<table id="dialogBox" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #000;display:none;z-index:99999;">\
			<tr height="1" bgcolor="#D6E3EB"><td></td></tr>\
			<tr height="25" bgcolor="#6795B4">\
				<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"  style="color:#fff;cursor:move;font-size:12px;font-weight:bold;">&nbsp;</td>\
							<td id="dialogClose" width="27" align="right" valign="middle">\
							</td>\
							<td width="6"></td>\
						</tr>\
					</table>\
				</td>\
			</tr>\
			<tr height="2" bgcolor="#EDEDED"><td></td></tr>\
			<tr id="dialogHeight" style="height:' + height + '">\
				<td id="dialogBody" bgcolor="#ffffff">' + f + '</td>\
			</tr>\
		</table>\
		<div id="dialogBoxShadow" style="display:none;z-index:99998;"></div>\
	';
	
	 sBox = '\
		<table id="dialogBox" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="border:0px;display:none;z-index:99999;">\
			<tr id="dialogHeight" style="height:' + height + '">\
				<td id="dialogBody">' + f + '</td>\
			</tr>\
		</table>\
		<div id="dialogBoxShadow" style="display:none;z-index:99998;"></div>\
	';
	
	
	var sBG = '\
		<div id="dialogBoxBG" style="position:absolute;top:0px;left:0px;width:100%;height:100%;background:url(' + path + 'blank.gif);z-index:99997"></div>\
	';
	
 	this.init = function(){
		$('dialogCase') ? $('dialogCase').parentNode.removeChild($('dialogCase')) : function(){};
		var oDiv = document.createElement('span');
		oDiv.id = "dialogCase";
		oDiv.innerHTML = sBG + sBox;
		document.body.appendChild(oDiv);
		$('dialogBoxBG').style.height = document.body.scrollHeight;
	}
	
	this.middle = function(_sId){
		document.getElementById(_sId)['style']['display'] = '';
		document.getElementById(_sId)['style']['position'] = "absolute";
		
		
//原程序默认居中
		var sClientWidth = parent ? parent.document.body.clientWidth : document.body.clientWidth;
		var sClientHeight = parent ? parent.document.body.clientHeight : document.body.clientHeight;
		var sScrollTop = parent ? parent.document.body.scrollTop : document.body.scrollTop;
		document.getElementById(_sId)['style']['left'] = (document.body.clientWidth / 2) - (document.getElementById(_sId).offsetWidth / 2);
		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);
		
		
//普通居中		
//	document.getElementById(_sId).style.posLeft    =   document.body.scrollLeft   +   (document.body.clientWidth   -   document.getElementById(_sId).clientWidth)/2;   
//  document.getElementById(_sId).style.posTop    =   document.body.scrollTop   +   (document.body.clientHeight   -   document.getElementById(_sId).clientHeight)/2;   


		
//  Web标准居中
//	var x=0,y=0;
//  x = (document.documentElement.scrollLeft || document.body.scrollLeft);
//  y = (document.documentElement.scrollTop || document.body.scrollTop);
//  
//      /**//*一下这段这么复杂的处理方法,是为了符合最新web标准,因为在aspx页面中会默认加入
//	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
//	新的标准中不支持document.body.clientHeight 属性,它是MSIE所有的

//	*/
//  var theWidth=0,theHeight=0;
//  
//  if (window.innerWidth) 
//  { 
//    theWidth = window.innerWidth 
//    theHeight = window.innerHeight 
//  } 
//  else if (document.documentElement && document.documentElement.clientWidth) 
//  { 
//    theWidth = document.documentElement.clientWidth 
//    theHeight = document.documentElement.clientHeight 
//  } 
//  else if (document.body) 
//  { 
//    theWidth = document.body.clientWidth 
//    theHeight = document.body.clientHeight 
//  }
//  
//     //做div居中处理
//  document.getElementById(_sId).style.left = (theWidth  - document.getElementById(_sId).offsetWidth)/2+x;
//  document.getElementById(_sId).style.top = (theHeight - document.getElementById(_sId).offsetHeight)/2+y; 
//	
	
		
	}
	
	this.shadow = function(){
		var oShadow = $('dialogBoxShadow');
		var oDialog = $('dialogBox');
		oShadow['style']['position'] = "absolute";
		oShadow['style']['background']	= "#000";
		oShadow['style']['display']	= "none";
		oShadow['style']['opacity']	= "0.2";
		oShadow['style']['filter'] = "alpha(opacity=20)";
		oShadow['style']['top'] = oDialog.offsetTop + 6;
		oShadow['style']['left'] = oDialog.offsetLeft + 6;
		oShadow['style']['width'] = oDialog.offsetWidth;
		oShadow['style']['height'] = oDialog.offsetHeight;
	}
	
		this.reset = function(){$('dialogBox').style.display='none';$('dialogBoxBG').style.display='none';$('dialogBoxShadow').style.display = "none";$('dialogBody').innerHTML = "";}
	
	this.show = function(){
		this.middle('dialogBox');
		//this.shadow(); 
		//window.onscroll=this.middle('dialogBox');
		//$("dialogBoxBG").style.width = document.body.scrollWidth;
		//$("dialogBoxBG").style.height = document.body.scrollHeight;
	}
	
  }
  
 
	
	function loading()
	{
		var sDialog = new dialog();
		sDialog.init();
		//alert($("dialogCase").innerHTML);
		sDialog.show();
		window.setTimeout(sDialog.reset,2550);
	}
	

