function Options::OnWake()
{
   $screenActive = true;
   
   switch$ ($Difficulty)
   {
      case "normal":
         Difficulty.setText("Normal");      
      
      case "hard":
         Difficulty.setText("Hard");      
      
      case "easy":
         Difficulty.setText("Easy");      
   }
   
   if($AutoSave $= true)
      autosave.setStateOn(true);
}

function InitOptions()
{
   echo("OPTIONS CLICK");
   alxPlay(click);
   canvas.pushdialog(Options);      
}

function ChangeDifficulty()
{
   switch$ ($Difficulty)
   {
      case "easy":
         $Difficulty = "normal";
         Difficulty.setText("Normal");      
      
      case "normal":
         $Difficulty = "hard";      
         Difficulty.setText("Hard");      
      
      case "hard":
         $Difficulty = "easy";      
         Difficulty.setText("Easy");      

      default:
         $Difficulty = "hard";
         Difficulty.setText("Hard");      
   }
}

// change all the game variables here as a result of the player changing the difficulty level
// this chnage can happen before or during a game but it won't effect the number of silos if it's 
// during the game

// maxsilos - the number of silos that needs to be captured in the game

function LoadSavedGame()
{
   canvas.popdialog(Options);
   
   canvas.pushdialog(SaveGameList);   
}

function Options::OnSleep()
{
   $screenActive = false;   
   
   SaveDifficulty();
}