﻿// JavaScript Document for ad screen

document.write('<div id="adScreenDrift" style="position:absolute;visibility:visible;z-index:100;left:5px;top:50px;width:60px;height:60px;"><a href="/app/ad_red.asp?adID=217&url=http://lr.zoosnet.net/JS/LsJS.aspx?siteid=LEF87550143&float=1" target="_blank"><img src="/upload/ad/2010110902573170.jpg" width="1" height="1" border="0" hspace="0" vspace="0" alt="chat with  Emerson" /></a><br /><a href="http://lr.zoosnet.net/LR/Chatpre.aspx?id=LEF87550143&p=&r=" target="_blank"><img src="http://lr.zoosnet.net/js/ImgJS.aspx?id=LEF87550143&p=&r=&oi=http://lr.zoosnet.net/lr/images/online_en3.gif&fi=http://lr.zoosnet.net/lr/images/offline_en3.gif" border=0></a></div></div>');
var xPos = 300;
var yPos = 50;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
adScreenDrift.style.top = yPos;
function adScreenChangePos()
{
	width = document.body.clientWidth - 20;
	height = document.documentElement.clientHeight;
	Hoffset = adScreenDrift.offsetHeight;
	Woffset = adScreenDrift.offsetWidth;
	adScreenDrift.style.left = xPos + document.documentElement.scrollLeft;
	adScreenDrift.style.top = yPos + document.documentElement.scrollTop;
	if (yon)
		{yPos = yPos + step;}
	else
		{yPos = yPos - step;}
	if (yPos < 0)
		{yon = 1;yPos = 0;}
	if (yPos >= (height - Hoffset))
		{yon = 0;yPos = (height - Hoffset);}
	if (xon)
		{xPos = xPos + step;}
	else
		{xPos = xPos - step;}
	if (xPos < 0)
		{xon = 1;xPos = 0;}
	if (xPos >= (width - Woffset))
		{xon = 0;xPos = (width - Woffset);   }
	}

	function adScreenStart()
	 {
	 	adScreenDrift.visibility = "visible";
		interval = setInterval('adScreenChangePos()', delay);
	}
	function pause_resume()
	{
		if(pause)
		{
			clearInterval(interval);
			pause = false;}
		else
		{
			interval = setInterval('adScreenChangePos()',delay);
			pause = true;
			}
		}
	adScreenStart();
var showad = true;
var Toppx = 60;
var AdDivW = 100;
var AdDivH = 360;
var PageWidth = 800;
var MinScreenW = 1024;
var ClosebuttonHtmlLeft = '<div align="right" style="position: absolute;top:0px;right:0px;margin:1px;padding:1px;z-index:2000;"><a href="javascript:;" onclick="hideadLeft()" style="color:#333333;text-decoration:none;font-size:10px;"></a></div>'
var ClosebuttonHtmlRight = '<div align="right" style="position: absolute;top:0px;right:0px;margin:1px;padding:1px;z-index:2000;"><a href="javascript:;" onclick="hideadRight()" style="color:#333333;text-decoration:none;font-size:10px;"></a></div>'
var AdContentHtml = '';
document.write ('<div id="javascript.LeftDiv" style="position: absolute;border: 0px solid #ffffff;z-index:1000;width:'+100+'px;height:'+10+'px;top:-1000px;word-break:break-all;display:none;"><div>'+AdContentHtml+'</div></div>');
var AdContentHtml = '<a href="/app/ad_red.asp?adID=184&url=skype:sinoy04?call=chinazsl05" target="_blank"><img src="/upload/ad/2009060212350065.gif" width="57" height="64" border="0" hspace="0" vspace="0" alt="Skype Me!" /></a><br /><br /><a href="/app/ad_red.asp?adID=176&url=msnim:chat?contact=chinazsl05@gmail.com " target="_blank"><img src="/upload/ad/2009060500531391.gif" width="57" height="64" border="0" hspace="0" vspace="0" alt="Chat with Emerson" /></a><br /><br />';
document.write ('<div id="javascript.RightDiv" style="position: absolute;border: 0px solid #ffffff;z-index:1000;width:'+100+'px;height:'+138+'px;top:-1000px;word-break:break-all;display:none;text-align:center;">'+ClosebuttonHtmlRight+'<div>'+AdContentHtml+'</div></div>');
function scall(){
	if(!showad){return;}
	if (window.screen.width<MinScreenW){
		showad = false;
		document.getElementById("javascript.LeftDiv").style.display="none";
		document.getElementById("javascript.RightDiv").style.display="none";
		return;
	}
	var Borderpx = ((window.screen.width-PageWidth)/2-AdDivW)/2;

	document.getElementById("javascript.LeftDiv").style.display="";
	document.getElementById("javascript.LeftDiv").style.top=document.documentElement.scrollTop+Toppx;
	document.getElementById("javascript.LeftDiv").style.left=document.body.scrollLeft+Borderpx-50+"px";
	document.getElementById("javascript.RightDiv").style.display="";
	document.getElementById("javascript.RightDiv").style.top=document.documentElement.scrollTop+Toppx+"px";
	document.getElementById("javascript.RightDiv").style.left=document.body.clientWidth-AdDivW-45+"px";
}

function hideadLeft()
{
	showad = false;
	document.getElementById("javascript.LeftDiv").style.display="none";
}

function hideadRight()
{
	showad = false;
	document.getElementById("javascript.RightDiv").style.display="none";
}
window.onscroll=scall;
window.onresize=scall;
window.onload=scall;

