var stop = false;
var timer;
var interval;
function blink(index, speed) {
	index = index - 1;
	interval = speed;
	blinkOn(index);
	$('div.bucket-container > div').eq(index).hover(function() {
		clearTimeout(timer);
		stop = true;
	}, function() {
		stop = false;
		blinkOn(index);
	});
}

function blinkOn(index) {	
	$('div.bucket-container > div').eq(index).css('background', 'url(../images/greenbucket.png) no-repeat 0 -251px');
	if(!stop) {
		timer = setTimeout(function() { blinkOff(index); }, interval);
	}
}

function blinkOff(index) {
	$('div.bucket-container > div').eq(index).css('background', 'url(../images/greenbucket.png) no-repeat 0 0px');
	setTimeout(function() { blinkOn(index); }, interval);
}

