$(document).ready(function() {

	// Hide the sub menu items first but not for the current page
	$("#nav-sub > li:not('.parent-here') > ul").hide();

	// Check for any sub menus and apply a toggle
	$('#nav-sub > li').has('ul').toggle(function() {
		// Reveal the sub menu
		$(this).find('ul').slideDown();
	}, function(evt) {
		// If the item contains a sub menu
		if ($(evt.target).parent().has('ul').length > 0) {
			// Hide the sub menu
			$(this).find('ul').slideUp();
		// Otherwise follow the link
	    } else {
			// Add the click-through link after .toggle() prevented the default
	        window.location = evt.target;
	    }
	});
	
});
