function anotherWord(anotherWordForm) {
  var anotherWordValue = document.getElementById("anotherword").value;
  anotherWordValue = anotherWordValue.replace(/ /g, "_").toLowerCase();
  window.location = "/what-is/another-word-for/" + anotherWordValue + ".html";
  return false;
}

function oppositeOf(oppositeOfForm) {
  var oppositeOfValue = document.getElementById("oppositeof").value;
  oppositeOfValue = oppositeOfValue.replace(/ /g, "_").toLowerCase();
  window.location = "/what-is/the-opposite-of/" + oppositeOfValue + ".html";
  return false;
}

function translateWord(translateForm) {
  var word = document.getElementById("translate").value;
  word = word.replace(/ /g, "_").toLowerCase();
  var languageIndex = document.getElementById("language").selectedIndex;
  var language = document.getElementById("language").options[languageIndex].value;
  var splitIndex = language.indexOf("-");
  var fromLanguage = language.substring(0, splitIndex);
  var toLanguage = language.substring(splitIndex + 1);
  if (fromLanguage == 'english') {
    window.location = "/what-is/the/" + toLanguage + "-word-for-" + word + ".html";
  }
  else {
    window.location = "/what-is/the-meaning-of/" + fromLanguage + "-word-" + word + ".html";
  }
  return false;
}

function matchWord(matchWordForm) {
  var lengthIndex = document.getElementById("length").selectedIndex;
  var length = document.getElementById("length").options[lengthIndex].value;
  var typeIndex = document.getElementById("type").selectedIndex;
  var type = document.getElementById("type").options[typeIndex].value;
  var word = document.getElementById("match").value;
  word = word.replace(/ /g, "_").toLowerCase();
  if (length == "0") {
    window.location = "/what-is/words-" + type + "/" + word + ".html";
  }
  else {
    window.location = "/what-is/" + type + "/" + length + "-letter-words-" + word + ".html";
  }
  return false;
}

function findWordForm(wordFormForm) {
  var wordFormTypeIndex = document.getElementById("wordformtype").selectedIndex;
  var wordFormType = document.getElementById("wordformtype").options[wordFormTypeIndex].value;
  var wordFormWord = document.getElementById("wordformword").value;
  wordFormWord = wordFormWord.replace(/ /g, "_").toLowerCase();
  window.location = "/what-is/the-" + wordFormType + "-of/" + wordFormWord + ".html";
  return false;
}
