code: function setMenu() {
    var url = document.location.href;
    // strip extension
    url = stripExtension(url);
    
    var ulElement = document.getElementById("menu");
    var links = ulElement.getElementsByTagName("A");
    var i;
    for(i = 0; i < links.length; i++) {
      if(url.indexOf(stripExtension(links[i].href)) == 0) {
        links[i].className = "active_menu";
        return;
      }
    }
  }
docs: sets the active menu scanning for a menu item which url is a prefix
  of the one of the current page ignoring file extension.
  Nice trick!