<menu>
	<page source="menu_steam/main_menu.xml" />
	<page source="menu_steam/options.xml" />
	<page source="menu_steam/achievements.xml" />
	<page source="menu_steam/profile_settings.xml" />
	<page source="menu_steam/map.xml" />
	<page source="menu_steam/finalWin.xml" />
	<page source="menu_steam/messageBoxExit.xml" />
	<page source="menu_steam/messageBoxSelectTutorial.xml" />
	<page source="menu_steam/story.xml" />
	<page source="menu_steam/msgBoxTryOtherDifficulty.xml" />
	<page source="menu_steam/castleSelect.xml" />
	<page source="menu_steam/leaderboard.xml" />
	<page source="menu_steam/newLandType.xml" />
	<page source="menu_steam/messageBoxDeleteProgress.xml" />

	<script>
		sequence initMainMenu()
		{
			wait(0.01);
			fadeOut(0, true);
			loadImage('/nemesys_flat');
			fadeIn(1.0, false);
			wait(3.0, true);
			fadeOut(0.5, false);
			deleteImage();
			loadImage('/loading_flat');
			fadeIn(0.5, false);
			initMenu();
			wait(5.0, true);
			playMusic('music/menu.ogg');
			fadeOut(0.5, false);
			deleteImage();
			setPage('main_menu');
			waitFrame(2);
			fadeIn(0.5, true);
		}
		sequence switchZombieMode()
		{
			fadeOut(0.5, true);
			killMenu();
			switchZombieMode();
			initMenu();
			setPage('main_menu');
			waitFrame(2);
			fadeIn(0.5, true);
		}
		sequence backToMenuFromGame()
		{
			fadeOut(0.5, true);
			killGame();
			initMenu();
			playMusic('music/menu.ogg');
			setPage('main_menu');
			waitFrame(2);
			fadeIn(0.5, true);
		}
		sequence retryAndContinue()
		{
			fadeOut(0.5, true);
			killGame();
			initGame();
			waitFrame(2);
			fadeIn(0.5, true);
			unpauseGame();
		}
		sequence backToMapFromGame()
		{
			fadeOut(0.5, true);
			killGame();
			initMenu();
			playMusic('music/map.ogg');
			waitFrame(2);
			setPage('map');
			showStoryIfNeeded();
			waitFrame(2);
			fadeIn(0.5, true);
			startConqueringAnimation();
			showNewLandTypeIfNeeded();
			checkDemoVersion();
		}
		sequence showFinalWin()
		{
			fadeOut(0.5, true);
			killGame();
			initMenu();
			playMusic('music/finalwin.ogg');
			setPage('finalWin');
			waitFrame(2);
			fadeIn(0.5, true);
		}
		sequence startTerritory()
		{
			fadeOut(0.5, true);
			killMenu();
			initGame();
			waitFrame(2);
			fadeIn(0.5, true);
			unpauseGame();
		}
	</script>
</menu>
