This is basically two errors but they go hand in hand since the second error goes back to the first one
Uncaught TypeError: Cannot set property 'Players' of undefined
Uncaught TypeError: Cannot read property 'CreatePlayer' of undefined
var TotalPlayers = 0;
Player.Players = [];
Player.CreatePlayer = function (name, Class, rank) {
    TotalPlayers ++;
    Player.Players[TotalPlayers] = {
        name: name,
        Class: Class,
        rank: rank
    };
    Player[name] = new Player(name, Class, rank);
};
There is more to the code than this but this should be the only parts needed
 
     
    