$(document).ready(function() { // If detect pop-ups setting is enabled and we are in a pop-up window if (Drupal.settings.simplemenu.detectPopup && window.opener) { return; } // get the element to add the menu to var element = Drupal.settings.simplemenu.element; switch (Drupal.settings.simplemenu.placement) { case 'prepend': $(element).prepend(simplemenu); break; case 'append': $(element).appendTo(simplemenu); break; case 'replace': $(element).html(simplemenu); break; } var $menu = $(element+" > .menu").attr("id", "simplemenu").addClass('clear-block'); $('body').addClass('simplemenu-enabled'); var animation = {}; animation[Drupal.settings.simplemenu.effect] = 'toggle'; // Build menu $menu.superfish( { animation: animation, delay: Drupal.settings.simplemenu.hideDelay, speed: Drupal.settings.simplemenu.effectSpeed }) .find(">li:has(ul)") .mouseover(function(){ $("ul", this).bgIframe({opacity:false}); }) .find("a") .focus(function(){ $("ul", $(".nav>li:has(ul)")).bgIframe({opacity:false}); }).end().end() .find("a") .removeAttr('title').end() .children('li.expanded').addClass('root'); });