// code to be run when the document has loaded
$(function() { 
		   
	// add a class of hidden to any ul's that are the child of an li. As we set any elements with a class of hidden to have the property display: none, this will now hide these nested ul's when the page loads
	$('#portfolio-nav > ul > li > ul').addClass("hidden");

	// select any a-tags that are children of a ul that contains an li that has both ul and li children. Apply a function to the selected elements that will fire when it is clicked
	$('ul li:has(ul li)').children('a').click(function() {
											  
	// toggle the class "hidden" on the child ul of the li containing the a tag that has been clicked											 
	$(this).parent().children('ul').toggleClass("hidden");
	
	// return false so that the link is not followed		
	return false;

	});

});