-//get_group('Group A', display_group);
-//get_group('Group A', display_stream_schedule);
-//get_group('Group A', function(response_a) {
-// var teams = parse_teams_from_spreadsheet(response_a);
-// var games = parse_games_from_spreadsheet(response_a, 'Group A', true);
-// get_group('Group B', function(response_b) {
-// teams = teams.concat(parse_teams_from_spreadsheet(response_b));
-// games = games.concat(parse_games_from_spreadsheet(response_b, 'Group B', true));
-// get_group('Semifinals', function(response_c) {
-// teams = teams.concat(parse_teams_from_spreadsheet(response_c));
-// games = games.concat(parse_games_from_spreadsheet(response_c, 'Semifinals', true));
-// get_group('Bronze final', function(response_d) {
-// teams = teams.concat(parse_teams_from_spreadsheet(response_d));
-// games = games.concat(parse_games_from_spreadsheet(response_d, 'Bronze final', true));
-// get_group('Final', function(response_e) {
-// teams = teams.concat(parse_teams_from_spreadsheet(response_e));
-// games = games.concat(parse_games_from_spreadsheet(response_e, 'Final', true));
-// display_stream_schedule_parsed(teams, games);
-// });
-// });
-// });
-// });
-//});
+function showschedule(page)
+{
+ let teams = [];
+ let games = [];
+ let num_left = 5;
+
+ let cb = function(response, group_name) {
+ teams = teams.concat(parse_teams_from_spreadsheet(response));
+ games = games.concat(parse_games_from_spreadsheet(response, group_name, true));
+ if (--num_left == 0) {
+ display_stream_schedule_parsed(teams, games, 0);
+ }
+ };
+
+ get_group('Group A', cb);
+ get_group('Group B', cb);
+ get_group('Group C', cb);
+ get_group('Playoffs', cb);
+ get_group('Playoffs 9th-13th', cb);
+};
+
+function do_series(series)
+{
+ do_series_internal(series, 0);
+};
+
+function do_series_internal(series, idx)
+{
+ (series[idx][1])();
+ if (idx + 1 < series.length) {
+ carousel_timeout = setTimeout(function() { do_series_internal(series, idx + 1); }, series[idx][0]);
+ }
+};
+
+function showcarousel()
+{
+ let teams_per_group = [];
+ let games_per_group = [];
+ let combined_teams = [];
+ let combined_games = [];
+ let num_left = 5;
+
+ let cb = function(response, group_name) {
+ let teams = parse_teams_from_spreadsheet(response);
+ let games = parse_games_from_spreadsheet(response, group_name, true);
+ teams = filter_teams(teams, response);
+ teams_per_group[group_name] = teams;
+ games_per_group[group_name] = games;
+
+ combined_teams = combined_teams.concat(teams);
+ combined_games = combined_games.concat(games);
+ if (--num_left == 0) {
+ let series = [
+ [ 13000, function() { display_group_parsed(teams_per_group['Group A'], games_per_group['Group A'], 'Group A'); } ],
+ [ 2000, function() { hidetable(); } ],
+ [ 13000, function() { display_group_parsed(teams_per_group['Group B'], games_per_group['Group B'], 'Group B'); } ],
+ [ 2000, function() { hidetable(); } ],
+ [ 13000, function() { display_group_parsed(teams_per_group['Group C'], games_per_group['Group C'], 'Group C'); } ],
+ [ 2000, function() { hidetable(); } ],
+ [ 13000, function() { display_group_parsed(teams_per_group['Playoffs 9th-13th'], games_per_group['Playoffs 9th-13th'], 'Playoffs 9th–13th'); } ],
+ [ 2000, function() { hidetable(); } ]
+ ];
+ let num_pages = find_num_pages(combined_games);
+ for (let page = 0; page < num_pages; ++page) {
+ series.push([ 13000, function() { display_stream_schedule_parsed(combined_teams, combined_games, page); } ]);
+ series.push([ 2000, function() { hidetable(); } ]);
+ }
+
+ do_series(series);
+ }
+ };
+
+ get_group('Group A', cb);
+ get_group('Group B', cb);
+ get_group('Group C', cb);
+ get_group('Playoffs 9th-13th', cb);
+ get_group('Playoffs', cb);
+};
+
+function stopcarousel()
+{
+ if (carousel_timeout !== null) {
+ hidetable();
+ clearTimeout(carousel_timeout);
+ carousel_timeout = null;
+ }
+};
+
+function hidescorebug()
+{
+ document.getElementById('entire-bug').style.display = 'none';
+}
+
+function showscorebug()
+{
+ document.getElementById('entire-bug').style.display = null;
+}
+
+function showmatch2()
+{
+ let css = "-webkit-animation: fade-in 1.0s ease; -webkit-animation-fill-mode: both;";
+ document.getElementById('scorebug2').style = css;
+ document.getElementById('clockbug2').style = css;
+}
+
+function hidematch2()
+{
+ let css = "-webkit-animation: fade-out 1.0s ease; -webkit-animation-fill-mode: both;";
+ document.getElementById('scorebug2').style = css;
+ document.getElementById('clockbug2').style = css;
+}
+
+function showmatch3()
+{
+ let css = "-webkit-animation: fade-in 1.0s ease; -webkit-animation-fill-mode: both;";
+ document.getElementById('scorebug3').style = css;
+ document.getElementById('clockbug3').style = css;
+}
+
+function hidematch3()
+{
+ let css = "-webkit-animation: fade-out 1.0s ease; -webkit-animation-fill-mode: both;";
+ document.getElementById('scorebug3').style = css;
+ document.getElementById('clockbug3').style = css;
+}