- node.change(onSelectDdChange);
-
- // on first page, hide the termlist
- $(document).ready(function() { findnode(".mkwsTermlists").hide(); });
- var motd = findnode(".mkwsMOTD");
- var container = findnode(".mkwsMOTDContainer");
- if (motd.length && container.length) {
- // Move the MOTD from the provided element down into the container
- motd.appendTo(container);
- }
- }
-
-
- // implement $.parseQuerystring() for parsing URL parameters
- function parseQuerystring() {
- var nvpair = {};
- var qs = window.location.search.replace('?', '');
- var pairs = qs.split('&');
- $.each(pairs, function(i, v){
- var pair = v.split('=');
- nvpair[pair[0]] = pair[1];
- });
- return nvpair;
- }
-
-
- function mkws_set_lang() {
- var lang = parseQuerystring().lang || mkws_config.lang;
- if (!lang || !mkws.locale_lang[lang]) {
- mkws_config.lang = ""
- } else {
- mkws_config.lang = lang;
- }
-
- debug("Locale language: " + (mkws_config.lang ? mkws_config.lang : "none"));
- return mkws_config.lang;
- }
-
-
- function mkws_html_switch() {
- debug("HTML switch for team " + m_teamName);
-
- var node = findnode(".mkwsSwitch");
- node.append($('<a href="#" onclick="mkws.switchView(\'' + m_teamName + '\', \'records\')">' + M('Records') + '</a>'));
- node.append($("<span/>", { text: " | " }));
- node.append($('<a href="#" onclick="mkws.switchView(\'' + m_teamName + '\', \'targets\')">' + M('Targets') + '</a>'));
-
- debug("HTML targets");
- var node = findnode(".mkwsTargets");
- node.html('\
-<div class="mkwsBytarget mkwsTeam_' + m_teamName + '">\
- No information available yet.\
-</div>');
- node.css("display", "none");
- }
-
-
- function mkws_html_sort() {
- debug("HTML sort, m_sort = '" + m_sort + "'");
- var sort_html = '<select class="mkwsSort mkwsTeam_' + m_teamName + '">';
-
- for(var i = 0; i < mkws_config.sort_options.length; i++) {
- var opt = mkws_config.sort_options[i];
- var key = opt[0];
- var val = opt.length == 1 ? opt[0] : opt[1];
-
- sort_html += '<option value="' + key + '"';
- if (m_sort == key || m_sort == val) {
- sort_html += ' selected="selected"';
- }
- sort_html += '>' + M(val) + '</option>';
- }
- sort_html += '</select>';