
/*$(document).ready(function(){
$("#menu div").each(function(){
   $(this).mouseover(function(){
     $(this).children("ul").slideDown("fast");
         if($.browser.msie) { var hauteur = $(this).width(); $(this).children("ul").css({marginLeft:"-"+hauteur+"px"});}
         $(this).prev().children("ul").fadeOut("fast");
     $(this).siblings().children("ul").fadeOut("fast");
   });
});
$("body").click(function(){
  $("#menu div ul").fadeOut("fast");
});

});*/

/*var obj = null;

$(document).ready(function() {
	$('#Nav > li').hover(function() {
		if (obj) {//si l'objet est présent, il est déroulé, donc on le fait disparaitre
			obj.children('ul').fadeOut('fast');
			obj = null;
		} //sinon, on le fait apparaitre lorsque l'on passe la souris dessus
 
		$(this).children('ul').fadeIn('fast');
 
	}, function() { //on fait disparaitre si on est plus sur l'élément au bout de 0 seconde
		obj = $(this);
		setTimeout(
			"checkHover()",
			0); // si vous souhaitez retarder la disparition, c'est ici
	}), $('.Menu > li').hover(function(){//fonction qui fait "clignoter une fois" l'entrée du menu au passage de la souris
		$(this).fadeTo('slow', 0.3);
		$(this).fadeTo('normal', 1);});
});*/



$(function(){
	$('#menu .subMenuOpen').hover(function(){		
		var padding_a_top = parseInt($(this).find('.subMenu a').css('padding-top').replace("px", ""));
		var padding_a_bottom = parseInt($(this).find('.subMenu a').css('padding-bottom').replace("px", ""));
		var height_a = $(this).find('.subMenu a').height()+padding_a_top+padding_a_bottom;
		//alert(height_a);
		var _height = $(this).find('.subMenu > *').length * height_a;
		//alert(_height);
		$(this).find('.subMenu').stop().animate(
			{height: _height+'px'},
			{queue:false, duration:400}
		);
		/*$(this).find('.subMenu').css('height', 'auto');*/
	}, function(){
		$(this).find('.subMenu').stop().animate(
			{height: '0px'},
			{queue:false, duration:200}
		);
	});
	
	$('.subMenuOpen a').hover(function(){
		$(this).stop().animate({color: '#4b4b4b'}, {queue:false, duration:400});
		$(this).stop().animate({backgroundColor: menu_color_hover}, {queue:false, duration:400});
	}, function(){
		$(this).stop().animate({color: '#ffffff'}, {queue:false, duration:200});
		$(this).stop().animate({backgroundColor: '#555555'}, {queue:false, duration:200});
	});
});