    $(function() {
      closetimer = 0;
      $('ul#nav b').mouseover(function() {
        clearTimeout(closetimer);
         $('ul#nav ul ul ul:visible').fadeOut('slow');
         $('ul#nav em').removeClass('hover');
         $('ul#nav ul ul:visible').fadeOut('slow');
         $('ul#nav i').removeClass('hover');
                  if ($(this).hasClass('hover')) {
          $(this).parent('a').next('ul').fadeOut('slow');
           $(this).removeClass('hover');
        }
        else {
          $('#nav b').removeClass();
          $(this).addClass('hover');
          $('#nav ul:visible').fadeOut('slow');
            $(this).parent('a').next('ul').fadeIn('slow');
        }
      });
      $('#nav i').mouseover(function() {
        clearTimeout(closetimer);
        $('#nav ul ul ul:visible').fadeOut('slow');
        $('#nav em').removeClass('hover');
                if ($(this).hasClass('hover')) {
                    $(this).parent().next().fadeOut('slow');
           $(this).removeClass('hover');
        }
        else {
          $('#nav i').removeClass();
          $(this).addClass('hover');
                    $('#nav ul ul:visible').fadeOut('slow');
          $(this).parent().next().fadeIn('slow');
         }
      });
      $('#nav em').mouseover(function() {
        clearTimeout(closetimer);
        if ($(this).hasClass('hover')) {
          $(this).parent().next().fadeOut('slow');
          $(this).removeClass('hover');
        }
        else {
          $('#nav em').removeClass();
          $(this).addClass('hover');
          $('#nav ul ul ul:visible').fadeOut('slow');
          $(this).parent().next().fadeIn('slow');
         }
      });
      $('#nav').hover(
        function() {  // over
          clearTimeout(closetimer);
        },
        function() {  // out
          closetimer = window.setTimeout(function() {
          $('#nav ul ul ul:visible').hide('slow');
          $('#nav em').removeClass('hover');
          $('#nav ul ul:visible').hide('slow');
          $('#nav i').removeClass('hover');
          $('#nav ul:visible').hide('slow');
          $('#nav b').removeClass('hover');
          }, 200);
      });
    });
  // end of jQuery
