﻿// JScript 文件

lastScrollY=0;
function moveFloat()
{ 
	var diffY;
	if (document.documentElement && document.documentElement.scrollTop)
	diffY = document.documentElement.scrollTop;
	else if (document.body)
	diffY = document.body.scrollTop;
	else{}
	percent=.1*(diffY-lastScrollY); 
	if(percent>0) percent=Math.ceil(percent); else percent=Math.floor(percent); 
	
	document.getElementById("float_L").style.top=parseInt(document.getElementById("float_L").style.top)+percent+"px";
	document.getElementById("float_R").style.top=parseInt(document.getElementById("float_R").style.top)+percent+"px";
	
	lastScrollY=lastScrollY+percent; 
}

document.write('<div id="float_L" style="left:0px; top:100px; height:200px; width:150px; position:absolute; z-index:100; background-color:#39F; display:none">'); 
document.write('左栏浮动广告代码'); 
document.write('</div>'); 

document.write('<div id="float_R" style="right:10px; top:150px; height:200px; width:150px; position:absolute; z-index:100; background-color:#39F">'); 
document.write('右栏浮动广告代码'); 
document.write('</div>');

window.setInterval('moveFloat()',10);
