function GameFieldFunc(message)
	if message == "Restart button pressed" then
				
		SendMessage("GameField", "Restart")
		SendMessage("RestartOrContinueDialog mover", "report arrival to post:RestartContinueScreen")
		SendMessage("RestartOrContinueDialog mover", "set arrival message hide")
		SendMessage("RestartOrContinueDialog mover", "move to out")
		if IsReceiver("GameFieldHint") then
			SendMessage("GameFieldHint", "hide")
		end
		if IsReceiver("SpecialMessage") then
			SendMessage("SpecialMessage", "hide")
		end
		
	elseif message == "Continue button pressed" then
		
		SendMessage("GameField", "Continue")
		SendMessage("RestartOrContinueDialog mover", "report arrival to post:RestartContinueScreen")
		SendMessage("RestartOrContinueDialog mover", "set arrival message hide")
		SendMessage("RestartOrContinueDialog mover", "move to out")
		
	elseif message == "Game field options credits button pressed" then
		SendMessage("Screen", "template ZGlassTemplate")
		SendMessage("Screen", "create top instance")
		SendMessage("Game field modal dialog alpha changer", "change alpha to 0.0")
		SendMessage("Game field alpha changer", "change alpha to 0.0")
		SendMessage("Game field panel mover", "report arrival to post:lua:GameFieldFunc")
		SendMessage("Game field panel mover", "set arrival message Game field panel out for credits")
		SendMessage("Game field panel mover", "move to out")
	elseif message == "Game field panel out for credits" then
		SendMessage("Screen", "erase top child")
			-- ZGlass
		SendMessage("Screen", "template GameFieldCreditsZGlassTemplate")
		SendMessage("Screen", "create top instance")
		SendMessage("Screen", "template CreditsTemplate")
		SendMessage("Screen", "create top instance")
	elseif message == "Game field credits click" then
		SendMessage("Screen", "erase top child")
			-- Credits
		SendMessage("Screen", "erase top child")
			-- ZGlass
		SendMessage("Game field modal dialog alpha changer", "change alpha to 1.0")
		SendMessage("Game field alpha changer", "change alpha to 1.0")
		SendMessage("Game field panel mover", "move to in")
	elseif message == "Game field eye button pressed" then
		SendMessage("Game field panel mover", "move to out")
		SendMessage("Game field alpha changer", "change alpha to 0.0")
		SendMessage("GameField", "Pause")
		SendMessage("Screen", "template GameFieldBackgroundZGlassTemplate")
		SendMessage("Screen", "create top instance")
	elseif message == "Game field background to game field" then
		SendMessage("Game field panel mover", "move to in")
		SendMessage("Game field alpha changer", "change alpha to 1.0")
		SendMessage("GameField", "Continue")
		SendMessage("Screen", "erase top child")
	elseif message == "Game field menu button pressed" then
		SendMessage("Game field modal dialog", "instantiate GameFieldMenuTemplate")
		SendMessage("Game field menu mover", "move to in")
		SendMessage("GameField", "Pause")
	elseif message == "Game field menu resume button pressed" then
		SendMessage("Game field menu mover", "move to out")
		SendMessage("Game field modal dialog", "hide")
		SendMessage("GameField", "Continue")
	elseif message == "Game field restart confirmation dialog yes button pressed" then
		if IsReceiver("GameFieldHint") then
			SendMessage("GameFieldHint", "hide")
		end
		if IsReceiver("SpecialMessage") then
			SendMessage("SpecialMessage", "hide")
		end
		SendMessage("Game field menu mover", "move to out")
		SendMessage("Game field modal dialog", "hide")
		SendMessage("GameField", "Restart")
		SendMessage("Exit and restart modal dialog", "hide")
	elseif message == "Game field exit confirmation dialog yes button pressed" then
		SendMessage("Screen", "template ZGlassTemplate")
		SendMessage("Screen", "create top instance")
			-- защита от повторного выхода
		SendMessage("Screen", "template DarkeningTemplate")
		SendMessage("Screen", "defineText [receiver] post:lua:GameFieldFunc")
		SendMessage("Screen", "defineText [message] Game field darkened")
		SendMessage("Screen", "create top instance")
	elseif message == "Game field darkened" then
		Sound:FadeOutTrack(PermanentStorage.GetLocalString("Track in game"), 1.0)
		if PermanentStorage.GetLocalString("Track in game") == "Game1" then
			PermanentStorage.SetLocalString("Track in game", "Game2")
		elseif PermanentStorage.GetLocalString("Track in game") == "Game2" then
			PermanentStorage.SetLocalString("Track in game", "Game3")
		elseif PermanentStorage.GetLocalString("Track in game") == "Game3" then
			PermanentStorage.SetLocalString("Track in game", "Game4")
		elseif PermanentStorage.GetLocalString("Track in game") == "Game4" then
			PermanentStorage.SetLocalString("Track in game", "Game1")
		end
		local currentTank = PermanentStorage.GetLocalString("Current Tank");
		if (tonumber(currentTank) > 3) then
			currentTank = PermanentStorage.GetLocalString(currentTank.." Tank Type")
		end
		Sound:FadeInTrack("Menu"..currentTank, 1.0, true)
		
		if PermanentStorage.GetLocalStringOrDef("temp:Current mode", "menu") == "menu" then
			SendMessage("lua:MainScreenFunc", "Enter main screen")
			SendMessage("Screen", "template BrighteningTemplate")
			SendMessage("Screen", "create top instance")
			
			if PermanentStorage.GetLocalBool("Want tutorial") then
				if PermanentStorage.GetLocalBoolOrDef("tutorial: play pressed", false) then
					SendMessage("TutorialControl", "show shop after game")
				end
			end

			--SendMessage("lua:BetaFunc", "Game field to main screen")
		else
			SendMessage("lua:ShopFunc", "Enter shop")
			MoveMainScreenPanels("in")			
			SendMessage("Cup alpha changer", "change alpha to 1.0")
			SendMessage("Screen", "template BrighteningTemplate")
			SendMessage("Screen", "create top instance")

			--SendMessage("lua:BetaFunc", "Game field to shop")
		end
		
		--SendMessage("post:lua:BetaFunc", "Commit")
		PermanentStorage.Store()
		
	elseif message == "Game field menu options button pressed" then
		SendMessage("Game field menu mover", "report arrival to post:lua:GameFieldFunc")
		SendMessage("Game field menu mover", "set arrival message Game field menu out for options")
		SendMessage("Game field menu mover", "move to out")
	elseif message == "Game field menu out for options" then
		OptionsDialog("Above game field menu", 70
				, "Game field options credits button pressed"
				, "lua:GameFieldFunc" )
		SendMessage("Options dispatcher", "report finish to post:lua:GameFieldFunc")
		SendMessage("Options dispatcher", "set finish message Game field menu options finished")
		SendMessage("Options dispatcher", "Show dialog")
	elseif message == "Game field menu options finished" then
		SendMessage("Options mover", "report arrival to post:lua:GameFieldFunc")
		SendMessage("Options mover", "set arrival message Game field menu options out")
		SendMessage("Options mover", "move to out")
	elseif message == "Game field menu options out" then
		SendMessage("Above game field menu", "hide")
		SendMessage("Game field menu mover", "move to in")
	elseif message == "Game field menu restart button pressed" then
		YesNoDialog("Exit and restart modal dialog", "WantToRestartLevel"
				, "lua:GameFieldFunc"
				, "Game field restart confirmation dialog yes button pressed"
				, "Game field restart confirmation dialog no button pressed" )
		Sound:PlaySample("window_moving")
	elseif message == "Game field menu exit button pressed" then
		YesNoDialog("Exit and restart modal dialog", "WantToExitGameField"
				, "lua:GameFieldFunc"
				, "Game field exit confirmation dialog yes button pressed"
				, "Game field exit confirmation dialog no button pressed" )
		Sound:PlaySample("window_moving")
	elseif message == "Game field exit confirmation dialog no button pressed" then
		SendMessage("Exit and restart modal dialog", "hide")
	elseif message == "Game field restart confirmation dialog no button pressed" then
		SendMessage("Exit and restart modal dialog", "hide")
	else
		assert(false, "Unknown message "..message)
	end
end