var queryStr = (window.location.search).replace(/^\?anchor=/, "");
if(queryStr != "")
{
	window.location.replace(window.location.protocol + "//" + window.location.host + window.location.pathname + "#" + queryStr);
}

function external_links()
{
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=anchors.length-1; i>=0; i--)
	{
		var anchor = anchors[i];
		if (anchor.href && anchor.href.substr(0,7) == "http://")
		{
			anchor.target = "_top";
		}
	}
}

// Change links so they use the McCuneCollection.org domain instead of the AbsoluteAnime.com domain.
function fix_links()
 {
	if (!document.getElementsByTagName) return;
	var links = document.getElementsByTagName('a');
	for (var i=0; i<links.length; i++)
	{
		if(typeof(links[i].href) == "undefined" || links[i].href == "") continue;
		//links[i].href = links[i].href.replace(/http:\/\/mccune\.localhost/i, "http://www.McCuneCollection.org");
		links[i].href = links[i].href.replace(/http:\/\/www\.absoluteanime\.com\/McCuneCollection\.org/i, "http://www.McCuneCollection.org");
		links[i].href = links[i].href.replace(/(\.com\/\/)/g, ".com/");
		links[i].title = links[i].href;
  }

}
