var pageScrollTimer;

function pageScroll(toY,cuY) {

var temp=document.body.scrollTop;

var speed=5;

if (pageScrollTimer) clearTimeout(pageScrollTimer);

if (!toY || toY < 0) toY = 0;

if (!cuY) cuY = temp;

cuY += (toY - temp) / speed;

if (cuY < 0) cuY = 0;

var posY = Math.floor(cuY);

window.scrollTo(0, posY);

if (posY != toY) {

pageScrollTimer = setTimeout("pageScroll("+toY+","+cuY+")",18);

}

}
