document.write("<link rel=\"stylesheet\" href=\"/jst/jst.css\" type=\"text/css\">");
var msg={
	$:function(d){return document.getElementById(d)},
	move:0,
	eventStartX:0,
	eventStartY:0,
	wndStartX:0,
	wndStartY:0,
	d:{a:'msg',b:'msgtitle',c:'msgchild',d:'msgstatus',e:'msgiframe',g:'msgcanvas',w:'msg'},
	e:null,
	x:function(){return msg.e.clientX;},
	y:function(){return msg.e.clientY;},
	drag_start:function(e){
		msg.e=e;
		msg.move=1;
		msg.eventStartX=msg.x();
		msg.eventStartY=msg.y();
		msg.wndStartX=msg.$(msg.d.a).offsetLeft;
		msg.wndStartY=msg.$(msg.d.a).offsetTop;
	},
	drag_stop:function(e){
		msg.e=e;
		msg.move=0;
	},
	drag:function(e){
		msg.e=e;
		if(msg.move){
			msg.$(this.d.a).style.left=msg.wndStartX+(msg.x()-msg.eventStartX)+'px';
			msg.$(this.d.a).style.top=msg.wndStartY+(msg.y()-msg.eventStartY)+'px';
			try{document.selection.empty();}catch(er){}
		}
	},
	close:function(){
		msg.$(msg.d.a).style.display='none';msg.$(msg.d.g).style.display='none';
		var a=document.body;a.removeChild(msg.$(msg.d.a));//a.removeChild(msg.$(msg.d.g));
	},
	onfocus:function(){
		msg.flash(2);
	},
	flash:function(n){
		msg.$(msg.d.b).className='msgfocus';
		setTimeout(function(){msg.$(msg.d.b).className='msgtitle';},50);
		if(n>1){setTimeout(function(){msg.flash(n-1);},100);}
	},
	open:function(){
		var de=document.documentElement;
		var w=window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
		var ch=window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
		if (self.pageYOffset) {
			var st=self.pageYOffset;
		} else if (de&&de.scrollTop){	 // Explorer 6 Strict
			var st=de.scrollTop;
		} else if (document.body) {// all other Explorers
			var st=document.body.scrollTop;
		}
		if (window.innerHeight && window.scrollMaxY) {	
			var sh=window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			var sh=document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			var sh=document.body.offsetHeight;
		}
		var a=arguments;
		msg.title=a[0]||'信息窗口';
		msg.para=a[1];//网址或者要显示的内容
		msg.width=a[2]||300;
		msg.height=a[3]||200;
		msg.type=null==a[4]?1:a[4];//1-框架,2-直接显示内容
		msg.canvas=a[5]||{bgc:'#000',opa:0.5};
		msg.left=a[6]||(w-msg.width)/2+'px';
		msg.top=a[7]||(ch-(msg.height||200))/2+st+'px';
		var dc=document,s='';
		var o=dc.createElement("div");
		o.id=msg.d.a;
		o.className='msg';
		o.style.width=msg.width+'px';
		o.style.height=msg.height+'px';
		o.style.left=msg.left;
		o.style.top=msg.top;
		s+='<div id="'+msg.d.b+'" class="msgtitle" onmousedown="'+msg.d.w+'.drag_start(event)" onmouseup="'+msg.d.w+'.drag_stop(event)" onmousemove="'+msg.d.w+'.drag(event)">';
		s+='<span class="msgclose"><a href="javascript:'+msg.d.w+'.close();" title="关闭">×</a></span>'+msg.title;
		s+='</div>';
		s+='<div id="'+msg.d.c+'" class="msgchild">';
		s+=1==msg.type?('<iframe id="'+msg.d.e+'" name="'+msg.d.e+'" src="about:blank"  style="width:100%;height:'+(msg.height-40)+'px;" frameborder="0" hspace="0"></iframe>'):('<div style="padding:10px;">'+msg.para+'</div></table>');
		s+='</div>';
		o.innerHTML=s;
		dc.body.appendChild(o);
		var f=0;
		o=msg.$(msg.d.g);
		if(!o){f=1;o=dc.createElement("div");}
		o.id=msg.d.g;
		o.className='msgcanvas';
		o.style.height=(sh>ch?sh:ch)+'px';
		o.style.width=w+'px';
		s=msg.canvas;
		o.style.backgroundColor=s.bgc;
		o.style.filter='alpha(opacity='+(s.opa*100)+')';
		o.style.display='block';
		if(f){o.onclick=function(){msg.onfocus()};dc.body.appendChild(o)};
		if(1==msg.type){msg.$(msg.d.e).src=msg.para;}
	}
}