/*

Rewrite #anchor links for pages with BASE HREF
Matt Montag
4:19 PM 2/26/2009

*/
var anchors = document.getElementsByTagName("a");
try{var basehref = document.getElementsByTagName("base")[0].href;} catch(e){} //silent error
var url = window.location.href;
if(url.indexOf("#") > 0) url = url.substr(0, url.indexOf("#")); //strip hash
if(basehref) {
	for(var i = 0; i < anchors.length; i++) {
		var anchor = anchors[i];
		poundPos = anchor.href.indexOf("/#");
		if (poundPos > 0) {
			anchor.href = url + anchor.href.substr(poundPos + 1);
			//alert(anchor.href);
		}
	}
} else {
	var basehref = "http://" + location.host + location.pathname.substr(0,location.pathname.lastIndexOf("/")+1);
}
