/** menu.js is included in the Makutsi banner.html div in most of the pages.
 * It captures the body.onload event, then scans the links in each page to see which, if any, point to
 * the page currently on display.  It changes the className of all such to "active", which gives them
 * emphasis.  This means that the menu should show which page is currently displayed.
 * Trevor, 2010-03-27
 */

window.onload = windowOnload;  // capture the body onload function

function windowOnload(event) {  // when the document body has finished loading,
	for (var i = 0; i < document.links.length; i++) {  // visit every link in the page
		var link = document.links[i];  // get the next link
		if (link.pathname == window.location.pathname)  // if this link points to the current page,
			link.className = "active";  // give it the active class for emphasis
		else  // else this link points somewhere else;
			if (link.className = "active")  // if this link has the active menu class,
				link.className = null;  // remove it.
	}
}
