/* This script and many more are available free online at

The JavaScript Source!! http://javascript.internet.com

Created by: Mr J | http://www.huntingground.net/ */
scrollStep=5
timerLeft=""
timerAutoUp=""
timerRight=""
timerUp=""
timerDown=""
timerTop=""
timerBottom=""

function toLeft(id){
  document.getElementById(id).scrollLeft=0
}

function scrollDivLeft(id){
  clearTimeout(timerRight) 
  document.getElementById(id).scrollLeft+=scrollStep
  timerRight=setTimeout("scrollDivLeft('"+id+"')",10)
}

function scrollDivUp(id){
  clearTimeout(timerDown) 
  document.getElementById(id).scrollTop-=scrollStep
  timerDown=setTimeout("scrollDivUp('"+id+"')",10)
}

function scrollDivDown(id){
  clearTimeout(timerUp) 
  document.getElementById(id).scrollTop+=scrollStep
  timerUp=setTimeout("scrollDivDown('"+id+"')",10)
}


function scrollDivRight(id){
  clearTimeout(timerLeft)
  document.getElementById(id).scrollLeft-=scrollStep
  timerLeft=setTimeout("scrollDivRight('"+id+"')",10)
}

function toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
}

function stopMe(){
  clearTimeout(timerRight) 
  clearTimeout(timerLeft)
  clearTimeout(timerUp) 
  clearTimeout(timerDown)
  clearTimeout(timerAutoUp)   
}
/////////////////////////////////////////////////////// VERTICAL
function toBottom(id){
  document.getElementById(id).scrollBottom=0
}

function toTop(id){
  document.getElementById(id).scrollBottom=document.getElementById(id).scrollHeight
}

var maxi=0;

function autoscrollDivDown(id){
  clearTimeout(timerAutoUp);
  document.getElementById(id).scrollTop+=1;
  if (document.getElementById(id).scrollTop>580) { document.getElementById(id).scrollTop=0; }
  timerAutoUp=setTimeout("autoscrollDivDown('"+id+"')",50);
}
