var Menu = {
  start: function () {  
    var menu = $('menu');
    var img_opacity = new Fx.Style('menu_content', 'opacity', {'wait': false, 'duration': 400});
    menu.getFirst().addEvents({
      'mouseenter': function () {
        img_opacity.start(0.5);
      },
      'mouseleave': function () {
        img_opacity.start(1);
      }
    });
    menu.getFirst().getChildren().each(function (el) {
      var second_list = el.getElement('ul');
      second_list.setStyles({
        'opacity': 0,
        'height': menu.getStyle('height').toInt() - menu.getFirst().offsetHeight
      });
      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');
        }
      }); 
    });
  }
};
window.addEvent('domready', Menu.start);
