function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(clearCurrentLink);

//Checking the url of the current page and passing the current anchor href to removeAttr() function
function clearCurrentLink(){
    var a = document.getElementsByTagName("a");
    for(var i=0;i<a.length;i++)
		if(a[i].href == window.location.href.split("#")[0])
			removeAttr(a[i]);
}

//Removin the href from the anchor tag - so the css still works for active page hover
function removeAttr(n){
	n.removeAttribute('href');
}

