$(document).ready(function(){

  function DownHoverOver(){
  	$(this).children(".showdown").slideDown('fast').show();
  }
  function DownHoverOut(){ 
    $(this).children(".showdown").slideUp('slow');
  }
  
  function RightHoverOver(){
    //$(this).children(".showright").stop().fadeTo('fast', 1).show();
  	$(this).children(".showright").show();
  	
  }
  function RightHoverOut(){ 
    $(this).children(".showright").hide();    
  }	
  var config_down = {    
  	 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
  	 interval: 100, // number = milliseconds for onMouseOver polling interval    
  	 over: DownHoverOver, // function = onMouseOver callback (REQUIRED)    
  	 timeout: 500, // number = milliseconds delay before onMouseOut    
  	 out: DownHoverOut // function = onMouseOut callback (REQUIRED)    
  };
  
  	var config_right = {    
  	 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
  	 interval: 150, // number = milliseconds for onMouseOver polling interval    
  	 over: RightHoverOver, // function = onMouseOver callback (REQUIRED)    
  	 timeout: 400, // number = milliseconds delay before onMouseOut    
  	 out: RightHoverOut // function = onMouseOut callback (REQUIRED)    
  };
  $("ul.menu li").hoverIntent(config_down);
  $("ul.menu li li").hoverIntent(config_right);
  
  //on leaving page make sure menu goes away so if user then goes back menu will
  //be gone
  $(window).unload(function() {
    $(".menu ul").css('display', 'none');
  });

});