hello

trying to create a scroll for a layer which gets passed the startposition and endposition in the onclick and will scroll a certain speed to that point, what i have pasted below works but it jumps to the position instead of moving 15 pix at each loop.

if anyones got any ideas of where i am going wrong i would much appreciate the help!

sincerely
Garrett



--the script

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

function verScroll(direction, speed, startpos, finalpos) {

if (document.layers) {
var page = eval(document.contentLayer);
}
else {
if (document.getElementById) {
var page= eval("document.getElementById('contentLayer').style");
}
else {
if (document.all) {
var page = eval(document.all.contentLayer.style);
}
}
}


if (direction == "right") {
status = "move right";
while (finalpos < startpos) {
startpos = startpos - speed;
page.left = (startpos - speed);
}
}


}


// End -->
</script>



--the link
<a href="javascript:void(0);" onclick="verScroll('right',15, 0, -500)">right</a>