
// menuDivId - id of the div containing the menu.
// menuItemClassName - name of style for link. menuItemClassName + "on" is used
// as the activated menu item.
function tcc_highlightMenuItem(menuDivId,menuItemClassName) {
	//var sublinks = xGetElementsByClassName(menuDivId);
	var thirdlevelmenu = document.getElementById(menuDivId);
	// Grab all the links
	if (thirdlevelmenu) {
		var sublinks = xGetElementsByTagName('a',thirdlevelmenu)
		for(var i = 0, len = sublinks.length; i < len; i++) {	
		//alert(sublinks[i].href);
			currentPath = window.location.pathname.substring(1);
	//		if (sublinks[i].href == window.location.href) {
			if (window.location.href.indexOf(sublinks[i].href) >= 0) {
	//	alert(sublinks[i].href);
				sublinks[i].className = menuItemClassName+"on";
			} else {
				sublinks[i].className = menuItemClassName;
			}	
		}
	}
}


window.onload = function() {
	// Examine the links in the third level menu 
	// and highlight any links that matches the browser window href.
	tcc_highlightMenuItem("thirdlevelmenu", "boxlink");
}
