
function masquer_menus_deroulant(){
	for(i=0;i<100;i++){
		if($('smenu_'+i)){
			$('smenu_'+i).set('tween', {
				duration: 500
			}).tween('height', '0px');
			$('smenu_'+i).set('opacity','0.80')
		}
	}
}
function masquer_tous_menus(){
	for(i=0;i<100;i++){
		if($('smenu_'+i)){
			$('smenu_'+i).style.height='0px';
			$('smenu_'+i).set('opacity','0.80')
		}
	}
}

window.addEvent('domready', function(){
	//First Example
	// We are setting the opacity of the element to 0.5 and adding two events
	//var hauteur_menu=250;
	
	var zone_menu2 = $$('.rubrique_list'); 
	zone_menu2.each(function(item3) {
		item3.addEvent('mouseover', masquer_menus_deroulant); 

	});
	// The same as before: adding events
	 var zone_menu = $$('.ul_deroulant'); 
	 zone_menu.each(function(item) {
		 //var smenu = item.getChildren();
		 var rel_parent=item.get('rel');

		$(rel_parent).set('rel',item.offsetHeight);
		//alert('test='+item.offsetHeight)
		$(rel_parent).addEvents({
			'mouseenter': function(){
			masquer_menus_deroulant();
			item.set('tween', {
					duration: 500
				}).tween('height',$(rel_parent).get('rel') +'px'); 
		 	}
		 });
		 $(item).addEvents({
				'mouseleave': function(){
				// Resets the tween and changes the element back to its original size
				this.set('tween', {
					duration: 500
				}).tween('height', '0px')
		 	}
		});
		
	}); 
	masquer_tous_menus();
	
});
