var ua=navigator.userAgent.toLowerCase();
var gecko=false;
var webkit=false;
if (ua.indexOf("gecko")>0) gecko=true;
if (ua.indexOf("webkit")>0) webkit=true;

function load(url,callback) {
  var xmlhttp;   
  if (gecko) {
    xmlhttp=new XMLHttpRequest();
    xmlhttp.callback=callback;
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4) {
        xmlhttp.onreadystatechange=null;
        xmlhttp.callback(xmlhttp.responseXML.documentElement);
      }
    }
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
  } else {
    xmlhttp=new ActiveXObject("Microsoft.XMLDOM");
    xmlhttp.async="true";  
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4) {
        xmlhttp.onreadystatechange=function() {};
        callback(xmlhttp.documentElement);
      }
    }
    xmlhttp.load(url);
  }
  delete xmlhttp;
}
function text(node) {  
  if (!node) return "";
  if (gecko) return node.textContent;
  else return node.text;
}
