var scrollStep = 0;
var scrollDelay = 30;
var scrollElem = null;

function scrollRight(elem) {
	scrollStep = 5;
	scrollDelay = 20;
	scrollElem = $(elem);
	startScrolling();
}

function scrollLeft(elem) {
	scrollStep = -5;
	scrollDelay = 20;
	scrollElem = $(elem);
	startScrolling();
}

function startScrolling() {
	if (scrollStep != 0)
	{
		scrollElem.scrollLeft += scrollStep;
		setTimeout("startScrolling();", Math.round(scrollDelay));
		//if (scrollDelay > 20) scrollDelay /= 1.1;
	}
}

function stopScrolling() {
	scrollStep = 0;
}