// JavaScript Document

// Global Javascript
	$(document).ready(function(){
		   /*hide the subnavigation on initial load*/
		   $('#pnav ul li').find("ul").hide();
		   
		  /* initiate two variable, menuTime: for holding the amount of time, and menuReference (a pointer);*/
		   var menuTime;
		   var menuReference;
		
			$('#pnav ul li').hover( 
			function(){ 
				clearTimeout(menuTime);
				menuReference = $(this);
				menuTime =  setTimeout(function(){showSubnav(menuReference);},250); 
			},
			function(){ 
				clearTimeout(menuTime);
				menuReference = $(this);
				hideSubnav(menuReference)
			}
			);
			// function showSubnav will receive a reference to a particular li and show its child ul.subnav (Subnav SHOW ANIMATION)
			function showSubnav(menuReference){
				$(menuReference).children('ul').slideDown('fast');
			}
			// function hideSubnav will receive a reference to a particular li and hide its child ul.subnav (Subnav HIDE ANIMATION)
			function hideSubnav(menuReference){
				$(menuReference).children('ul').slideUp('fast');
			}
			
		});	
