
var stopScrolling=false;
var slowSpeed=3;
var fastSpeed=8;
var scrollingSpeed=slowSpeed;
var isScrolling=false;

function slowScrollLeft() {
	scrollingSpeed=slowSpeed;
	if(isScrolling==false) {
		stopScrolling=false;
		startScroll();		
	}
}

function fastScrollLeft() {
	scrollingSpeed=fastSpeed;
	if(isScrolling==false) {
		stopScrolling=false;
		startScroll();		
	}
}

function slowScrollRight() {
	scrollingSpeed=-slowSpeed;
	if(isScrolling==false) {
		stopScrolling=false;
		startScroll();		
	}
}

function fastScrollRight() {
	scrollingSpeed=-fastSpeed;
	if(isScrolling==false) {
		stopScrolling=false;
		startScroll();		
	}
}

function startScroll()
{
	isScrolling=true;
	var item=document.getElementById("scrollable_item")
	item.scrollLeft+=scrollingSpeed;
	if (item.scrollLeft==8000)
	{
		item.scrollLeft=0;
	}
	if (!stopScrolling)
	{
		window.setTimeout("startScroll()",1);
	} else {
		isScrolling=false;
	}
}

function stopScroll(event)
{
	stopScrolling=true;
}
