var interval;
var speed = 10;

$(function() {
	
	function stopScroll(event) {
		clearInterval(interval);
	}
	
	$('#left, #right').mouseup(stopScroll);
	$('#left, #right').mouseout(stopScroll);
	
	$('#left').mousedown(function(event) {
		interval = setInterval( function(){scrollBy(-speed, 0)}, 10 );
	});
	$('#left').click(function(event) {
		event.preventDefault();
	});
	
	$('#right').mousedown(function(event) {
		interval = setInterval( function(){scrollBy(speed, 0)}, 10);
	});
	$('#right').click(function(event) {
		event.preventDefault();
		return false;
	});
	
});
