function XMLHTTPWrapper() {
	
	this.http = getHTTPObject(); // We create the HTTP Object
	this.isWorking = false;

	function callURL(url, callbackFunction, callbackParameter, isPost, postData) {

		var myHttp = this.http;
		var myIsWorking = this.isWorking;
		
		var sendData = null;
		if(isPost) {

			sendData = "";
			for(var key in postData) {
				if(sendData != "") {
					sendData += "&";
				}
				sendData += key + "=" + encode(postData[key]);
			}
		}

		if (!this.isWorking && this.http) {	

			if(isPost) {
				this.http.open("POST", url, true);
				this.http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				this.http.setRequestHeader("Content-Length", sendData.length);
			} else {
				this.http.open("GET", url, true);
			}
			
			this.http.onreadystatechange = function () {
					if (myHttp.readyState == 4) {
						if(myHttp) {
							if (myHttp.status == 200) {						
								if (callbackFunction!=null) {
									callbackFunction(myHttp.responseText, callbackParameter);								
								}
								myIsWorking = false;
							}
						}
					}
				}
			this.isWorking = true;
			this.http.send(sendData);
		}

		return;
	}	
	this.callURL = callURL;
	
	function getHTTPObject() {
	  var xmlhttp;
	  /*@cc_on
	  @if (@_jscript_version >= 5)
	    try {
	      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	    } catch (e) {
	      try {
	        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	      } catch (E) {
	        xmlhttp = false;
	      }
	    }
	  @else
	  xmlhttp = false;
	  @end @*/
	  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	    try {
	      xmlhttp = new XMLHttpRequest();
	    } catch (e) {
	      xmlhttp = false;
	    }
	  }
	  return xmlhttp;
	}

	/*
	 * Codifica caracteres para serem enviados na requisi??o (url encode)
	 */
	function encode(str) {
		var result = str.replace(/\s/g, "+");
		result = encodeURI(result);
		return escape(result);
	}

	/*
	 * Decodifica (url encode)
	 */
	function decode(str) {
	 	var result = str.replace(/\+/g, " ");
	 	result = decodeURI(result);
		return unescape(result);
	}

}