//$(document).ready(function () {
//  $('#nav li').hover(
//    function () {
//      //show its submenu
//      $('ul.level2', this).slideDown('fast', null);
//    }, 
//    function () {
//      //hide its submenu
//      $('ul.level2', this).slideUp('fast', null);      
//    }
//  );
//});

$(document).ready(function () {
$('ul.level2').hide(); // needed to prevent CSS-only behaviour on first contact
$('#nav li').hover(
  function() {
    $(this).find('>ul.level2').stop().height('auto').slideDown(150); // the height('auto') prevents the menu from memorizing an incorrect height-value forever when leaving the menu while the animation is running
  },
  function() {
    $(this).find('>ul.level2').stop().slideUp(50);
  }
);
});

