var lastScrollY=0;
function heartBeat(){
	var diffY;
	if (document.documentElement && document.documentElement.scrollTop)  
		diffY = document.documentElement.scrollTop; 
	else if (document.body)  
		diffY = document.body.scrollTop 
	else {
		/*Netscape stuff*/
	}
	
	percent=.1*(diffY-lastScrollY); 
	
	if(percent>0)
		percent=Math.ceil(percent); 
	else 
		percent=Math.floor(percent); 
	
	document.getElementById("adleft").style.top=parseInt(document.getElementById("adleft").style.top)+percent+"px";
	document.getElementById("adright").style.top=parseInt(document.getElementById("adright").style.top)+percent+"px";
	
	lastScrollY=lastScrollY+percent; 
}

function adhide(names){
	document.getElementById(names).style.display='none';
}

function screencl(names){
	if(screen.width<=800){adhide(names);}
}

zcode="<div id='adleft' style='left:2px;position: absolute;z-index:1;top:100px;display:none;'>";
zcode+="	<div id='LeftAdDiv' style='background:#ccc;'>×óÁª</div>";
zcode+="	<div align='right' style='background:#fff;font-size:0px;'>";
zcode+="		<img src='/images/guanbi.jpg' title='¹Ø±Õ' onclick=adhide('adleft') style='cursor:pointer'>";
zcode+="	</div>";
zcode+="</div>";

ycode="<div id='adright' style='right:5px;position: absolute;z-index:1;top:100px;display:none;'>";
ycode+="	<div id='RightAdDiv' style='background:#ccc;'>ÓÒÁª</div>";
ycode+="	<div align='left' style='background:#fff;font-size:0px;'>";
ycode+="		<img src='/images/guanbi.jpg' title='¹Ø±Õ' onclick=adhide('adright') style='cursor:pointer'>";
ycode+="	</div>";
ycode+="</div>";

document.write(zcode);
document.write(ycode);
screencl('adleft');
screencl('adright');
window.setInterval("heartBeat()",1); 

function showAd(names){
	document.getElementById(names).style.display='block';
}

function joinAd(names,theContent){
	
	document.getElementById(names).innerHTML=theContent;
}
