//信息 提示框 
function wopen(_sUrl){location.href=_sUrl;}
function ShowMags(alertimg,stxt,touri){
	//图片路径
	var imgpath = "/images/dialog/";
	//提示框的宽和高
	var swidth="357";
	var sheight="171";
	//文字显示区的高度
	var txtheight="95";
	
	if(!alertimg){var alertimg="ok";}
	
	var showtxt=stxt;
	var closeds="onclick=\"remove();"+touri+"\"";
	

	var shield = document.createElement("DIV");
	//var shield = document.createElement("<iframe frameborder=0 marginheight=0 marginwidth=0 hspace=0 vspace=0 scrolling=no></iframe>");
    shield.id = "shield";
    shield.style.position = "absolute";
    shield.style.left = "0px";
    shield.style.top = "0px";
    shield.style.width = "100%";
    shield.style.height = "100%";
    shield.style.background = "#FFFFFF";
    shield.style.textAlign = "center";
    shield.style.zIndex = "10000";
    shield['style']['filter'] = "alpha(opacity=100);";
    shield['style']['-moz-opacity'] = "1;";
    shield['style']['opacity'] = "1;";
    
    var alertFram = document.createElement("DIV");
    
    alertFram.id="alertFram";
    alertFram.style.position = "absolute";
        
    //负边界居中法,相对于shield层的底部时
    alertFram.style.right = "50%";
    alertFram.style.bottom = "50%";
    alertFram.style.marginRight = "-175px";
    alertFram.style.marginBottom = "-75px";
    
    alertFram.style.width = ""+swidth+"px";
    alertFram.style.height = ""+sheight+"px";
    alertFram.style.background = "";
    alertFram.style.textAlign = "center";
    alertFram.style.zIndex = "10002";
    
    
    //strHtml="<iframe  style=\"position:absolute;z-index:-1;width:100%;height:100%;top:0;left:0;scrolling:no;\" frameborder=\"0\" src=\"about:blank\"></iframe>\n";
  	strHtml="<div id=\"dialog\" style=\"z-index:200;padding:0;margin:0;\">\n";
  	strHtml+="<div style=\"float:left;background:url("+imgpath+"T_top_left.gif) no-repeat;width:4px;height:27px\"></div>\n";
  	strHtml+="<div style=\"float:left;background:url("+imgpath+"T_top_bg.gif) repeat-x;width:"+(swidth-8)+"px;height:27px;line-height:27px;color: #2c71af;\" id=\"stitle\" onmousedown=\"oMove(parentNode.parentNode);\">\n";
    strHtml+="<div style=\"float:left;width: 18px;height:22px;padding-top:5px;\"><img src=\""+imgpath+"T_top_ico.gif\" style=\"\" /></div>\n";
	strHtml+="<div style=\"float:left;width:auto;font-size:14px;\">温馨提示</div>\n";
	strHtml+="<div style=\"float:right;width: 14px;height:22px;cursor:pointer;\" "+closeds+"><span style=\"display:block;padding-top:8px;\"><img src=\""+imgpath+"T_top_close_01.gif\" border=\"0\" id=\"closeimg\" onmouseover=\"document.getElementById('closeimg').src='"+imgpath+"T_top_close_02.gif'\" onmouseout=\"document.getElementById('closeimg').src='"+imgpath+"T_top_close_01.gif'\" /></span></div>\n";
	strHtml+="<div style=\"clear:both\"></div>\n";
	strHtml+="</div>";
  	strHtml+="<div style=\"float:left;background:url("+imgpath+"T_top_right.gif) no-repeat;width:4px;height:27px\"></div>\n";
  	strHtml+="<div style=\"clear:both\"></div>\n";
  	strHtml+="<div style=\"float:left;background:url("+imgpath+"T_body_left.gif) repeat-y;width:4px;height: "+txtheight+"px;\" id=\"T_body_left\"></div>\n";
  		strHtml+="<div style=\"float:left;background:#fbfeff;width:349px;height: "+txtheight+"px;\" id=\"T_body_body\">\n";
    		strHtml+="<div style=\"margin:0px;padding:0px;color: #06559b;\">\n";
    		strHtml+="<div style=\"float:left;margin-top:8px;width:75px;height:75px;background:url("+imgpath+"alert_ico_"+alertimg+".gif) left center no-repeat;\"></div>\n";
			strHtml+="<div style=\"float:left;width:auto;padding:20px 0 0 10px;text-align:left;font-size:14px;\">"+showtxt+"</div>\n";
			strHtml+="<div style=\"clear:both\"></div>\n";
		strHtml+="</div>\n";
  	strHtml+="</div>\n";
  	strHtml+="<div style=\"float:left;background:url("+imgpath+"T_body_right.gif) repeat-y;width:4px;height: "+txtheight+"px;\" id=\"T_body_right\"></div>\n";
  	strHtml+="<div style=\"clear:both;margin:0px;padding:0px;\"></div>\n";
  	strHtml+="<div style=\"float:left;background:url("+imgpath+"T_bottom_left.gif) no-repeat;width:4px;height:44px\"></div>\n";
	strHtml+="<div style=\"float:left;background:url("+imgpath+"T_bottom_bg.gif) repeat-x;width:349px;height:44px;line-height:44px;text-align:right;padding-top:12px\"><span style=\"padding-right: 15px\"><img src=\""+imgpath+"yes.gif\" border=\"0\" style=\"cursor: pointer;\" onclick=\"remove();"+touri+"\" /></span></div>\n";
  	strHtml+="<div style=\"float:left;background:url("+imgpath+"T_bottom_right.gif) no-repeat;width:4px;height:44px\"></div>\n";
  	strHtml+="<div style=\"clear:both\"></div>\n";
	strHtml+="</div>\n";

    alertFram.innerHTML = strHtml;
    document.body.appendChild(alertFram);
    document.body.appendChild(shield);
	//document.body.appendChild(ifm);

    var c = 50;
    this.doAlpha = function(){
        if (c++ > 50){clearInterval(ad);return 0;}
		//shield.style.filter = "alpha(opacity="+c+");";
		shield['style']['filter'] = "alpha(opacity="+c+");";
        shield['style']['-moz-opacity'] = "0."+c+";";
		shield['style']['opacity'] = "0."+c+";";
    }
	this.remove=function(){
		
	    alertFram.innerHTML="";
		shield.style.filter = "";
		shield.id = "";
		shield.style.position = "";
		shield.style.left = "";
		shield.style.top = "";
		shield.style.width = "";
		shield.style.height ="";
		shield.style.background = "";
		shield.style.textAlign = "";
		shield.style.zIndex = "";
		shield.style.filter = "";
		alertFram.id="";
		alertFram.style.position = "";
		alertFram.style.left = "";
		alertFram.style.top = "";
		alertFram.style.marginLeft = "";
		alertFram.style.marginTop = "";
		alertFram.style.width = "";
		alertFram.style.height = "";
		alertFram.style.background = "";
		alertFram.style.textAlign = "";
		alertFram.style.lineHeight = "";
		alertFram.style.zIndex = "";
		
		alertFram.style.display="none";
		shield.style.display="none";
	}
var ad = setInterval("doAlpha()",10);
    alertFram.focus();
    document.body.onselectstart = function(){return false;};
}
function oMove(obj){
	var otop,oleft;
	if(!document.all)
	{
		oy = obj.pageY;
		ox = obj.pageX;
	}
	else
	{
		oy = event.y;
		ox = event.x;
	}
	otop = oy - obj.offsetTop;
	oleft = ox - obj.offsetLeft;
	
	obj.setCapture();
	obj.onmousemove = function()
	{
		if(!document.all){ 
			x = obj.pageX; 
			y = obj.pageY; 
		}
		else{ 
			x = event.x; 
			y = event.y; 
		}
		//var ofsx = x - ox;
		//obj.style.left = parseInt(obj.style.left) + ofsx;
		obj.style.left = x - oleft;
		//ox = x;
		//var ofsy = y - oy;
		//obj.style.top = parseInt(obj.style.top) + ofsy;
		obj.style.top = y - otop;
		//oy = y;
	}
	obj.onmouseup = function()
	{
		obj.onmousemove = null;
		obj.style.filter = null;
		obj.releaseCapture();
	}
}
