$(document).ready(setupSectionMenu);

var MenuDropDown = new Object();
MenuDropDown.displayTip = null;
MenuDropDown.hideSubMenu = null;

function setupSectionMenu() {
   $('.menu_sections a').hover(MenuDropDown.displayTip, MenuDropDown.hideSubMenu);

   $('.section_dropmenu').hover(function () {
         clearTimeout(MenuDropDown.hideTimer);
      },
      MenuDropDown.hideSubMenu
   );

}

MenuDropDown.displayTip = function () {
   var icon = this;

   $('.section_dropmenu').hide();
   clearTimeout(MenuDropDown.hideTimer);

   var me = this;
   MenuDropDown.showTimer = setTimeout(function () {
      var sectionName = $(me).attr('className').match(/menu_[^\s]+/i)[0];
      sectionName = sectionName.replace('menu_', '');

      $('.submenu_'+ sectionName).show();
   }, 250);
}

MenuDropDown.hideSubMenu = function () {
   clearTimeout(MenuDropDown.showTimer);

   var me = this;
   MenuDropDown.hideTimer = setTimeout(function () {
      var sectionName = $(me).attr('className').match(/(sub)?menu_[^\s]+/i)[0];
      sectionName = sectionName.replace(/(sub)?menu_/, '');

      $('.submenu_'+ sectionName).hide();
   }, 400)
}
