var html2;
function showMsg(info,id,w,h){
	var p=document.createElement("DIV");
	var htmlStr=document.getElementById(id).innerHTML
	if (!info) var info='^_^ 谢谢捧场！！';
	p.id="p";
	p.style.position="absolute";
	//p.style.width=document.body.scrollWidth;
	p.style.width=window.screen.width*0.98;
	p.style.height=(document.body.offsetHeight>document.body.scrollHeight)?'100%':document.body.scrollHeight;
	p.style.zIndex='998';
	p.style.top='0px';
	p.style.left='0%';
	p.style.backgroundColor="gray";
	p.style.opacity='0.3';
	p.style.filter="alpha(opacity=30)";
	document.body.appendChild(p);
	var p1=document.createElement("DIV");
	//var top=parseInt(parseInt(document.body.scrollHeight)*0.25)+document.body.scrollTop;
	var top=150;
	p1.style.position="absolute";
	p1.style.width=(!w)?"300px":w+"px";
	p1.id="p1";
	var left=Math.ceil(((document.body.scrollWidth)-parseInt(p1.style.width.replace('px','')))/2)+document.body.scrollLeft;
	p1.style.zIndex='999';
	p1.style.top=top+'px';
	p1.style.left=left+'px';
	p1.style.border="1px solid #800000";
	var html="<div id='mvele' style='color:white;background-color:#800000;text-align:right;cursor:move;line-height:220%'><span onClick='cancle()' style='cursor:pointer;padding:1px;border:1px solid white;'><b>×</b></span>&nbsp;</div>";
	if (htmlStr!="") html2=htmlStr;
	if (htmlStr=="") htmlStr=html2;
	html+=htmlStr;

	document.body.appendChild(p1);
	p1.innerHTML=html;
	if (document.getElementById(id)) document.getElementById(id).innerHTML="";
	if (document.all){
		var arr=document.getElementsByTagName("select");
		var i=0;
		while(i<arr.length){
			arr[i].style.visibility='hidden';
			if (arr[i].id=="co2" || arr[i].id=="g2")  arr[i].style.visibility='visible';
			i++;
		}
	}
	this.cancle=function(){
		document.body.removeChild(document.getElementById('p'));
		document.body.removeChild(document.getElementById('p1'));
		var arr=document.getElementsByTagName("select");
		var i=0;
		while(i<arr.length){
			arr[i].style.visibility='visible';
			i++;
		}
	}
	document.getElementById('p1').onmousedown=mouseDown
	//setTimeout(this.cancle,1500);
}
var tag;
var initX;
function mouseDown(ev){
	e=ev?ev:window.event;
	ele=(document.all)?e.srcElement:e.target;
	if (ele.id=="mvele") tag=1;
	initX=parseInt(document.getElementById('p1').style.left);
}
document.onmousemove=mouseove;
function mouseove(ev){
	ev=ev||window.event;
	if (tag==1){
		var x=ev.clientX;
		var y=ev.clientY;
		if (x<=(parseInt(document.getElementById('p').style.width)-parseInt(document.getElementById('p1').style.width))){

			document.getElementById('p1').style.left=ev.clientX+"px";
		}
		if ((y+document.body.scrollTop)<=(parseInt(document.getElementById('p').style.height)-190)){
			document.getElementById('p1').style.top=ev.clientY+document.body.scrollTop+"px";
		}
	}
}
document.onmouseup=function (){tag=0;}
