var mustScroll = 1;
var tScroll;
var curPos = 250;

function runTimer() {
  if (mustScroll == 1)
  {
    curPos += 1;
    window.scroll(0, curPos);
    if ( curPos > document.body.scrollHeight - 250 )
    {
      curPos = 0;
      window.scroll(0, 0);
    }
  }
  
  tScroll = window.setTimeout("runTimer();", 40);
}

window.onload = runTimer;
window.onunload = new Function("clearTimeout(tScroll)");
