$(function(){
/***************************/
// set current location class for nav highlighting
function markLocation(){
	$('a')
		.each(function() {
			if(this.href == location) {
				$(this).parents("li").addClass("selected");
				$(this).parents("li").children("a").addClass("selected");
			}
		});
};
markLocation();

// two part mouseover mouseout functionality for removing current location to allow a:hover styles
// and then returning the nav item for the current page back to a selected state
$('#nav a')
	.mouseover(function(){
		$('#nav *').removeClass("selected");
	});
$('#nav a')
	.mouseout(function(){
		markLocation();
	});
/***************************/
});
