function submitSearchForm() {
  sortInput = document.getElementById("sort");
  if (sortInput != null) {
    if (sortInput.value == "none")  {
      sortInput.disabled = true;
    }
  }

  document.forms['searchForm'].submit();
}

function getImgHtml(type_desc) {
  if (type_desc == "jira") {
    imgSrc = "/img/jira.gif";
  } 
  else if (type_desc.indexOf("mail") >= 0) {
    imgSrc = "/img/mail.gif";
  }
  else if (type_desc.indexOf("wiki") >= 0) {
    imgSrc = "/img/wiki.gif";
  }
  else if (type_desc.indexOf("site") >= 0) {
    imgSrc = "/img/site.gif";
  }
  else if (type_desc.indexOf("javadoc") >= 0) {
    imgSrc = "/img/javadoc.gif";
  }
  else if (type_desc.indexOf("code") >= 0) {
    imgSrc = "/img/code.gif";
  }
  else {
    imgSrc = "/img/other.gif";
  }

  imgHtml = "<span><img style='padding-right:2px;width:16px;height:16px;' src='" + imgSrc + "'/></span>";

  return imgHtml;
}

function addEngine(name, ext, cat)
{
  if ((typeof window.sidebar == "object") && (typeof
  window.sidebar.addSearchEngine == "function"))
  {
    //cat="Web";
    //cat=prompt("In what category should this engine be installed?","Web")
    window.sidebar.addSearchEngine(
      siteUrl + "/searchmozplugin.src",
      siteUrl + "/img/" + name + "." + ext,
      name,
      cat);
    return true;
  }
  else
  {
    alert("Sorry, but your browser does not support search plugins.");
    return false;
  }
}
