just.ajax = function(obj) {
	this.obj = obj;
	this.xmlHttp = null;
	this.async = true;
	this.resetData = function() {
		this.method = "POST";
		this.async = true;
		this.parametersString = "";		
		this.requestProcessor = "";
		this.elementObj = null;
		this.isJavascriptCommand = false;
		this.parameter = new Array();
  	}
	
	this.createXmlHttp = function() {
		this.xmlHttp = just.util.createXMLhttpRequestObject();	
	}
	
	this.resetFunction = function(func) {
  		eval("this."+func+" = function() { };");
	} // resetFunction
	
	this.setParameter = function(parameter, value) {
		this.parameter[this.parameter.length] = parameter + "|*|" + value;
	} // setParameter
	
	this.encodeParameters = function() {
		var par;
		for (i = 0; i < this.parameter.length; i++){
			par = this.parameter[i].split("|*|");
			this.parametersString += "&" + encodeURIComponent(par[0]) + "=" + encodeURIComponent(par[1]);
		}
	} // encodeParameters
	
	this.runXmlHttp = function() {
		if (this.xmlHttp) {
			var _this = this;
			this.xmlHttp.abort();
			this.xmlHttp.onreadystatechange = function() { _this.processRequest() }
			this.xmlHttp.open(this.method, this.requestProcessor, this.async);
			if (this.method == "POST") {						
				try {
					this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
					this.xmlHttp.setRequestHeader("Charset", "ISO-8859-1");
					this.xmlHttp.setRequestHeader("Content-length",this.parameter.length);			
					this.xmlHttp.send(this.parametersString);
				} catch (e) { }				
			}
			if (this.method == "GET") {			
				try {					
					this.xmlHttp.send(null); 
				} catch (e) { }
			}			
		} // if		
	} // function runXmlHttp
	
	this.processRequest = function() {
		switch (this.xmlHttp.readyState) {
			case 1:
				this.onLoading();				
				break;
			case 2:				
				this.onLoaded();
				break;
			case 3:				
				this.onInteractive();
				break;
			case 4:				
				if (this.xmlHttp.status == 200) {					
					this.onComplete();
				} else {					
					//this.onError();
				}
				break;
		} // switch
	} // function processRequest
	
	this.onLoading = function() {}	
	
	this.onLoaded = function() {}	
	
	this.onInteractive = function() {}	
	
	this.onComplete = function() {	
		if (this.elementObj) {
			this.elementObj.innerHTML = replaceNL(this.xmlHttp.responseText);
		}
		if (this.isJavascriptCommand) {
			try {eval(this.xmlHttp.responseText);}
			catch(e) {				
				alert("Runtime error [eval(this.xmlHttp.responseText)] encountered.\n"+e.description);
			}
		}
	} // function onCompletion

	this.parseXML = function(xmlSource, xslStylesheet, place) {
		if (IS_MOZ) {
			var xsltProcessor = new XSLTProcessor();
			xsltProcessor.importStylesheet(xslStylesheet);
			var resultDocument = xsltProcessor.transformToFragment(xmlSource, document);
			for (i=0;i<resultDocument.childNodes.length;i++) {
				// * UTILIZADO PARA CONVERTER OS VALORES NOS DESCRITIVOS DE PRODUTOS * //
				conteudo=resultDocument.childNodes[i].getElementsByTagName("td")
				for(var x=0;x<conteudo.length;x++)
					if(conteudo[x].className=="productDescription") {
						var aux = conteudo[x].innerHTML;
						aux = aux.replace(/&nbsp;/gi, " ");
						aux = aux.replace(/&amp;/gi, "&");
						aux = aux.replace(/&apos;/gi, "'");
						aux = aux.replace(/&lt;/gi, "<");
						aux = aux.replace(/&gt;/gi, ">");
						conteudo[x].innerHTML = aux;
					}
			}
			place.innerHTML = "";
			place.appendChild(resultDocument);
		}
		if (IS_IE) {
			place.innerHTML = xmlSource.transformNode(xslStylesheet);
		}
	} // function parseXML

	this.resetData();
	this.createXmlHttp();
	
}