$(document).ready(function(){

	$("ul.submenu").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.submenu*)

	$("ul.topmenu li span").hover(function() { //When trigger is clicked...

		//Following events are applied to the submenu itself (moving submenu up and down)
		$(this).parent().find("ul.submenu").slideDown('fast').show(); //Drop down the submenu on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.submenu").slideUp('slow'); //When the mouse hovers out of the submenu, move it back up
		});


	});
	
	$("ul.topmenu > li > a").hover(function() { //When trigger is clicked...

		//Following events are applied to the submenu itself (moving submenu up and down)
		$(this).parent().find("ul.submenu").slideDown('fast').show(); //Drop down the submenu on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.submenu").slideUp('slow'); //When the mouse hovers out of the submenu, move it back up
		});


	});

});

