function createXMLHttpRequest() {
  var xmlhttp;

  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = new XMLHttpRequest();
    };
  };

  return {
    xmlhttp: xmlhttp,
    readyState: 0,
    responseXML: null,
    responseText: "",
    onsuccess: null,

    onreadystatechange: function() {
    },

    open: function(method, url, mode) { 
      var obj = this;

      this.xmlhttp.onreadystatechange = function () {
        obj.readyState = obj.xmlhttp.readyState;

        if (obj.xmlhttp.readyState == 4) {
          obj.responseXML  = obj.xmlhttp.responseXML;
          obj.responseText = obj.xmlhttp.responseText;
          if (obj.onsuccess) { obj.onsuccess(); };
        };

        obj.onreadystatechange();
      };

      var ts = new Date;
      if (url.indexOf('?') == -1) {
        url = url + "?_ts=" + ts.getTime();
      } else {
        url = url + "&_ts=" + ts.getTime();
      };
      this.xmlhttp.open(method, url, mode);
    },

    send: function(data) {
      this.xmlhttp.send(data);
    }
  } 
};
