-- --------------------------------------------------------------------------
-- Copyright © 2008 PlayFirst, Inc. All Rights Reserved.
--
-- This material is the confidential trade secret and proprietary
-- information of PlayFirst, Inc. It may not be reproduced, used, disclosed,
-- sold or transferred without the prior written consent of PlayFirst, Inc. 
-- All rights reserved.
-- --------------------------------------------------------------------------
-- Main game loop
function Main()

	DisplaySplash(
		"splash/playfirst_animated_logo.swf",
		"splash/playfirst_logo",4000
		);
	DisplaySplash("splash/sarbakan.swf", "splash/sarbakan",3000);

	-- Push the game selection screen
	while true do
		DoMainWindow("scripts/mainmenu.lua");
		-- DoMainWindow will exit only if there are NO windows pushed on the stack, so
		-- a PopModal()/PushModal() combination will not cause this to loop.
	end
end

-- Return a function to be executed in a thread
return Main