jQuery(document).ready(function($) {

  $(function() {
    var zIndexNumber = 10000;
    $('div').not($('id*="fancy"')).each(function() {
      if( !(zIndexNumber < 0) ) { $(this).css('zIndex', zIndexNumber); }
      zIndexNumber -= 10;
    });
  });     
         
  $('#nav a.dropdown').click(function() {
    hide_dropdown();
    $(this).next().show();
    return false;
  });        
      
  $('div.dropdown').mouseleave(function() {
    $(this).hide(); 
  });
    
  function hide_dropdown() {
    $('div.dropdown').each(function() {
      $(this).hide();
    }) 
  } 
    
}); 

