// general purpose javascript for botmaster interface

function switchLocale(locale) {
  var url = new String(document.location);
  var posBotmaster = url.indexOf('/botmaster/');
  var urlAfterBotmaster = url.substring(posBotmaster+11);
  var posNextSep = urlAfterBotmaster.indexOf('/');
	
  if (locale == "other") {
      document.location = url.substring(0,posBotmaster+12+posNextSep) + "other-locale";
  } else {
      document.location = url.substring(0,posBotmaster+11) + locale + urlAfterBotmaster.substring(posNextSep);
  }
}
