/* 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=235

timerLeft=""
timerRight=""
nowpos = 0;

function toLeft(id){
  document.getElementById(id).scrollLeft=0
}

function scrollDivLeft(id){
  clearTimeout(timerRight) 
  document.getElementById(id).scrollLeft+=5
  if ( nowpos < scrollStep){
	  nowpos +=5
  timerRight=setTimeout("scrollDivLeft('"+id+"')",10) 
  } else {
  	nowpos = 0
  }
}

function scrollDivRight(id){
  clearTimeout(timerLeft)
  document.getElementById(id).scrollLeft-=5
  //timerLeft=setTimeout("scrollDivRight('"+id+"')",10)
  if ( nowpos < scrollStep){
	  nowpos +=5
  timerRight=setTimeout("scrollDivRight('"+id+"')",10) 
  } else {
  	nowpos = 0
  }
}

function toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
}

function stopMe(){
  clearTimeout(timerRight) 
  clearTimeout(timerLeft)
}


