window.addEvent('domready', function()
{
  if (window.location.search.indexOf('iso=') != -1 && window.location.hash == '') {
    window.location += '#translations';
  }
  if (Browser.Engine.trident) {
    return;
  }
  $('mainmenu').getElements('ul.level_2').each(function(el) {
    el.set({'opacity':0});
  });
  $('mainmenu').getElements('a.submenu').each(function(el) {
    var ul = el.getParent().getElement('ul.level_2');
    el.addEvent('mouseenter', function() {
      new Fx.Morph(ul, {'duration':300}).start({'opacity':1});
    });
    el.addEvent('mouseout', function() {
      setTimeout(function() {
        if (ul.getStyle('left').toInt() < 0) {
          ul.set({'opacity':0});
        }
      }, 50);
    });
  });
  $('mainmenu').getElements('span.submenu').each(function(el) {
    var ul = el.getParent().getElement('ul.level_2');
    el.addEvent('mouseenter', function() {
      new Fx.Morph(ul, {'duration':300}).start({'opacity':1});
    });
    el.addEvent('mouseout', function() {
      setTimeout(function() {
        if (ul.getStyle('left').toInt() < 0) {
          ul.set({'opacity':0});
        }
      }, 50);
    });
  });
});

