/**
 * @author adam
 */

$(document).ready(function() {
	
	var counter = Math.floor(Math.random()*4);
	if(counter == 0) { counter = 1; }
	
	$('#highlight').html("<img src=\""+REL_ROOT+"images/highlights/"+counter+".jpg\" />");
	
	setInterval(function() {
		
		var img = counter + 1;
		
		$('#highlight img').fadeTo(500, 0, function() {
			
			$('#highlight img').attr('src', REL_ROOT+"images/highlights/"+img+".jpg");

			setTimeout(function() {
				$('#highlight img').fadeTo(500, 1);
			}, 1000);
			
			if(counter == 3) { counter = 0; } else { counter++; }
		});
		
	}, 4500);
	
	
});

