

var HistoryBridge = function() {

	return {
		//
		//	init -  add the listener to unFocus.History
		//
		init : function()
		{
			unFocus.History.addEventListener('historyChange', HistoryBridge.historyListener);
		},
		//
		//	historyListener - create history listener
		//
		historyListener : function(historyHash)
		{
			FlashBridge.onHashChange(historyHash);
		},
		//
		//	getLocation - get the location
		//
		getLocation : function()
		{
		  return window.location.toString();
		},
		//
		//	setHash - function to set hash from Flash
		//
		setHash : function(str)
		{
			unFocus.History.addHistory(str);
		},
		//
		//	getHash - function to get the hash to Flash
		//
		getHash : function()
		{
			return unFocus.History.getCurrent();
		}
	}
}();

HistoryBridge.init();