function getobj(id) {
  return document.getElementById ?
             document.getElementById(id) :
             document.all[id];
}

function xmlhttpreq() {
  if (window.XMLHttpRequest) {
    xmlhttpobj = new XMLHttpRequest()
  } else {
    try {
      xmlhttpobj = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttpobj = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        xmlhttpobj = null;
      }
    }
  }
  return xmlhttpobj;
}

function doreq(url,orsc) {
  var req = xmlhttpreq();
  req.open("GET", url, true);
  req.onreadystatechange = (function(r,e){return function() {
  if(r.readyState==4&&r.status&&r.status==200)e(r);
  }})(req,orsc);
  req.send("");
}

function add(parent, tag, attr) {
  var el = document.createElement(tag);
  if (attr) {
    for (key in attr) {
      el[key] = attr[key];
    }
  }
  return parent.appendChild(el);
}
