$(document).ready(function() {

// SEARCH BOX ONCLICK
$(".search").focus(function () { 
	if ($(".search").val() == "Enter Keyword(s)") {
		$(".search").val("");	
	}
}).blur(function () { 
	if ($(".search").val() == "") {
		$(".search").val("Enter Keyword(s)");	
	}
});


	$("#nav li").hover(function() {
		$(this).addClass("mainhover");
	}, function() { // on hover out
	$(this).removeClass("mainhover");
	});
	
	
	$("#nav li a.mainlink").hover(function() { //When link is hovered on...
		
		//Following events are applied to the nav-sub itself (moving nav-sub up and down)
		$(this).parent().find("ul.nav-sub").show(); //Drop down the nav-sub on click

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.nav-sub").fadeOut('slow'); //When the mouse hovers out of the nav-sub, 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"
	    });
	
});
