function ajaxManager()
{
	this.getError = function(errorCode, errorMessage)
	{
		LOG.fatal(errorMessage);		
		return {
			code	:	errorCode,
			message	:	errorMessage
		}
	}
	this.throwException = function(error, throwArguments)
	{
		LOG.fatal("Excessao encontrada:");		
		LOG.fatal(error);		
	}
	this.getXmlHttp = function(){
		var xmlHttp = null;
		try {
			xmlHttp = new XMLHttpRequest();
		} catch (e) {
			var progIds = ['MSXML2.XMLHTTP', 'Microsoft.XMLHTTP', 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0'];
			var success = false;
			for (var iterator = 0; (iterator < progIds.length) && ( ! success); iterator ++) {
				try {
					xmlHttp = new ActiveXObject(progIds[iterator]);
					success = true;
				} catch (e) {}
			}
			if ( ! success ) {
				return null;
			}
		}
		return xmlHttp;
	},
	this.call=function(url, object, callback )
	{
		var xmlHttp = this.getXmlHttp();
		if(typeof(object) == "undefined"){
			return this.throwException("invalid progress bar object", [progressBar]);
		}
		if(typeof(url) == "undefined"){
			LOG.error("URL not found to rpccall.");
			this.throwException("URL not found to rpccall.");
			return false;
		}
		var _url = url;
		LOG.info("Calling URL:");
		LOG.info(_url);		
		xmlHttp.open('GET', _url, true);
		
		var requestCompleted = function() {
			if (xmlHttp.status != 200) {
				LOG.error("XMLResponse: Error - " + xmlHttp.status);
				//return this.throwException(xmlHttp.status+ xmlHttp.statusText, [object, callback]);
	
			} else {
				if (xmlHttp.responseText == null) {
					LOG.error("XMLResponse: Error - responseText = null");
					//return this.throwException(xmlHttp.status+ 'Empty response.', [progressbar, method]);
				}
	
				if (xmlHttp.responseText.length < 1) {
					LOG.error("XMLResponse: Error - responseText.length < 1");
					//return this.throwException(xmlHttp.status+'Empty response.', [progressbar, method]);
				}
				return xmlHttp.responseText;
			};
		}
		xmlHttp.setRequestHeader('Content-Length', url.length);
		xmlHttp.setRequestHeader('Content-Type', 'text/plain; charset=UTF-8');
		xmlHttp.setRequestHeader('Accept-Charset', 'UTF-8');

		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState == 4) {
				var response = requestCompleted();
				if (typeof(response) != 'undefined') {
					LOG.info("Executing the callback message ");
					LOG.info("object."+ callback + "(response)");					
					eval("object."+ callback + "(response)");
				}
			}
		}
		xmlHttp.send("");
	}
};









