$(document).ready(function(){
	//Level 1 Navigation (Global).
	$("ul.globalnav li a").hover(function() { //When trigger is moused over...
		
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav_join").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav_join").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
	
	//Level 2 Navigation (Master)
	$("ul.masternav li a").hover(function() { //When trigger is moused over...
		
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
	
	//Level 3 Navigation (Featured).
	$("ul.topnav li a").hover(function() { //When trigger is moused over...
		
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav_cost-reduction").slideDown('fast').show(); //Drop down the subnav on click
		$(this).parent().find("ul.subnav_quality").slideDown('fast').show(); //Drop down the subnav on click
		$(this).parent().find("ul.subnav_custom").slideDown('fast').show(); //Drop down the subnav on click
		$(this).parent().find("ul.subnav_education").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav_cost-reduction").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
			$(this).parent().find("ul.subnav_quality").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
			$(this).parent().find("ul.subnav_custom").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
			$(this).parent().find("ul.subnav_education").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
});
