






var isLigal = "false";
var intFrmWidth = 114;	//剪贴板里的
var intFrmHeight = "50";
var frmWidth = 114;	//全局

//来源页面
var strRefer = escape(document.referrer);	

if(isLigal && isLigal == "true")
{
	var floatDiv = '<div id="AdLayer_lcf"></div><div id="AdLayer" style="position:absolute;VISIBILITY:visible; top:20px; left:0px; top:155px;z-index:10;">&nbsp;</div>';
	document.write(floatDiv);

	var floatImage = '<table width="114" border="0" cellpadding="0" cellspacing="0"><tr><td><img src="http://w.east.net/webmessage/views/images/wm_bg_top1.gif" width="101" height="25"/></td><td><img src="http://w.east.net/webmessage/views/images/wm_colse1.gif" width="13" height="25" onClick="hiddenlayer()"/></td></tr></table>';
	document.getElementById("AdLayer").innerHTML+=floatImage;

	var floatIframe = '<iframe id="frmFloat" src="http://w.east.net/webmessage/views/frontmessage/z.jsp?domain=181.mail.east.net&sn=181&invite=0&where='+strRefer+'"; marginwidth="0" marginheight="0" allowtransparency="true" hspace="0" vspace="0" frameborder="0" scrolling="no" width="114" height="50" ></iframe>';
	document.getElementById("AdLayer").innerHTML+=floatIframe;

	//是否显示漂浮框
	var isHideFloat = "0";
	if(isHideFloat && isHideFloat == "1")
		hiddenlayer();

	function resetIframeHeight(){
	try{
		var str=window.clipboardData.getData('text');
		var obj=document.getElementById('frmFloat');
		if(str.match(/^frameHeight=\d+$/))
		{
			intFrmWidth = parseInt(str.match(/\d+/));
			if(frmWidth == 114)
			{
				if(intFrmWidth != 114)
				{
					obj.style.width = intFrmWidth + 'px';
					frmWidth = intFrmWidth;
					if(intFrmHeight < 220)
					{
						obj.style.height = "220" + 'px'; 
					}
				}
			}
			else
			{
				if(intFrmWidth == 114)
				{
					obj.style.width = intFrmWidth + 'px';
					frmWidth = intFrmWidth;
					if(obj.style.height != intFrmHeight)
					{
						obj.style.height = intFrmHeight + 'px'; 
					}
				}
			}


			//obj.style.width=parseInt(str.match(/\d+/))+'px';
			
			//window.clipboardData.setData('text','null');
		}
	}catch(e)
	{
		//alert(e);
	}

	setTimeout(resetIframeHeight,500);
	}

	resetIframeHeight();

	//******************************added by tuliang on 2006-02-09***********************************漂浮框移动代码************
	var strhtmlcontent=document.getElementById("AdLayer").innerHTML;var showflag='0';
	//var strhtmlcontent=document.getElementById("AdLayer").innerHTML;var showflag='0';
		self.onError=null;
		currentX = currentY = 0;  
		whichIt = null;   
						lastScrollX = 0; lastScrollY = 0;
		NS = (document.layers) ? 1 : 0;
		IE = (document.all) ? 1: 0;

		function hidenbox(o)
		{
			if(o.style.visibility == "hidden")
			{
				o.style.visibility = "visible";
			}
			else
			{
				o.style.visibility = "hidden";
			}
			document.getElementById("AdLayer_lcf").style.visibility ="hidden";
									o.style.visibility = "hidden";
		}
		function hidenbox1(o,p)
					{
									o.style.visibility = "hidden";
									p.style.visibility = "hidden";
					}


		//tm=setInterval("timevisible();",2000); 
		function timevisible()
		{
			if(document.getElementById("AdLayer").style.visibility != "visible")
			{
		//		document.all.AdLayer.style.visibility == "visible";
			}
		}
		function heartBeat() 
		{
			if(IE) 
			{ 
				diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
				if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
			if(diffY != lastScrollY) {	                percent = .1 * (diffY - lastScrollY);
										if(percent > 0) percent = Math.ceil(percent);
										else percent = Math.floor(percent);
						if(IE) document.all.AdLayer.style.pixelTop += percent;
						if(NS) document.AdLayer.top += percent;
										lastScrollY = lastScrollY + percent;
				}
			if(diffX != lastScrollX) {
				percent = .1 * (diffX - lastScrollX);
				if(percent > 0) percent = Math.ceil(percent);
				else percent = Math.floor(percent);
				if(IE) document.all.AdLayer.style.pixelLeft += percent;
				if(NS) document.AdLayer.left += percent;
				lastScrollX = lastScrollX + percent;
			}	
		}	
		function checkFocus(x,y) { 
						stalkerx = document.AdLayer.pageX;
						stalkery = document.AdLayer.pageY;
						stalkerwidth = document.AdLayer.clip.width;
						stalkerheight = document.AdLayer.clip.height;
						if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) 
				return true;
						else 
				return false;
		}	
		function grabIt(e)
		{
		if(IE) {
				
				whichIt = event.srcElement;
				//alert(whichIt);
				while (whichIt.id.indexOf("AdLayer") == -1) {
					whichIt = whichIt.parentElement;
					if (whichIt == null) 
					{
						document.onmousemove = null;
						document.onmouseup = null;
						return true;
					}
					else
					{
						//whichIt.style.pixelLeft = whichIt.offsetLeft;
								//whichIt.style.pixelTop = whichIt.offsetTop;
						currentX = (event.clientX + document.body.scrollLeft);
							currentY = (event.clientY + document.body.scrollTop); 
							//alert(event.clientX + "," + event.clientY + "," + document.body.scrollLeft + "," + document.body.scrollTop);
							document.onmousemove = moveIt;
						document.onmouseup = dropIt;
						
					}
					
					}
				
					
			} else { 
							window.captureEvents(Event.MOUSEMOVE);
						if(checkFocus (e.pageX,e.pageY)) { 
										whichIt = document.AdLayer;
										StalkerTouchedX = e.pageX-document.AdLayer.pageX;
										StalkerTouchedY = e.pageY-document.AdLayer.pageY;
						} 		}
				return true;
		}
		function moveIt(e) {
			if (whichIt == null) { return false; }
			if(IE) 
			{
					newX = (event.clientX + document.body.scrollLeft);
					newY = (event.clientY + document.body.scrollTop);
					distanceX = (newX - currentX);    distanceY = (newY - currentY);		    currentX = newX;    currentY = newY;
					whichIt.style.pixelLeft += distanceX;		    whichIt.style.pixelTop += distanceY;
				if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;			if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
				if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
				if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
				event.returnValue = false;
			} 
			else 
			{
				whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
							if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
							if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
							if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
							if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
							return false;
			}
				return false;
		}
		function dropIt() {
			whichIt = null;
				if(NS) window.releaseEvents(Event.MOUSEMOVE);
				return true;
		}
		if(NS) {
			window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
			window.onmousedown = grabIt;
			window.onmousemove = moveIt;
			window.onmouseup = dropIt;
		}
		if(IE) 
		{
			document.onmousedown = grabIt;
			//document.onmousemove = moveIt;
			//document.onmouseup = dropIt;
		}
		if(NS || IE) action = window.setInterval("heartBeat()",1);



	function GetObj(id)
	{
					if (document.getElementById)
									return document.getElementById(id);
					else
					if (document.all)
					return document.all(id);
	}

	var floatHtml=null;
	var floatHtml1=null;
	var isDeleted=false;
	var strcontent=strhtmlcontent;

	ImageTimer();
	function ImageTimer()
	{
					strcontent=strhtmlcontent;
					timer1=setTimeout('ImageTimer()', 250)
					if (true)
					{
									if(!isDeleted)
													{

																	if(floatHtml==null)
																	floatHtml=GetObj('AdLayer').innerHTML;
																	if(GetObj('AdLayer').innerHTML.indexOf('images')==-1)
																	{

																					GetObj('AdLayer').innerHTML=strcontent;
																					 clearTimeout(timer1);
																	}
																
													}
					}


	}
	if(showflag>0)
	{
		if(showflag > 20 ) showflag = 20;
	var strcontent1=strhtmlcontent1;
	delay();
	}
	var dflag=0;
	function delay()
	{
		
	dflag=dflag+1;	

	timer=setTimeout('delay()', 1000);
	strcontent1=strhtmlcontent1;
		if(floatHtml1==null)
				 floatHtml1=GetObj('AdLayer_lcf').innerHTML;
		if(GetObj('AdLayer_lcf').innerHTML.indexOf('zooimags')==-1)
				 {
							GetObj('AdLayer_lcf').innerHTML=strcontent1;
				 }
	if(dflag==showflag)
	{
		
		if(document.all.AdLayer_lcf.style.visibility != "visible")
		{
			document.all.AdLayer_lcf.style.visibility ="visible";
		}
		clearTimeout(timer);
	}	
	}
	function hiddenlayer(){
		document.all.AdLayer_lcf.style.visibility ="hidden";
		document.all.AdLayer.style.visibility ="hidden";
	}
}