
function rolloverImage() {
	$('.hover').mouseover(function() {
		var source = $(this).attr("src").length;
		var ext = $(this).attr("src").substring(source - 4, source);
        var newsource = $(this).attr("src").substring(0, source - 4) + "_on" + ext;
        $(this).attr("src", newsource);
	});
	
	$('.hover').mouseout(function() {
		var source = $(this).attr("src").length;
		var ext = $(this).attr("src").substring(source - 4, source);
		var newsource = $(this).attr("src").substring(0, source - 7) + ext;
		if ( $(this).attr("src").substring( source - 7, source - 4) == "_on" ) {
		  $(this).attr("src", newsource);
		}
	});
}

function navigation() {
	
	// Désactivation rollover image pour le rétablir avec d'autres déclencheur
	$('.catalogue li img.hover').unbind();
	
	$('.selection li img.hover').mouseover(function(){
		$(this).css('left','-1px')
	});
	$('.selection li img.hover').mouseout(function(){
		$(this).css('left','0')
	});
	
	$('.catalogue li').not('.sous_menu li').mouseenter(function() {
		// Affichage du sous-menu
		$(this).find('.sous_menu').show();
		
		// Rollover des image avec un autre déclencheur
		if ( $(this).find('.hover').size() > 0 ) {
			var source = $(this).find('.hover').attr("src").length;
			var ext = $(this).find('.hover').attr("src").substring(source - 4, source);
			var newsource = $(this).find('.hover').attr("src").substring(0, source - 4) + "_on" + ext;
			$(this).find('.hover').attr("src", newsource);
			$(this).find('.hover').css('left','-1px')
		}
		
	});	
	$('.catalogue li').not('.sous_menu li').mouseleave(function() {
		$(this).find('.sous_menu').hide();
		
		if ( $(this).find('.hover').size() > 0 ) {
			var source = $(this).find('.hover').attr("src").length;
			var ext = $(this).find('.hover').attr("src").substring(source - 4, source);
			var newsource = $(this).find('.hover').attr("src").substring(0, source - 7) + ext;
			if ( $(this).find('.hover').attr("src").substring( source - 7, source - 4) == "_on" ) {
			  $(this).find('.hover').attr("src", newsource);
			  $(this).find('.hover').css('left','0')
			}
		}
	});	
	
	
}

