var menu_up = function (el)
{
	var ulheight = jQuery(el).children("ul.nav2").height()+jQuery(el).children("a:first").height()+1;
	var h = jQuery(el).children("ul.nav2").height();
	jQuery(el)
		.stop().animate({
			top: "-"+h+"px",
			height: (ulheight)+"px"
		}, 100, 'linear',
		function()
		{
			jQuery(el).css("overflow", "visible");
		});
	
};

var menu_down = function (el)
{
	jQuery(el).css("overflow", "hidden");
	jQuery(el)
	.stop().animate({
		top: "-7px",
		height: (jQuery(el).children("a:first").height()+8)+"px"
	}, 2000);
};

jQuery(document).ready(function()
{
	jQuery(".block-menu").each(function()
	{
		if (!jQuery("a.titre-nav", jQuery(this)).hasClass("current"))
		{
			jQuery(this).hover(
				function(){menu_up(this);}
				, function(){menu_down(this);});
		}
		else
		{
			menu_up(this);
		}
	});
	
	jQuery("#nav .hasSsMenu").hover(function()
	{
		jQuery(".nav3", jQuery(this)).fadeIn(400);
	},
	function()
	{
		jQuery(".nav3", jQuery(this)).stop(false, true).hide();
	});
});
