function AJAXInteraction(url, callback, responseType) {

    var req = init();
    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){
			if(responseType && 'text' == responseType){
				callback(req.responseText);	
			}else{				
				callback(req.responseXML);
			}
		  }
        }
      }
    }



    this.doGet = function() {
      req.open("GET", url, true);
      req.send(null);
    }

    

    this.doPost = function(body) {
      req.open("POST", url, true);
      req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
      req.send(body);
    }

}

/*

function makeRequest() {

  var ai = new AJAXInteraction("processme", function() { alert("Doing Post Process");});

  ai.doGet();

}

*/