     "use strict";
     // Requires:
     // ECMAScript 5
     // HTML 5 Canvas support
     // HTML 5 <a> download attribute
     // HTML 5 FileReader

     // TODO -- support the concept of a pass
     // TODO -- WeeWeekly tournament with a consolation round.
     // TODO -- save score and track a withdrawal
     // TODO -- link suggested download name to title
     // TODO -- fix tab order when inputting player names
     // TODO -- support doubles matches
     // TODO -- reexamine drawing code.  I.E. calling begin path to clear is questionable.
     // TODO -- round and position of a match do not need to be saved, can be derived.

     // TODO -- remove the constraint that a player can only be edited at the first round level. This is annoying to a user and not helpful.  UI should not reflect the underlying datamodel.

      // 2 rounds = 4 players
      // 3 rounds = 8 players
      // 4 rounds = 16 players
      // 5 rounds = 32 players
      // 6 rounds = 64 players


     function handlePlayerNumberCombo(combo) {
       var selIndex = combo.selectedIndex;

       initializeData(selIndex);
       theApp.canvasView.redraw();
     }

     function initializeData(selIndex) {
       // Player number = 2 to the power of (selIndex + 2)
       // (0,1,2,3,4) ==> (4,8,16,32,64)
       theApp.tournament.createBlankData(Math.pow(2,selIndex + 2));
     }


     function handleCanvasClick(e) {
       theApp.canvasView.handleClick(e);
       return false;
     }


     function handleFileSelect(evt) {
       fileManager.handleFileSelect(evt);
     }

      window.onload = function() {

        PPUtils.bind("change", "fileLoader", handleFileSelect);
        // TODO -- fix
        //PPUtils.bindTextField("keyup", "tournamentNameTextField", tournament, "titleChanged");
      };

     var theApp = new PPApplication();

     // Global variables.
     var tournamentLoader = new PPTournamentLoader();
     var fileManager = new PPFileManager(tournamentLoader);
     //var tournament;
     //var canvasView;
     var stateManager = new PPStateManager();
     //var editController;


     //  Register tournament types
     tournamentLoader.registerTournamentTypes( [PPCribTournament, PPTennisTournament] );

     // BEGIN StateManager Hook functions -----------------------------------------------------------
     function stateBeginHook() {  }
     function stateChooseTournamentHook() {
     }
     function stateLoadTournamentHook() {  }
     function stateConfigureTournamentHook() {
       //tournament = tournamentLoader.getSelectedTournamentType();
       theApp.setTournament(tournamentLoader.getSelectedTournamentType());
//       canvasView = new PPCanvasView(tournament);
//       var canvas = $("myCanvas");
//       canvasView.setCanvas(canvas);
//       canvas.onclick = handleCanvasClick;
//       editController = new PPEditController(tournament)
//       Setup listeners.
//       tournament.addSelectedMatchListener(editController);

       initializeData($("numberOfPlayersCombo").selectedIndex);
       theApp.canvasView.redraw();
     }
     function stateStartTournamentHook() {
          showElement($("tournamentTitle"));

          theApp.editController.disablePlayerTextFields(true);
          theApp.editController.disableWinnerRadioButtons(true);
     }
     // END StateManager Hook functions -----------------------------------------------------------

     stateManager.linkDivsAndHooksToStates(
       ["begin", "chooseTournamentType", "configureTournament", "matchEditor", "loadTournament"],
       [stateBeginHook, stateChooseTournamentHook, stateConfigureTournamentHook, stateStartTournamentHook, stateLoadTournamentHook],
       [PPState.START, PPState.CHOOSE_TOURNAMENT, PPState.CONFIGURE_TOURNAMENT, PPState.START_TOURNAMENT, PPState.LOAD_TOURNAMENT] );



@@ -1116,35 +1116,24 @@
      theApp.
-canvasView.
 redraw();%0A  
@@ -2500,464 +2500,75 @@
     
-//tournament = tournamentLoader.getSelectedTournamentType();%0A       theApp.setTournament(tournamentLoader.getSelectedTournamentType());%0A//       canvasView = new PPCanvasView(tournament);%0A//       var canvas = $(%22myCanvas%22);%0A//       canvasView.setCanvas(canvas);%0A//       canvas.onclick = handleCanvasClick;%0A//       editController = new PPEditController(tournament)%0A//       Setup listeners.%0A//       tournament.addSelectedMatchListener(editController);%0A
+theApp.setTournament(tournamentLoader.getSelectedTournamentType());
 %0A   
@@ -2620,32 +2620,32 @@
 selectedIndex);%0A
+
        theApp.ca
@@ -2642,27 +2642,16 @@
  theApp.
-canvasView.
 redraw()

use application redraw method