function LoadLevelGui::onWake(%this)
{   
   if($InWorldMap || $ReplayButtonPressed)
   {
      $ReplayButtonPressed = false;
      %this.schedule(500, "loadLevel");
//      %this.loadLevel();
   }
}

function LoadLevelGui::loadLevel(%this)
{
   lockMouse(false);
   Canvas.showCursor();
   
   releaseWorldMapGui();

   // Load SceneGui scripts
   initSceneGui();
   
   // Load game level  
   $InWorldMap = false;
   sfxStopAll();   
   LoadGameLevel($CurSceneName, $CurTake);
}
