$(document).ready(function() {
    
    // hover over the dropmenu link
	$("li.dropmenu").hover(function() {
	   
        // show subnav instantly (otherwise if someone scans their mouse over the link it will start looping for each scan)
    	$("li.dropmenu ul.subnav").show();
        
        // make sure our dropmenu link remains in an active state
        $("li.dropmenu a").addClass("active");
        
        // assuming we are in the subnav
		$("li.dropmenu").hover(function() {
		  
            // KEEP THE LINK ACTIVE THROUGHOUT!
            $("li.dropmenu a").addClass("active");
		}, function(){
            // we are leaving the subnav so hide it
			$("li.dropmenu ul.subnav").hide();
            
            // remove the active state of the link
            $("li.dropmenu a").removeClass("active");
		});
	}, function(){ $("li.dropmenu a").removeClass("active"); $("li.dropmenu ul.subnav").hide(); });
});

