// JavaScript Document

// navigation highlight by location script (.current)
// #nav below must match the id of the nav in html and css
$(function() {
	//dynamic menu highlight
	//grab the URL in the window's location bar
	var href = window.location.pathname;
	//split into an array of nested directories
	href = href.split("/");
	//for each link in your #nav, compare its href attribute to the stored location hash
	$("#nav a").each(function(){
		var thisHref = $(this).attr("href");
		thisHref = thisHref.split("/");
		//if there is a match at the first location, add a class of current to the link
		if (href[1]==thisHref[1]) { $(this).addClass("current"); }
		
	});
});

//DEBUG:	document.getElementById("debug").innerHTML += "thishref="+thisHref+"<br/>";
