function mainmenu(){
  jQuery(".menu ul").hide();
  jQuery(".menu li").hoverIntent(function() {
    clearTimeout(jQuery.data(this, 'timeout'));
    jQuery(this).find('ul:first').stop(true, true).delay(50).animate({ "height": "show", "opacity": "show" }, 200 );
  }, function() {
    jQuery.data(this, 'timeout', setTimeout(jQuery.proxy(function() { 
      jQuery(this).find('ul:first').stop(true, true).delay(50).animate({ "height": "hide", "opacity": "hide" }, 200 );
    }, this), 300));
  });
}
jQuery(mainmenu);
