// JavaScript Document

function scroll(dy) 
{ 
   var sc = document.getElementById('scroller-contents'); 
   var top = parseInt(sc.style.top); 
 
   if(isNaN(top)) 
      top = 0; 
 
   top += dy; 
 
   if(top > 0) 
      top = 0; 
 
   var height = sc.offsetHeight - document.getElementById('scroller').offsetHeight; 
   if(top < -height) 
      top = -height; 
 
   sc.style.top = (top + dy) + 'px'; 
} 
 
var intervalID = null; 
 
function startScroll(dy, dt) 
{ 
   var todo = 'scroll(' + dy + ')'; 
   intervalID = setInterval(todo, dt); 
} 
 
function stopScroll() 
{ 
   clearInterval(intervalID); 
 
   var sc = document.getElementById('scroller-contents'); 
//   alert(sc.offsetWidth); 
} 
