
	//Deinindo o namespace
	if(typeof(util)=='undefined'){
		var util = {ajax:{}}
	}else{
		util.ajax = {}
	}

	util.ajax.AjaxModel = function(options){
		/*
		ATENÇÃO!!!   ESTE OBJETO REQUER A JQUERY E O PLUGIN JQUERY-JSON (http://code.google.com/p/jquery-json) PARA FUNCIONAR
		*/
		this.cache = {};
		this.jsonResposta;
		this.settings = {};
		this.defaults = {
			metodo : 'post', // valores possíveis: post | get
			async  : false,  // valores possíveis: true | false
			cache  : true,   // valores possíveis: true | false
			url    : '',     // url a ser chamada por este objeto
			caller : ''      // nome da instância deste objeto
		};
		// Definindo as configurações do objeto conforme as definições passadas
		jQuery.extend(this.settings, this.defaults, options);
	}
	util.ajax.AjaxModel.prototype.get = function(jsonParametros){
		// jQuery.toJSON é um método disponibilizado pelo plugin jQuery.JSON
		assinaturaCache = jQuery.toJSON(jsonParametros);
		// Para gerar a assinatura da solicitação eu uso os parametros passados na requisição
		// Para isso eu converto o JSON para o formato string e "limpo" a string resultante usando o replace
		// "{"nome":"Bruno", sexo:"M", idade:"29"}" « deste para este » "nomeBrunosexoMidade29"
		assinaturaCache = assinaturaCache.replace(/["/{/}: ,]/gi, ''); 

		var respostaDoAjax;

		if(typeof(fb)!='undefined'){
			if(fb.habilitado==true){
				if(typeof(console)!='undefined'){
					console.groupCollapsed(this.settings.caller+'.get()');
						console.log('parâmetro passados: '+jq.toJSON(jsonParametros));
				}
			}
		}else{
			if(typeof(console)!='undefined'){
				console.groupCollapsed(this.settings.caller+'.get()');
					console.log('parâmetro passados: '+jq.toJSON(jsonParametros));
			}
		}

		var parametrosAjax = {
			type     : this.settings.metodo,
			url      : this.settings.url,
			async    : this.settings.async,
			data     : jsonParametros,
			dataType : 'json',
			success: function(jsonResposta){
				respostaDoAjax = ({status:'ok', json:jsonResposta});
				estaInstancia.cache[assinaturaCache] = respostaDoAjax;
			},
			error: function(erroMsg){
				respostaDoAjax = ({status:'erro', json:null, erro:erroMsg});
			}
		}

		if(this.settings.cache==true){
			if(typeof(this.cache[assinaturaCache])=='undefined'){
				var estaInstancia = this;
				jQuery.ajax(parametrosAjax);
			}else{
				respostaDoAjax = this.cache[assinaturaCache];
				if(typeof(console)!='undefined')console.log('Resultado buscado diretamente do cache');
			}
		}else{
			jQuery.ajax(parametrosAjax);
		}

		if(typeof(fb)!='undefined'){
			if(fb.habilitado==true){				
				if(typeof(console)!='undefined'){
						console.groupCollapsed('JSON Resposta');
							console.dir(respostaDoAjax);
						console.groupEnd();
					console.groupEnd();
				}
			}
		}else{
			if(typeof(console)!='undefined'){
					console.groupCollapsed('JSON Resposta');
						console.dir(respostaDoAjax);
					console.groupEnd();
				console.groupEnd();
			}
		}

		return respostaDoAjax;
	};