﻿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("ad_1").style.top=parseInt(document.getElementById("ad_1").style.top)+percent+"px";
document.getElementById("ad_2").style.top=parseInt(document.getElementById("ad_2").style.top)+percent+"px";
document.getElementById("ad_3").style.top=parseInt(document.getElementById("ad_3").style.top)+percent+"px";
document.getElementById("ad_4").style.top=parseInt(document.getElementById("ad_4").style.top)+percent+"px";
document.getElementById("ad_5").style.top=parseInt(document.getElementById("ad_5").style.top)+percent+"px";
document.getElementById("ad_6").style.top=parseInt(document.getElementById("ad_6").style.top)+percent+"px";
lastScrollY=lastScrollY+percent; }

//中大华师自考飘浮100*300 左
code1="<div id='ad_1' style='position:absolute;top:10px;left:0px;'><a href='http://www.gdboya.com/ad/ad4/' target='_blank'><img src=ad_pic/6.gif width=100 height=250/ border='0'></a><div style='cursor:pointer' onClick=document.getElementById('ad_1').style.display='none';>关 闭</div></div>"


//花都校区100*300 右
code2="<div id='ad_2' style='position:absolute;top:10px;right:0px;'><a href='http://www.xdgy.net/ad/ad2/' target='_blank'><img src=ad_pic/2.gif width=100 height=250 border='0'/></a><div style='cursor:pointer' onClick=document.getElementById('ad_2').style.display='none';>关 闭</div></div>"

//金融学院海珠校区飘浮100*100 左
code3="<div id='ad_3' style='position:absolute;top:280px;left:0px;'><a href='http://www.gdboya.com/ad/ad3/' target='_blank'><img src=ad_pic/1.gif width=100 height=100 border='0'/></a><div style='cursor:pointer' onClick=document.getElementById('ad_3').style.display='none';>关 闭</div></div>"


//华南师大动漫设计飘浮100*100 左
code4="<div id='ad_4' style='position:absolute;top:400px;left:0px;'><a href='http://www.gzzhaokao.com/zypx/' target='_blank'><img src=ad_pic/zgpx.gif width=100 height=100 border='0'/></a><div style='cursor:pointer' onClick=document.getElementById('ad_4').style.display='none';>关 闭</div></div>"

//广技师飘浮100*100 右
code5="<div id='ad_5' style='position:absolute;top:280px;right:0px;'><a href='http://www.xdgy.net/ad/ad6/' target='_blank'><img src=ad_pic/3.gif width=100 height=100 border='0'/></a><div style='cursor:pointer' onClick=document.getElementById('ad_5').style.display='none';>关 闭</div></div>"

//广东工业大学花都校区飘浮100*100 右
code6="<div id='ad_6' style='position:absolute;top:400px;right:0px;'><a href='http://www.xdgy.net/ad/ad3/' target='_blank'><img src=ad_pic/5.gif width=100 height=100 border='0'/></a><div style='cursor:pointer' onClick=document.getElementById('ad_6').style.display='none';>关 闭</div></div>"


document.write(code1); 
document.write(code2); 
document.write(code3); 
document.write(code4); 
document.write(code5); 
document.write(code6); 

window.setInterval("heartBeat()",1);