var _jsCommand;
function alert(){
	var str=arguments[0];
	if(arguments.length>1) _jsCommand=arguments[1];
	if (window.top!=window.self)
	{
		window.top.alert(str,_jsCommand);
		return false;
	}
	//while (document.readyState!="complete" || document.getElementById("msgDiv")!=null)
	while ( document.getElementById("msgDiv")!=null)
	{
		//setTimeout("alert("+"\""+str+"\",\""+_jsCommand+"\")",500);
		setTimeout(function(){alert(str,_jsCommand)},500)
		return false;
	}
	var msgw,msgh,bordercolor;
	msgw=400;//提示窗口的宽度
	msgh=200;//提示窗口的高度
	titleheight=25;//提示窗口标题高度
	bordercolor="#336699";//提示窗口的边框颜色
	titlecolor="#99CCFF";//提示窗口的标题颜色
	
	var sWidth,sHeight;
	sWidth=document.documentElement.offsetWidth;
	sHeight=document.documentElement.offsetHeight;

	var bgObj=document.createElement("div");
	bgObj.setAttribute('id','bgDiv');
	bgObj.style.position="absolute";
	bgObj.style.background="#777";
	bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
	bgObj.style.opacity="0.6";
	bgObj.style.top="0";
	bgObj.style.left="0";
	bgObj.style.width="100%";
	bgObj.style.height=document.documentElement.scrollHeight;
	bgObj.style.zIndex = "10000";
	document.body.appendChild(bgObj);
	
	var msgObj=document.createElement("div")
	msgObj.setAttribute("id","msgDiv");
	msgObj.setAttribute("align","center");
	msgObj.style.background="white";
	msgObj.style.border="1px solid " + bordercolor;
	msgObj.style.position = "absolute";
	if (document.documentElement.offsetWidth>screen.width)
	{
		msgObj.style.left = document.documentElement.scrollLeft+(screen.width-msgw)/2+"px";
	}
	else
	{
		msgObj.style.left = (document.documentElement.offsetWidth-msgw)/2+"px";
	}
	if (document.documentElement.scrollHeight>screen.height)
	{
		msgObj.style.top = document.documentElement.scrollTop+(screen.height-msgh)/2-100+"px";
	}
	else
	{
		msgObj.style.top = (document.documentElement.offsetHeight-msgh)/2+"px";
	}
	window.onscroll=function()
	{
		if (msgObj!=null)
		{
			if (document.documentElement.offsetWidth>screen.width)
			{
				msgObj.style.left = document.documentElement.scrollLeft+(screen.width-msgw)/2+"px";
			}
			else
			{
				msgObj.style.left = (document.documentElement.offsetWidth-msgw)/2+"px";
			}
			if (document.documentElement.scrollHeight>screen.height)
			{
				msgObj.style.top = document.documentElement.scrollTop+(screen.height-msgh)/2-100+"px";
			}
			else
			{
				msgObj.style.top = (document.documentElement.offsetHeight-msgh)/2+"px";
			}
		}
	}
	msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
	msgObj.style.width = msgw + "px";
	msgObj.style.height =msgh + "px";
	msgObj.style.textAlign = "center";
	msgObj.style.lineHeight ="25px";
	msgObj.style.zIndex = "10001";
   
	var title=document.createElement("h4");
	title.setAttribute("id","msgTitle");
	title.style.margin="0";
	title.style.padding="3px";
	title.style.background=bordercolor;
	title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
	title.style.opacity="0.75";
	title.style.border="1px solid " + bordercolor;
	title.style.height="18px";
	title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif";
	title.style.color="white";
	title.style.cursor="pointer";
	title.innerHTML="<span style=\"float:right;\">关闭</span><span style=\"float:left;padding-left:8px;\"><b>鸿禧提示信息</b></span>";
	/*var outObj=document.getElementById("aaa")
	outObj.value+=arguments.length;
	for(x=0;x<arguments.length;x++)
		outObj.value+="=======================\n"+x+"  : "+arguments[x]+"\n";
	if (arguments.length>1) _jsCommand=arguments[1];*/
	title.onclick=function(){
		document.body.removeChild(bgObj);
		document.getElementById("msgDiv").removeChild(title);
		document.body.removeChild(msgObj);
		if(_jsCommand!="" && _jsCommand!="undefined") 
			
			eval(_jsCommand);
		}
		
	document.body.appendChild(msgObj);
	document.getElementById("msgDiv").appendChild(title);
	var txt=document.createElement("div");
	txt.style.color="#000000";
	txt.style.padding = "10px";
	txt.style.textAlign = "left";
	txt.setAttribute("id","msgTxt");
	
	document.getElementById("msgDiv").appendChild(txt);
	txt.innerHTML=str;
	
}

alert.loading=function(str)
{
	var loadStr="";
	var styleStr="";
	try
	{
		tagBody=document.getElementsByTagName("body")[0];
	}
	catch(e)
	{
		return;
	}
	
	if(!document.getElementById("aLoadingDiv"))
	{

				
		loadStr+="<div id=\"aLoadingDiv\" class=\"box\">"+
				"	<div id=\"loadingLayer\" >"+
				"		<img src=\"\/Script\/images\/progressbar.gif\" border=\"0\" alt=\"\" style=\"padding:0 0 6px 0\" \/><br \/>"+
				"		<div id=\"aLoadText\"><\/div>"+
				"	<\/div>"+
				"<\/div>"
		//tagBody.innerHTML+=loadStr;
		

				
		var aLoadP=document.createElement("div")
		aLoadP.innerHTML=loadStr;
		tagBody.appendChild(aLoadP);
	}				

	var loadDiv=document.getElementById("aLoadingDiv");
	var loadText=document.getElementById("aLoadText");
	var loadLayer=document.getElementById("loadingLayer");
	with(loadDiv.style)	
	{
		zIndex=19999
		position="absolute";
		width="300px";
		overflow="hidden";
		background="#E3DFE0 url(\/Script\/images\/loadlogo.gif) no-repeat 98% 4%";
		border="solid 1px #000";
	}
	with(loadLayer.style)
	{
		width="180px";	
		height="60px";
		overflow="hidden";
		background="url(\/Script\/images\/loadimg.gif) no-repeat 7% 50%";
		padding="25px 10px 0px 110px";
		color="#CD4916";
		fontSize="12px";
		lineHeight ="120%";
	}
	/*loadDiv.cssText=styleBox;
	loadLayer.setAttribute("style",styleLayer);*/
	loadText.innerHTML=str;
	tHeight=document.documentElement.clientHeight/2-loadDiv.clientHeight/2+document.documentElement.scrollTop;
	loadDiv.style.top=tHeight+"px"
	tWidth=document.documentElement.clientWidth/2-loadDiv.clientWidth/2;
	loadDiv.style.left=tWidth+"px";
	loadDiv.style.display='';

	
		
}
alert.delLoading=function()
{
	if(document.getElementById("aLoadingDiv"))
	{
		var loadDiv=document.getElementById("aLoadingDiv");
		loadDiv.style.display="none";
		//loadDiv.parentNode.removeChild(loadDiv);
	}
	
}
alert.cachLoadDiv=function()
{
	
}