/* Grab the quick jump menu and
   turn it into a flyout menu
------------------------------------ */
$(document).ready(function() {
  
  // assign a class to the menu to know we've taken control of it
  $("#jumptoindustry").addClass("flyout");
  
  // for the jump to industry flyout menu, let's grab the h3
  // element and turn it into a list item, moving the following
  // list as a sub-list for it
  var defaultOption = $("#jumptoindustry h3").text();
  $("#jumptoindustry h3").remove();
  
  // before creating the new list, let's hold on to the existing one
  var currentList = $("#jumptoindustry ul");
  
  $("#jumptoindustry").prepend("<ul><li>" + defaultOption + "</li></ul>");
  $("#jumptoindustry ul:first li:first").append(currentList);
  
  // for IE's sake, let's add a class to the top-level LI element
  // so that IE can mimic the hover effect on list items
  if ($.browser.msie) {
    
      $("#jumptoindustry ul:first li:first ul:first").wrap("<div></div>");
    
      $("#jumptoindustry ul:first li:first").bind("mouseover", function() {
          $(this).addClass("sfhover");
      });
      
      $("#jumptoindustry ul:first li:first").bind("mouseout", function() {
          $(this).removeClass("sfhover");
      });
  }
  
});