$(document).ready(function() {	
	function megaHoverOver(){
		$(this).css('z-index', 99);	
		$(this).find(".sub").stop().fadeTo('fast', 1).show();
	}
	
	function megaHoverOut(){ 
	  $(this).css('z-index', 98);	
	  $(this).find(".sub").stop().fadeTo('fast', 0, function() {		  
		  $(this).hide(); 
	  });
	}

	var config = {    
		 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
		 interval: 100, // number = milliseconds for onMouseOver polling interval    
		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
		 timeout: 500, // number = milliseconds delay before onMouseOut    
		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
	};

	$("ul.topnav li .sub").css({'opacity':'0'});
	$("ul.topnav li").hoverIntent(config);
	
	
	//megamenu
	$('#detail_univers1').clone().appendTo('.univers1');
	$('#detail_univers2').clone().appendTo('.univers2');
	$('#detail_univers3').clone().appendTo('.univers3');
	$('#detail_univers4').clone().appendTo('.univers4');
	$('#detail_univers5').clone().appendTo('.univers5');
	$('#detail_univers6').clone().appendTo('.univers6');
	$('#detail_univers7').clone().appendTo('.univers7');
	$('#detail_univers8').clone().appendTo('.univers8');
	$('#detail_univers9').clone().appendTo('.univers9');
	$('#detail_univers10').clone().appendTo('.univers10');
	$('#detail_univers11').clone().appendTo('.univers11');	

});