var objXmlHttp;
var fId;
function processAJAX(url,id,bust,dflt) //{{{
{
  fId = id;
  document.getElementById(fId).style.display = '';
  if (url.length > 0) {
    if (dflt.length > 0) {
      document.getElementById(fId).innerHTML = dflt;
    }
    if (bust) {
      if (url.indexOf("?") == -1) {
        url+="?ajaxusid="+Math.random();
      }
      else {
        url+="&ajaxusid="+Math.random();
      }
    }
    objXmlHttp = false;
    if (window.XMLHttpRequest) {
      try { objXmlHttp= new XMLHttpRequest(); }
      catch(e) { objXmlHttp = false; }
    }
    else if (window.ActiveXObject) {
      try { objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
      catch(e) {
        try { objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
        catch(e) { objXmlHttp = false; }
      }
    }
    if (!objXmlHttp) {
      alert("Error. Scripting for ActiveX might be disabled");
    }
    else {
      objXmlHttp.onreadystatechange = processReqChange;
      objXmlHttp.open("GET", url , true);
      objXmlHttp.send(null);
    }
  }
  else {
    document.getElementById(fId).innerHTML = "";
  }
}
//}}}
function processReqChange() //{{{
{
  if (objXmlHttp.readyState == 4) {
    if (objXmlHttp.status == 200) {
      document.getElementById(fId).innerHTML = objXmlHttp.responseText;
    } else {
      document.getElementById(fId).innerHTML = "There was a problem retrieving the XML data:\n" + objXmlHttp.statusText;
    }
  }
}
//}}}
function clrCat(cat) //{{{
{
  cVal = cat;
  c = document.getElementById("sCat");
  if (c.value == cVal) {
    c.disabled = true;
  }
}
//}}}
function maxLen(obj,len) //{{{
{
  if (obj.value.length > len) {
    obj.value = obj.value.substring(0,len);
  }
}
//}}}
function checkAll(field) //{{{
{
  if (typeof(field.length) == "undefined") {
    field.checked = true;
  }
  else {
    for (i=0; i<field.length; i++) {
      field[i].checked = true ;
    }
  }
}
//}}}
function uncheckAll(field) //{{{
{
  if (typeof(field.length) == "undefined") {
    field.checked = false;
  }
  else {
    for (i = 0; i < field.length; i++) {
      field[i].checked = false ;
    }
  }
}
//}}}
function show(id,tf) //{{{
{
  if (tf == true) {
    id.style.display = "block";
  }
  if (tf == false) {
    id.style.display = "none";
  }
}
//}}}
function showImg(id,src,tf) //{{{
{
  fId = id;
  if (tf == true) {
    document.getElementById(fId).style.display = "inline";
    document.getElementById(fId).innerHTML = "<img src=\"" + src + "\" alt=\"\" border=0 style=\"border:2px #800 solid;\">";
  }
  if (tf == false) {
    document.getElementById(fId).style.display = "none";
    document.getElementById(fId).innerHTML = "";
  }
}
//}}}
function showAlt(id,txt) //{{{
{
  fId = id;
  document.getElementById(fId).alt = txt;
}
//}}}
function onlyIn() //{{{
{
  document.getElementById("onlyin").style.display = (document.getElementById("sCat").value == "galaxy") ? "inline" : "none";
}
//}}}
