

   var obj = null;
 
    function checkHover() {
       if (obj) {
          obj.find('ul').fadeOut('fast');
       } //if
    } //checkHover
 
    jQuery(document).ready(function() {
      jQuery('#hauptmenu > li').hover(function() {
         if (obj) {
            obj.find('ul').fadeOut('fast');
            obj = null;
         } //if

         jQuery(this).find('ul').fadeIn('fast');
      }, function() {
         obj = jQuery(this);
         setTimeout(
            "checkHover()",
            400);
      });
   });