// JavaScript Document
var Menu = {
  start: function () {  
    var menu = $('menu');
    var img_opacity = new Fx.Style('menu_content', 'opacity', {'wait': false, 'duration': 400});
	
    	
	if ( menu.getFirst().getChildren().length > 0) {
		menu.getFirst().getChildren().each(function (el) {		 
		  var second_list = el.getElement('ul');
		  
		  if (second_list != null) {
			  
			  second_list.setStyles({
				'opacity': 0
				//'height': (menu.getStyle('height').toInt() - menu.getFirst().offsetHeight) + "px"
			  });
			  
			  var fx = second_list.effect('opacity', {'wait': false, 'duration': 200});
			  
			  el.addEvents({
				'mouseenter': function () {
				  fx.start(1);
				  this.addClass('hover');
				},
				'mouseleave': function () {
				  fx.start(0);
				  this.removeClass('hover');
				}
			  });
		  }
		});
	}
  }
};
