on');
    option.appendChild(document.createTextNode(l));
    document.form.locale.appendChild(option);
    locales[l] = i;
    i++;
  }

  /* Parse the query string to determine the current locale */
  var currentLocale = document.form.locale[0].value;
  var query = location.search.substring(1);
  var params = query.split("&");
  for(var i = 0; i < params.length; i++) {
    var parts = params[i].split("=");
    if (parts.length != 2) continue;
    if (parts[0] == "locale" && locales[parts[1]]) {
        cu