$(document).ready(function(){

	$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
	// span is not added if subnav is not found
	$("#Menu1 li").hover(function() { //When trigger is clicked...
		
		$(this).find("span").addClass("subhover"); //On hover over, add class "subhover"
		$(this).find("a:first").addClass("tophover"); // add hover class to main link when trigger is hovered
		
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).find("ul.subnav").show(); 

		$(this).hover(function() {
		}, function(){	
			$(this).find("ul.subnav").hide(); 
		});

	}, function(){	//On Hover Out
		$(this).find("span").removeClass("subhover"); //On hover out, remove class "subhover"
		$(this).find("a:first").removeClass("tophover"); // remove hover class from main link when trigger is off hover
	});

});
