﻿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("ad1").style.top=parseInt(document.getElementById
("ad1").style.top)+percent+"px";
document.getElementById("ad2").style.top=parseInt(document.getElementById
("ad1").style.top)+percent+"px";
lastScrollY=lastScrollY+percent; 
}
suspendcode12="<DIV id=\"ad1\" style='left:2px;POSITION:absolute;TOP:116px;'><img src='images/ad.gif' onclick='document.location=\"ad/index.html\"'><a href='javascript:hidead()' style='color:black'>关闭</a></div>"
suspendcode14="<DIV id=\"ad2\" style='right:2px;POSITION:absolute;TOP:116px;'><img src='images/ad.gif' onclick='document.location=\"ad/index.html\"'><a href='javascript:hidead()' style='color:black'>关闭</a></div>"
document.write(suspendcode12); 
document.write(suspendcode14); 
window.setInterval("heartBeat()",1);

function hidead(){
$('ad2').hide();
$('ad1').hide();
}