/*
 * Author: Axel BELUJON
*/

$(function(){
	// Path is the way to access to the logo images, currently handled by CI
	var path = $('#imageZone img').attr("src");
	var n = path.lastIndexOf("/");
	path = path.substr(0, n+1);
		  
    // Aleatoire
    var count = Math.round(Math.random()*23);
    $('#imageZone img').attr("src", path+count+".png"); 
		  
	// On mouseover, start the logo change
	$('#imageZone img').mouseover(function(){
		$(this).everyTime(50, "imgChange", function(i) {
  			count = count + 1;
  			$(this).attr("src", path+count+".png");
			if(count == 23){
				count = 1;
			}
		}, 0);
	});
	
	$('#imageZone img').mouseout(function(){
		$(this).stopTime("imgChange");
	});
	
	// SOCIAL ZONE : Rollover on links
	$('#socialZone a').mouseover(function(){
		$(this).children('img').stop().animate({"top":"-5px"}, 200);									  
	}).mouseout(function(){
		$(this).children('img').stop().animate({"top":"0px"}, 200);									 
	});
})
























