function MainScreenAndShopFunc(message)
	if message == "Main screen or shop money pressed" then
		local money = PermanentStorage.GetLocalInt("Money")
		EditBoxDialog("Money edit dialog", "Money edit"
				, "YouHave"
				, 90
				, "lua:MainScreenAndShopFunc" 
				, "Change money dialog ok button pressed"
				, "Change money dialog cancel button pressed" )
		SendMessage("EditBoxDialogMover", "move to in")
		SendMessage("Money edit", "set value "..money)
	elseif message == "Change money dialog ok button pressed" then
		local newMoneyStr = SendMessageReply("Money edit", "get value")
		if string.find(newMoneyStr, "^%d%d?%d?%d?%d?%d?%d?$") ~= nil then
			-- не более 7 цифр, потому что далее Lua округляет
			-- float? Он точно представляет целые до 16777216.
			PermanentStorage.SetLocalInt("Money", tonumber(newMoneyStr))
			SendMessage("Money edit", "disable cursor")
			SendMessage("EditBoxDialogMover", "move to out")
			SendMessage("Money edit dialog", "hide")
		end
	elseif message == "Change money dialog cancel button pressed" then
		SendMessage("Money edit", "disable cursor")
		SendMessage("EditBoxDialogMover", "move to out")
		SendMessage("Money edit dialog", "hide")
	else
		assert(false, "Unknown message "..message)
	end
end