/* JQuery scripts go here */

$(document).ready(function(){	//When document is done loading...



	//
	// Menu nav interaction
	//
	// Hover on/off
	$('#menu li').hover(	
		//Over
		function() {
			$(this).addClass('hovered');
		}, 
		//Out
		function() {
			$(this).removeClass('hovered');
		}
	);
	
	// Click
    $('#menu li').click(function(event) {
    	var newMenuSectionID = $('a', this).attr('href');
		$('.selected').removeClass('selected');	//Remove selected class from old selection (if any)
		$(this).addClass('selected');			//Make this selected
		if ($("body").attr("id") == "menupage") {	//If we're on the menu page
	    	$('#wideColumn div.menuSection:visible').fadeOut('slow', function() {	//Fade out whichever section is currently visible
		    	//Fade in the newly selected section
		    	$(newMenuSectionID).fadeIn('slow');
	    	});		
		} else {	//If we're not yet on the menu page
	    	window.location = newMenuSectionID;	//Go to new URL
		}
	});





});

