$(document).ready(function(){ 
var test = 0;
var ki = 0;
    $("#navigation a").mouseover( 
        function() {
			$(this).addClass("on");

			var regex = new RegExp(/menu\d+/);
			var classn = $(this).parent().attr("class");
			if(res = regex.exec(classn)) {
				var monId=res[0];
				if ($(".sousmenu[@class*="+monId+"]").length>0)
				{					
					var left = $("#navigation li:first").get(0).offsetLeft;
					var top = $(this).parent().get(0).offsetTop;
					$(".sousmenu[@class*="+monId+"]").css("top", top);
					$(".sousmenu[@class*="+monId+"]").css("left", left);
					$(".sousmenu[@class*="+monId+"]").show();
					$(".sousmenu[@class*="+monId+"]").get(0).focus();

						var decalage = $(".sousmenu[@class*="+monId+"]").get(0).offsetHeight;
						$(this).parent().next().css("margin-top", decalage);
						ki = $(this).parent();
				}

			}
        } 
   );
	
	
	$("#navigation a").mouseout( 
	function() {
		if(test==0)
		{
			$(".sousmenu").hide();
			$("#navigation a").removeClass("on");
			$(this).parent().next().css("margin-top", 0);
			
		}
	}
	);
		
		
	$(".sousmenu").hover( 		
        function() {			
			test=1;
			$(this).show();
			
			var regex = new RegExp(/menu\d+/);
			var classn = $(this).attr("class");
			if(res = regex.exec(classn)) {
				var monId=res[0];
			}
			
			$("#navigation li[@class*="+monId+"] a").addClass("on");

			var decalage = $(this).get(0).offsetHeight;
			$(ki).next().css("margin-top", decalage);
			
		},
		function() { 
			$(this).hide();
			test=0;
			 $("#navigation a").removeClass("on");
			$("#navigation li").css("margin-top", 0);
		}
   );
		
	
	$(".sousmenu").hide();
	
	$("#annexes li:nth-child(3)").css("clear","left");
	
	$("#footer li:last-child span").remove();
	
	$(".zone_droite_reportages .intro_reportage:nth-child(3)").css("margin-right",0);
	$(".zone_droite_reportages .intro_reportage:nth-child(6)").css("margin-right",0);
	
	$("#contenu .intro_gamme:last-child").css("margin-right",0);
	
	$(".zone_droite_autres_produits_intro_txt .dsc-content:last-child").css("border-right",0);
	
	
	

});
