var rpc;
var ua=navigator.userAgent.toLowerCase();
var gecko=false;
if (ua.indexOf("gecko")>0) gecko=true;

if (gecko) {
  rpc=new XMLHttpRequest();
} else {
  rpc=new ActiveXObject("Microsoft.XMLDOM");
  rpc.async="false";
}
function rpcget(url) {
  if (gecko) {
    rpc.open("GET",url,false);
    rpc.send(null);
    return rpc.responseXML.documentElement;
  } else {
    rpc.load(url);
    return rpc.documentElement;
  }
}
function urlget(url) {
  if (gecko) {
    rpc.open("GET",url,false);
    rpc.send(null);
    return rpc.responseText;
  } else {
    rpc.load(url);
    return rpc.responseText;
  }
}
function getText(node) {
  if (gecko) return node.textContent; else return node.text;
}
function clearChildren(node) {
  if (gecko) while (node.hasChildNodes()) { node.removeChild(node.lastChild); }
  else for (var i=node.children.length-1; i>=0; i--) { node.removeChild(node.children(i)); }
}
