
function setActive() {
  var1 = document.getElementById('pagemenu').getElementsByTagName('a');
  var2 = document.location.href.substring(document.location.href,document.location.href.lastIndexOf('/'));
  
  for(i=0;i<var1.length;i++) {
    

   
   if(var1[i].href.substring(var1[i].href,var1[i].href.lastIndexOf('/')) == document.location.href.substring(document.location.href,document.location.href.lastIndexOf('/'))) {
      var1[i].className='active';
    }
  }
}

window.onload = setActive;

