-- Main game loop
function Main()
	--DisplaySplash("", "splash/NatGeo_splash1.jpg",2000);
	DisplaySplash("", "splash/portal.jpg",6000);
	DisplaySplash("", "splash/MERSCOM_MC_LOGO.jpg",4000);
	DisplaySplash("", "splash/City_splash.jpg",4000);	
	DisplaySplash("", "splash/MAI_splash.jpg",4000);

	-- Push the game selection screen
	while true do
		--DoMainWindow("scripts/maingame.lua");
		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