function AJAX(url, callback) {

    var req = init();
    req.onreadystatechange = processRequest;
        
    function init() {
      var reqObj = null;
      try {
        reqObj = new XMLHttpRequest();
      } catch(e) {
        try {
          reqObj = new ActiveXObject("Msxml2.XMLHTTP");
        } catch(e) {
          try {
            reqObj = new ActiveXObject("Microsoft.XMLHTTP");
          } catch(e) { }
        }
      }
      return reqObj;
    }
    
    function processRequest () {
      if (req.readyState == 4 && Math.floor(req.status / 100) == 2 && callback) {
        if (req.responseXML != null && req.responseXML.childNodes != null && req.responseXML.childNodes.length > 0)
          callback(req.responseXML);
        else
          callback(req.responseText);
      }
    }

    this.doGet = function() {
      var time = new Date();
      req.open("GET", url + (url.indexOf("?") < 0 ? "?" : "&") + "__t=" + Math.floor(time.getTime() / 100), true);
      req.send(null);
    }
    
    this.doPost = function(params) {
      req.open("POST", url, true);
      req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
      var body = "";
      if (typeof(params) == "string" || params instanceof String) {
        body = params;
      } else {
        for (var key in params) {
          if (body != "")
            body += "&";
          body += key + "=" + escape(params[key]).replace(/\+/, "%2B");
        }
      }
      req.send(body);
    }
}
