			$(document).ready(function() 
			{			
				closeMenuTimer = setTimeout("closeMenu()", 350);
				
				
				$("#nav > li").hover(
					function () 
					{								
						manageTimer("stop");
						closeMenu(this.id);
						
						jQuery('#nav > #'+this.id+' ul').fadeIn('fast');
					},
					function () 
					{				
						manageTimer("stop");
						manageTimer("start");
					}
				);
			});
			
			function closeMenu(except)
			{
				jQuery('#nav > li').each(function()
				{
					if (this.id != except)
					{
						jQuery('#nav #'+this.id+' ul').fadeOut('fast');
					}
				});
			}
			
			function manageTimer(action)
			{
				action = action.toLowerCase();
				
				// stop the timer
				if (action.search("start") < 0)
				{
					clearTimeout(closeMenuTimer);
				}
				else
				{
					closeMenuTimer = setTimeout("closeMenu()", 350);
				}
			}
