/* this function, called by body.onload, sets the 
 * highlight state for the main navigation. 
 */
function highlightMainNav() {
	// get the current path
	var path = document.location.pathname;
	// the top-level directory in the path is our section name 
	var section = path.split("/")[1];
	// append 'Anchor' to get the ID of the corresponding <a>
	var sectionAnchor = section + "Anchor";
	// find that <a> and color it red
	elem = document.getElementById(sectionAnchor);
	elem.style.color="#990000";
}

/* this function, called by body.onload, sets the 
 * highlight state for the subnavigation. 
 */
function highlightSubNav() {
	// get the current path
	var path = document.location.pathname;
	// derive our subsection name either from the 
	// second-level directory, which may be blank
	// (if we default to a subpage in that section)...
	var subsection = path.split("/")[2];
	// or it may have to be blanked out if the second
	// element in the path is a actually a filename
	if (subsection.indexOf(".php")>0) {subsection = "";}
	// append 'Anchor' to get the ID of the corresponding <a>
	var subsectionAnchor = subsection + "Anchor";
	// find that <a> and color it red
	elem = document.getElementById(subsectionAnchor);
	elem.style.color="#990000";
}

