function asyncRequest(uri, callback, post) {
  try {
    this.xhr = new XMLHttpRequest();
  } catch(e) {
    var msxml = ['MSXML2.XMLHTTP.5.0', 
                 'MSXML2.XMLHTTP.4.0', 
                 'MSXML2.XMLHTTP.3.0', 
                 'MSXML2.XMLHTTP', 
                 'Microsoft.XMLHTTP'];
    for (var i = 0; i < msxml.length; i++) {
      try {
        this.xhr = new ActiveXObject(msxml[i]);
        break;
      } catch(e) {}
    }
  }
  this.xhr.open((post ? "POST" : "GET"), uri, true);
  this.xhr.setRequestHeader('User-Agent','XMLHTTP/1.0');
	if (post) this.xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
  var self = this;
  this.xhr.onreadystatechange = function(){self.handleReadyState(callback);}
  this.xhr.send(post || null);
}
asyncRequest.prototype = new Object();
asyncRequest.prototype.handleReadyState = function(_callback) {
  if(this.xhr.readyState == 4) {
    if (this.xhr.status == 200 || this.xhr.status == 0) {
      if (_callback) _callback(this.xhr);
    } else {
      //this.handleError();
    }
  }
}
asyncRequest.prototype.handleError = function() {
  var error = "ERROR " + this.xhr.status + ":\n" + this.xhr.statusText + "\nHEADERS:\n" + this.xhr.getAllResponseHeaders();
  if (console.log) {
    console.log(error);
  } else {
    alert(error);
  }
}
