function judgePopUp(id,type)
{
    var leftval=(screen.width)?(screen.width-650)/2:100;
    var topval=(screen.height)?(screen.height-350)/2:100;
    var popwin=window.open("http://mycroft.mozdev.org/judge.php?id=" + id + "&table=" + type, "JudgePopup", "width=650,height=300,top=" + topval + ",left=" + leftval + ",toolbar=0,scrollbars=no,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,meth)
{
  if ((typeof window.external == "object") && ((typeof window.external.AddSearchProvider == "unknown") || (typeof window.external.AddSearchProvider == "function"))) {
    if ((typeof window.external.AddSearchProvider == "unknown") && meth == "p") {
      alert("This plugin uses POST which is not currently supported by Internet Explorer's implementation of OpenSearch.");
    } else {
      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.");
  }
}

