/* 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=""
timerRight=""

function scroll_left(id)
{
  clearTimeout(timerRight);
  document.getElementById(id).scrollLeft-=scrollStep;
  timerRight=setTimeout("scroll_left('"+id+"')",10);
}

function scroll_right(id)
{
  clearTimeout(timerLeft);
  document.getElementById(id).scrollLeft+=scrollStep;
  timerLeft=setTimeout("scroll_right('"+id+"')",10);
}

function can_scroll_left(id)
{
	if(document.getElementById(id).scrollLeft == 0)
		return false;
	return true;
}
function can_scroll_right(id)
{
	if(document.getElementById(id).scrollLeft >= document.getElementById(id).scrollWidth)
		return false;
	return true;
}

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

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

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