function leftScroll(id) {
	if(tOffset < 0) {
		tOffset = tOffset + 195;
		document.getElementById(id).style.marginLeft = tOffset + "px";
		doscroll = setTimeout("leftScroll('" + id + "')", 30);
	}
}

function rightScroll(id) {
	if(tOffset > ((thumbLength * 190) - ((thumbLength * 190) * 2) - 10) + 580) {
		tOffset = tOffset - 195;
		document.getElementById(id).style.marginLeft = tOffset + "px";
		doscroll = setTimeout("rightScroll('" + id + "')", 30);
	}
}

function stopScroll() {
	if(doscroll) clearTimeout(doscroll);
}

function initGallery() {
	var allThumbs = document.getElementsByClassName('thumb');
	thumbLength = allThumbs.length;
	tOffset = 0;
}

Event.observe(window, 'load', initGallery, false);