jQuery(function( $ ){
	$('#leftbutt').click(function(){
		return false;
	});
	$('#leftbutt').mouseover(function(){
		startTimer('l');
	});
	$('#leftbutt').mouseout(function(){
		stopTimer();
	});
	$('#rightbutt').click(function(){
		return false;
	});
	$('#rightbutt').mouseover(function(){
		startTimer('r');
	});
	$('#rightbutt').mouseout(function(){
		stopTimer();
	});
});

// TIMER

var ido = 40;
var t;
var timer_is_on = 0;
var where = "r";

function timedCount() {
	move();
	t = setTimeout("timedCount()", ido);
}

function startTimer(w) {
	where = w;
	doTimer();
}

function doTimer() {
	if (!timer_is_on) {
		timer_is_on = 1;
		move();
		t = setTimeout("timedCount()", ido);
	}
}

function stopTimer() {
	clearTimeout(t);
	timer_is_on = 0;
}

function move() {
	if ( where == "r" ) {
		$('#slide').animate({scrollLeft: '+=10px'}, 20 );
	} else {
		$('#slide').animate({scrollLeft: '-=10px'}, 20 );
	}
}

