+var next_game = function() {
+ if (current_games === null) {
+ return;
+ }
+
+ // Try to find the game we are currently looking at.
+ for (var game_num = 0; game_num < current_games.length; ++game_num) {
+ var game = current_games[game_num];
+ if (game['url'] === backend_url) {
+ var next_game_num = (game_num + 1) % current_games.length;
+ switch_backend(current_games[next_game_num]['url'], current_games[next_game_num]['hashurl']);
+ return;
+ }
+ }
+
+ // Couldn't find it; give up.
+}
+