-- Main game loop
 SplashOverlayStyle = {
   disableAbort=true;
 };
 
 SplashNoOverlayStyle = {
   disableAbort=false;
 };

function Main()
	
	SetDefaultStyle(SplashOverlayStyle);
	DisplaySplash("", "splash/escreen.jpg",4000);
	SetDefaultStyle(SplashNoOverlayStyle);
        DisplaySplash("", "splash/splash1.jpg",2000);
	DisplaySplash("", "splash/splash2.jpg",2000);
	DisplaySplash("", "splash/merscom1_glow",2000);
	DisplaySplash("", "splash/splash3.jpg",1);
	

	-- 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