// ----- gestion du menu du haut en jQuery + jQuery.accordion ----- //
var obj = null;
var objEC = null;
function checkHover(data) {
//	alert(obj);
	if (data) {
		data.find('ul').slideUp('slow');
	} //if
} //checkHover

//jQuery.fn.gestMenu = function(param) {
//	this.hover(
//		function() {
//			if (objEC) {
//				/*obj.children('ul').slideUp('slow');*/
//				obj = objEC;
//				setTimeout(
//					function() {checkHover(obj);},
//					300);
//				
//			} //if
//			
//			if (jQuery(this).children('ul').is(":hidden")) {	
//				jQuery(this).children('ul').slideDown('slow');
//				objEC = jQuery(this);
//			}
//		}, function() {
//			setTimeout(
//			function() {checkHover(objEC);},
//			300);
//			objEC = null;
//		}
//	);
//}


jQuery.fn.slideMenu = function(param) {

	var hauteur = jQuery(this).children('ul').height();
	jQuery.each(this,
		function() {
			jQuery(this).hover(
				function() {
					if (jQuery(this).children('ul').is(':hidden')) {
						//virer les attributs de taille restant
						jQuery(this).children('ul').fadeIn(700);
					}else{
						jQuery(this).children('ul').stop().css({'opacity':1});
					}
				},
				function() {
					jQuery(this).children('ul').fadeOut(700);

				}
			);
		}
	);
}

//appel pour menus
jQuery(document).ready(
	function() {
		jQuery('#menu-menu-part > li').slideMenu();
		jQuery('#menu-menu-pro > li').slideMenu();
	}
);
