//--- OBJECT WRITE BEGIN ---
new GuiControl(titleScreen) {
   profile = "GuiDefaultProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "800 600";
   minExtent = "8 2";
   visible = "1";
   alpha = "1";

   new GuiBitmapCtrl(titleBox) {
      profile = "GuiDefaultProfile";
      horizSizing = "relative";
      vertSizing = "relative";
      position = "126 25";
      extent = "538 211";
      minExtent = "8 2";
      visible = "1";
      alpha = "1";
      bitmap = "./images/titleBox";
      wrap = "0";

      new GuiBitmapCtrl(gameLogo) {
         profile = "GuiDefaultProfile";
         horizSizing = "relative";
         vertSizing = "relative";
         position = "14 34";
         extent = "505 138";
         minExtent = "8 2";
         visible = "1";
         alpha = "1";
         bitmap = lookupimage("gameLogo");
         wrap = "0";
      };
   };
   new GuiBitmapCtrl(titleButtons) {
      profile = "GuiDefaultProfile";
      horizSizing = "relative";
      vertSizing = "relative";
      position = "286 350";
      extent = "215 200";
      minExtent = "8 2";
      visible = "1";
      alpha = "1";
      bitmap = "./images/smallSelectionBox";
      wrap = "0";

      new GuiBitmapButtonCtrl(quitGame) {
         profile = "GuiWoodButtonProfile";
         horizSizing = "relative";
         vertSizing = "relative";
         position = "16 132";
         extent = "183 52";
         minExtent = "8 2";
         visible = "1";
         alpha = "1";
         lockMouse = "0";
         bitmap = "./images/buttons/woodButton_normal.png";
         HighlightBitmap = "./images/buttons/woodButton_hover.png";
         PressedBitmap = "./images/buttons/woodButton_down.png";
         wrap = "0";
         fontBitmap = "./images/buttons/woodButton_font.png";
         charspacing = "0.5";
         charaspect = "1";
         text = lookup("Quit");
         percentWidth = "80";
         percentHeight = "55";
      };
      new GuiBitmapButtonCtrl(gameOptions) {
         profile = "GuiWoodButtonProfile";
         horizSizing = "relative";
         vertSizing = "relative";
         position = "16 74";
         extent = "183 52";
         minExtent = "8 2";
         visible = "1";
         command = "TS_showOptions();";
         alpha = "1";
         lockMouse = "0";
         bitmap = "./images/buttons/woodButton_normal.png";
         HighlightBitmap = "./images/buttons/woodButton_hover.png";
         PressedBitmap = "./images/buttons/woodButton_down.png";
         wrap = "0";
         fontBitmap = "./images/buttons/woodButton_font.png";
         charspacing = "0.5";
         charaspect = "1";
         text = lookup("Options");
         percentWidth = "100";
         percentHeight = "55";
      };
      new GuiBitmapButtonCtrl(gameStart) {
         profile = "GuiWoodButtonProfile";
         horizSizing = "relative";
         vertSizing = "relative";
         position = "16 17";
         extent = "183 52";
         minExtent = "8 2";
         visible = "1";
         command = "TS_Start();";
         alpha = "1";
         lockMouse = "0";
         bitmap = "./images/buttons/woodButton_normal.png";
         HighlightBitmap = "./images/buttons/woodButton_hover.png";
         PressedBitmap = "./images/buttons/woodButton_down.png";
         wrap = "0";
         fontBitmap = "./images/buttons/woodButton_font.png";
         charspacing = "0.5";
         charaspect = "1";
         text = lookup("Start");
         percentWidth = "85";
         percentHeight = "55";
      };
   };
   new GuiMLTextCtrl(companyText) {
      profile = "GuiMediumWhiteTextProfile";
      horizSizing = "relative";
      vertSizing = "relative";
      position = "-1 564";
      extent = "800 31";
      minExtent = "8 2";
      visible = "1";
      command = "eggSheep();";
      alpha = "1";
      lineSpacing = "2";
      allowColorChars = "0";
      maxChars = "-1";
      text = "<just:center>©2005 21-6 Productions";
   };
};
//--- OBJECT WRITE END ---


function titleScreen::onWake(%this)
{
   %this.awake = true;
   canvas.showCursor();
   Canvas.cursorOn();
}


function titleScreen::onSleep(%this)
{
   %this.awake = false;
   //canvas.showCursor();
   //Canvas.cursorOn();
}


function quitGame::onAction(%this)
{
	if(Catchem.isRegisteredVersion())
		MM_QuitGame();
	else
	{
		MM_CancelThreads();
		$jukeBox.fadeOutAudioType(song);
		Canvas.doFade("PG_stopReplayFromStartup(false); Canvas.setContent(DemoExit);", "");
	}
}
