var isHover = false;
var masterTimeout;
$(document).ready(function(){	
	//Change Scene every 5 seconde
		setInterval("ChangeScene();", 5000);
	//Don't do animation when mouse is over...
		$(".pics").hover(function(){isHover = true;}, function(){isHover = false;});
});
	 
//Animate the scenes from right to left	 
	function ChangeScene(){
		if (!isHover) {		
			var scenes = $(".scrobbler");
			var currentMargin = parseInt(scenes.css("marginLeft").replace("px", ""));
			scenes.animate({
				"marginLeft": (currentMargin - 760)
			}, "slow", switchScenes);
		}
	}

//Take the first 5 scenes and put it at the end. 
	function switchScenes(){
		$(".scrobbler").css("marginLeft", 0);
	    $(".scrobbler .pics:lt(5)").appendTo(".scrobbler");	
	} 