var scrolling = 0;	// Controls whether the layer is scrolling or not
var yT = 5;	// Pixel position the top of the scrolling layer should be set to
var lT = 5;	// Initial position for the top of the layer
var yI = 3;	// Increment that the scrolling layer should move at
var yH = 0;	// Hight of scrolling layer
var object = null;	// Stores the generic DOM for the scrolling layer to access style properties

function startScroll(objectID,direction) {
	object = $(objectID);
	scrolling = true;
	scroll(direction);
}

function scroll(direction) {
	if (scrolling) {
		if(direction == 1) {
			yT = yT + yI;
			object.scrollLeft = yT;
			if(object.scrollLeft < yT) {
				yT = object.scrollLeft;
				scrolling = false;
			}
		} else {
			yT -= yI;
			object.scrollLeft = yT;
			if(object.scrollLeft > yT) {
				yT = object.scrollLeft;
				scrolling = false;
			}
		}
		setTimeout('scroll('+ direction + ')',0);
	}
	return false;
}

function stopScroll() {
	scrolling = 0;
	return false;
}