(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)


$(document).ready(function () {

	//animation du social banner
	$("#fb").mouseover(function(){
			$("#socialContainer").css("background-image", "url(/system/application/views/img/socialFB-hover.png)");      
	    }).mouseout(function(){
	   		$("#socialContainer").css("background-image", "url(/system/application/views/img/social.png)");   
	    });
	$("#ms").mouseover(function(){
			$("#socialContainer").css("background-image", "url(/system/application/views/img/socialMS-hover.png)");      
		}).mouseout(function(){
			$("#socialContainer").css("background-image", "url(/system/application/views/img/social.png)");   
	    });
	                
	$("#tw").mouseover(function(){
			$("#socialContainer").css("background-image", "url(/system/application/views/img/socialTW-hover.png)");      
		}).mouseout(function(){
			$("#socialContainer").css("background-image", "url(/system/application/views/img/social.png)");      
	    });
	        
	        
	//animation du menu
	$("#homeM").mouseover(function(){
		if ($(this).hasClass("nhl"))
		{
			$(this).attr({ 
			      src: "/system/application/views/img/menu-home-hover.png",
			    }); 
		}
                  
        }).mouseout(function(){
          if ($(this).hasClass("nhl"))
          {
          $(this).attr({ 
                src: "/system/application/views/img/menu-home.png",
              });   
              }
        });
	        
	$("#worksM").mouseover(function(){
	     if ($(this).hasClass("nhl"))
	     {
	      $(this).attr({ 
	            src: "/system/application/views/img/menu-works-hover.png",
	          });   
	          }       
	    }).mouseout(function(){
	     if ($(this).hasClass("nhl"))
	     {
	      $(this).attr({ 
	            src: "/system/application/views/img/menu-works.png",
	          });   
	          }
	    });
	
	$("#whereM").mouseover(function(){
	      if ($(this).hasClass("nhl"))
	      {
	      $(this).attr({ 
	            src: "/system/application/views/img/menu-where-hover.png",
	          });    
	          }      
	    }).mouseout(function(){
	      if ($(this).hasClass("nhl"))
	      {
	      $(this).attr({ 
	            src: "/system/application/views/img/menu-where.png",
	          });  
	          } 
	    });
	    
	 $("#whoM").mouseover(function(){
	       if ($(this).hasClass("nhl"))
	       {
	       $(this).attr({ 
	             src: "/system/application/views/img/menu-who-hover.png",
	           });  
	           }        
	     }).mouseout(function(){
	      if ($(this).hasClass("nhl"))
	      {
	       $(this).attr({ 
	             src: "/system/application/views/img/menu-who.png",
	           }); 
	           }  
	     });
	     
	 $("#contactM").mouseover(function(){
	      if ($(this).hasClass("nhl"))
	      {
	       $(this).attr({ 
	             src: "/system/application/views/img/menu-contact-hover.png",
	           });
	           }          
	     }).mouseout(function(){
	       if ($(this).hasClass("nhl"))
	       {
	       $(this).attr({ 
	             src: "/system/application/views/img/menu-contact.png",
	           });  
	           } 
	     });
     
     
     
});





