function judgePopUp(id,type)
{
    var popwin;
    leftval=(screen.width)?(screen.width-650)/2:100;
    topval=(screen.height)?(screen.height-350)/2:100;
    popwin=window.open("http://mycroft.mozdev.org/judge.php?id=" + id + "&table=" + type, "Judge a plugin", "width=650,height=300,top=" + topval + ",left=" + leftval + ",toolbar=0,scrollbars=1,directories=no,location=0,statusbar=0,menubar=0,resizable=0");
    popwin.focus();
}

function addEngine(name,ext,cat,pid)
{
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
    window.sidebar.addSearchEngine(
      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + ".src",
      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + "."+ ext, name, cat );
  } else {
    alert("You will need a browser which supports Sherlock to install this plugin.");
  }
}

function addOpenSearch(name,ext,cat,pid)
{
  if ((typeof window.external == "object") && ((typeof window.external.AddSearchProvider == "unknown") || (typeof window.external.AddSearchProvider == "function"))) {
    window.external.AddSearchProvider(
      "http://mycroft.mozdev.org/installos.php/" + pid + "/" + name + ".xml");
  } else {
    alert("You will need a browser which supports OpenSearch to install this plugin.");
  }
}
