// JavaScript Document
window.onerror = stopError
function stopError() {
	return true;
}

// We need the path bacause of the base-tag
var baseHref = "";
function getBase(){
     var baseTag = document.getElementsByTagName("base");
     for(var i = 0; i < baseTag.length; i++){
          baseId = baseTag[i].id;
          baseHref = baseTag[i].href;
     }
}
getBase();

// We need to modify the anchors bacause of the base-tag
function replaceAnchors(){
     var linkTags = document.getElementsByTagName("a");
     for(var i = 0; i < linkTags.length; i++){
          linkHref = linkTags[i].href;
		  anchorPos = linkHref.indexOf("#");
		  if(anchorPos!=-1){
			anchorName = linkHref.substr(anchorPos);
			linkTags[i].href = "javascript:void(document.location.hash='"+anchorName+"')";
		 }
     }
}
if(window.addEventListener) window.addEventListener('load', replaceAnchors, false);
else if (window.attachEvent) window.attachEvent("onload", replaceAnchors);