var minHeight = 25;
var maxHeight = 207;

var menu_abierto = 1;


window.addEvent('domready', function(){
	
	var timerHide = 0;
	var timerShow = 0;

	strContenido = "menu_id";
		
	var showItem = new Fx.Morph($(strContenido), {
		duration: 1000,
		link: 'cancel',
		transition: Fx.Transitions.Quart.easeOut	
	});		

	$(strContenido).addEvents({
		'mouseover': function(){
			if(timerHide){		$clear(timerHide); }
			if(timerShow){		$clear(timerShow); }
			timerShow = functionShow.delay(200);			
		},
		'mouseout': function(){
			timerHide = functionSalir.delay(500);			
			$clear(timerShow);
		}
		
	});
	
	
	
	//TIMER DE SALIR
	var functionSalir = function(){ 
		$clear(timerHide);
		if(menu_abierto){
			menu_abierto = 0;
			showItem.start({height:[maxHeight,minHeight]});			
		}
	};	
	
	
	//TIMER DE SALIR
	var functionShow = function(){ 
		$clear(timerShow);
		if(!menu_abierto){
			menu_abierto = 1;
			
			showItem.start({height:[minHeight,maxHeight]});	
		}
	};	
	
	
	if(menu_inicia_abierto){
		timerHide = functionSalir.delay(2000);			
	}else{
		menu_abierto = 0;
//		showItem.start({height:[minHeight,minHeight]});	
	}
	

	
});


