/*
 *
 * 	Coder: Jens Hoffmann (c) dkd 2007
 * 	Check if there is a Hash # in the URL.
 *  Take the rest after the Hash and reload the Page.
 *
 */

var hashDealer = {

	checkURL: function() {
		var currentURL = location.href;
		if (currentURL.search(/#/) !== -1) {
			var baseURL = this.getBaseUrl();
			var currentUrlAfterHash = currentURL.split("#")[1].substr(1);
			var cleanURL = baseURL + currentUrlAfterHash;
			// Reloadsite with a native URL
			location.replace(cleanURL);
		}
	},

	getBaseUrl: function() {
		var baseURL = document.getElementsByTagName('base')[0].attributes[0].nodeValue;
		// IE6 Fallback
		if (!baseURL) {
			baseURL = "http://" + window.location.host + "/";
		}
		return baseURL;
	}

};

hashDealer.checkURL();