function AJAXInteraction(url, callback) {

    async = true;
    if (!callback) async = false;
    var req = init();
    if (async) req.onreadystatechange = processRequest;
        
    function init() {
      if (window.XMLHttpRequest) {
        return new XMLHttpRequest();
      } else if (window.ActiveXObject) {
        return new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
    
    function processRequest () {
      if (req.readyState == 4) {
        if (req.status == 200) {
          if (callback) callback(req.responseXML);
        }
      }
    }

    this.doGet = function() {
      req.open("GET", url, async);
      req.send(null);
      if (!async) return req.responseXML;
    }
    
    this.doPost = function(body) {
      req.open("POST", url, async);
      req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
      req.send(body);
      if (!async) return req.responseText;
    }
}
