function reloadSite () {
	// alert(document.location);
	
	//document.location.href = "";
	//document.location.reload();
	//document.navigate(document.location);
	window.location.reload();
}

function menuGotoURL(where) {
	//myHistory.newPage(where);
}	

function History() {
	this.atHome = true;
	
	this.init = function() {
		var where = this.parseWhere(document.location.hash);
		
		if(where != "" && where != undefined) {
			//alert(where);
			this.atHome = false;
			this.goToPage(where);
		}
				
		this.historyListener(unFocus.History.getCurrent());		
	};
	
	this.parseWhere = function(where) {
		return where.replace("#", "");
	};
	
	this.goToPage = function(where) {
		document.title = "Golden fire"; //ie fix		
		
		where = this.parseWhere(where);
		
		try {
			document.getElementById("swfmenu").menuSetURL(where);
		} catch(e) {
//			alert("omg");
//			reloadSite();
		};
	};
	
	this.newPage = function(where) {
		where = this.parseWhere(where);
		
		if(where != "")
			this.atHome = false;
			
		unFocus.History.addHistory(where);
	};
	
	this.historyListener = function(where) {
		
		var obj = (myHistory == undefined) ? this : myHistory;
		where = obj.parseWhere(where);
		
		
		if(obj.atHome == false || (where != "" && where != undefined)) {
				
			obj.atHome = (where == "") ? true : false;			
				
			obj.goToPage(where);
		}		
	};
	
	unFocus.History.addEventListener('historyChange', this.historyListener);	
}

var myHistory;

