

// FUNCTION: SETHOTELEMENT(), incl onload handler at end
// Jeff's function for highlighting the active nav element
// NOTE: this function assumes that the link is in an LI
// Also: it depends on matching the everything after the last '/'
// in the URL to the same in a link's href, so watch out for query strings!
// Query strings may also require escaping or encoding/decoding.
function setHotElement() {
// user parameter edit ONLY the following:
hotstyle = "leftstyle"; // replace "leftstyle" with the style you want the "hotlink" to be
// don't change anything else.

	// first we grab n parse URL:
	var loc = window.location.href;
	loc = loc.substring(loc.lastIndexOf('/')+1);
	
	// then grab all links on the page:
	pagelinks = document.links; 
	
	// then loop through pagelinks to match URL: 
	for (var i = 0; i < pagelinks.length; i++) {
    	currlink = pagelinks[i].getAttribute("href");    
    	simplink = currlink.substring(currlink.lastIndexOf('/')+1);
    	
    	if (simplink == loc) {  // if we get a match...
    		if (pagelinks[i].parentNode.nodeName == 'LI') { // and its parent is an LI...
    			pagelinks[i].className = hotstyle; // we set its class to that specified above.
    		}
		}
	}
}

window.onload=function(){
setHotElement();
}
// END FUNCTION: SETHOTELEMENT()
