
// Ajax stuff
// Made up by me: ph33r my intense cleverness!

// The user has entered some new data
function ajax0_senddata(xferid,cgistem,dataid) {
  document.getElementById(xferid).src = cgistem+escape(document.getElementById(dataid).value);
  document.getElementById(dataid).value='';
  return false;
}
// Some new data has arrived from the server
function ajax0_gotdata(iFrame,dataid) {
  var doc;
  if (iFrame.contentWindow) {            // Browser inconsistencies!
    doc = iFrame.contentWindow.document;
  } else if (iFrame.document) {
    doc = iFrame.document;
  } else {
    doc = iFrame.contentDocument;
  }
  document.getElementById(dataid).innerHTML = ajax0_finddata(doc.documentElement.innerHTML);
}
// Find the real data in whatever came down
function ajax0_finddata(s) {
  var start = s.indexOf('^');
  if (start>-1) s = s.substr(start+1);
  var end = s.lastIndexOf('^');
  if (end>-1) s = s.substr(0,end);
  return s;
}
// Reveal one element and hide another
function ajax0_showhide(showid,showdisplay,hideid,focusid) {
  document.getElementById(showid).style.display = showdisplay;
  if (focusid!=null) document.getElementById(focusid).focus();
  document.getElementById(hideid).style.display = "none";
  return false;
}

