var obj = null;
function checkHover() {
   if (obj) {
      obj.find('ul').hide();
   } //if
} //checkHover

$(document).ready(function() {
    obj = $('#categories');
   $('#categories > li').hover(function() {
      if (obj) {
         obj.find('ul').hide();
         obj = null;
      } //if
    $(this).find('ul').show();
    $(this).addClass('cyan_hover');
   }, function() {
       $(this).removeClass('cyan_hover');
      obj = $(this);
      setTimeout(
         "checkHover()",
         0);
   });
});
