// JavaScript Document
// Author : Kevin Cannon
function highlightCurrentLink() {
  
	var currentLocation = document.location.href;
	var targetNode;

	targetNode = document;
	
	// You can speed up this script, by preventing it searching through the entire document
	// Uncomment the line below, and it will only search through the tag with ID 'navigation'
	
	//targetNode = document.getElementById("navigation");
	
	links = targetNode.getElementsByTagName("a");

	// Search thorugh all links
	for (i=0; i<links.length; i++) {
		linkHref = links[i].href;
		
		if (linkHref==currentLocation) {
			// Set class for different browsers, if link is this link
			links[i].setAttribute("className", "currentLink");
			links[i].setAttribute("class", "currentLink");      
		}
	}
}

// Piggy-back fucntion onto onLoad event ............................................
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

addLoadEvent(highlightCurrentLink);