/* 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/ */

timerScroll = 0;

function toLeft(id){
	document.getElementById(id).scrollLeft=0;
}

function scrollDiv(id, step)
{
	document.getElementById(id).scrollLeft += step;
	timerScroll = setInterval(function() {document.getElementById(id).scrollLeft += step;}, 10);
}

function scrollDiv(id, step, max)
{
	document.getElementById(id).scrollLeft += step;
	if (document.getElementById(id).scrollLeft > max)
		document.getElementById(id).scrollLeft -= max;
	else if (document.getElementById(id).scrollLeft == 0)
		document.getElementById(id).scrollLeft = max;
	
	timerScroll = setInterval(function() {document.getElementById(id).scrollLeft += step; if (document.getElementById(id).scrollLeft > max) document.getElementById(id).scrollLeft -= max; else if (document.getElementById(id).scrollLeft == 0) document.getElementById(id).scrollLeft = max;}, 10);
}

function toRight(id){
	document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth;
}

function stopScroll(){
	clearInterval(timerScroll);
}


