jQuery(document).ready(function(){ 
    	
    	//jQuery('.closeMe li ul').slideUp(1) ;
    	
    	jQuery('#navigation ul li').each(function(){
    		
    		var view = jQuery(this).children('ul');
    	
    		//variable to store the timeout id
			var tid = null;
		
			//did the view slide down?
			var went = false;
    		
    		jQuery(this).bind('mouseenter',function() {
    		
    			if(tid != null) { clearTimeout(tid); }
    			
    			
				//set the timeout and store timeout id
				if(!went) {
					tid = setTimeout(function() { 
						view.slideDown(500); 
						went = true; 
					}, 150);
    			}
    		}),
    		
    		jQuery(this).bind('mouseleave',function() {
    			
    			//clear the timeout
				if(tid != null) { clearTimeout(tid); }
				
				//if the view did slide down then slide back up
				if(went) { 
					tid = setTimeout(function() { 
						view.slideUp(500);
						went = false; 
					}, 150);
				}

    		}) ;
    	
    	}) ;
    }) ;
