function hiliteNav() {
  // pathDepthLimit refers to the number of levels to parse 
  // after splitting window.location.href
  var hrefDepthLimit = 2;
  
  // grab the url. we'll split it and pull out the individual pieces
  var strHref = window.location.href;
  strHref = strHref.replace(/^http:\/\/|\/$/g, '');
  
  // create an array from the url. nix the leading pieces and trailing "/"
  var strHrefParts = strHref.split("/");
  
  // nix the first element, the domain name
  strHrefParts.shift();
  
  // nix the last item if it contains .htm*
  if (strHrefParts[strHrefParts.length-1].match(".htm")) {
    strHrefParts.pop();
  }

  // need to set a limit on hrefDepthLimit so it doesn't go below zero
  if (strHrefParts.length-hrefDepthLimit < 0) {
    hrefDepthLimit = strHrefParts.length;
  }

  // run through the array of pieces
  for (var i=strHrefParts.length;i>strHrefParts.length-hrefDepthLimit;i--) {
    var o = document.getElementById(strHrefParts[i-1]);
    // add an additional class
    if (o) {
      o.className = "subNav1 selected";
    }
  }
}

if (window.attachEvent) {
  window.attachEvent("onload", hiliteNav);
}
else {
  window.onload = hiliteNav;
}
