function initialize() {

	dhtmlHistory.initialize();
	dhtmlHistory.addListener(handleHistoryChange);
	
	// determine our current location so we can
	// initialize ourselves at startup
	var initialLocation = dhtmlHistory.getCurrentLocation();
	
	// set the default
	if (initialLocation == ""){
		// --- Передаем параметры во Flash ---
		setTimeout("setMenu('home')", 100);
		updateUI(initialLocation, null);
	} else {
		// now initialize our starting UI
		//updateUI not needed for flash version
		splitted = initialLocation.split("/");
		loadModule(splitted[0], splitted[1], splitted[2]);
		updateUI(initialLocation, {m:splitted[0], p:splitted[1], menuId:splitted[2]});
	}
	
	return initialLocation;
	
}


/** A simple method that updates our user interface using the new location. */
function updateUI(newLocation, historyData) {
	var historyMessage;
	if (historyData != null){
//		document.title = "Borbon/" + dhtmlHistory.getCurrentLocation();
	} else {
		historyMessage = "<i>No History Data - init history</i>";
		document.title = "Bourbon - домашняя страница";
	}
}

function get(param){
	alert(historyStorage.get(param));
}

function handleHistoryChange(newLocation, historyData) {
	if (historyData != null) {
		updateUI(newLocation, historyData);
		loadModule(historyData.m, historyData.p, historyData.menuId);
	} else {
		loadModule('home', 'index', '');
	}
}

// ---  ---
function thisMovie(movieName) {
	return document[movieName]
}

function movie(name) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[name]
	} else {
		return document[name]
	}
}

function setMenu(name) {
	thisMovie('header').menuInit(name);
}