// Based on http://surguy.net/menu/highlight.html

function getLeaf(url) {
  return url.substring(url.lastIndexOf("/")+1);
}

function setNav() {
  if(!document.getElementById("navigation"))
      return;
  var currentLocation = getLeaf(document.location.href);
  var menu = document.getElementById("navigation");
  var Links = menu.getElementsByTagName("a");

  for (var i=0; i<Links.length; i++) {
    var currentHref = Links[i].getAttribute("href");
				Links[i].getAttribute("class")
    var currentLeafName = getLeaf(currentHref);
if ((currentLeafName==currentLocation) && (Links[i].getAttribute("class")!='noarrow')) {
      // Setting class is needed for Mozilla compatibility - className appears to be correct 
      // according to the DOM spec
	     Links[i].setAttribute("id", "active");
      Links[i].setAttribute("idName", "active");
    }
  }
}
