-- Main game loop

require( "scripts/ai/parameters.lua" );

SplashOverlayStyle = {
	disableAbort = true;
};

function Main()

--	*** Removed on client request
--	SetDefaultStyle(SplashOverlayStyle);

	if CanShowSplash() then 
		NoAbortStyle={ parent=DefaultStyle, disableAbort=true };
		AbortStyle={ parent=DefaultStyle, disableAbort=false };
		SetDefaultStyle(NoAbortStyle);
		DisplaySplash("splash/pogo.swf", "splash/pogo",4000);
		DisplaySplash("splash/hasbro.swf", "splash/hasbro",4000);
		
		SetDefaultStyle(AbortStyle);
		DisplaySplash("splash/sarbakan.swf", "splash/sarbakan",4000);
		
--	*** Removed on client request
--		DisplaySplash("menu/titlescreen.png", "menu/titlescreen",4000);
	end

	-- Push the game selection screen
	while true do

		-- Regular game menu
		DoMainWindow("scripts/menus.lua");

		-- To test your own window, just use it instead of mainmenu
--		DoMainWindow("scripts/sandbox.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