/**
* Construtor da classe de retorno Ajax
* Essa classe tem como objetivo retornar os dados 
* ou erro caso ocorra
*
* @since 07/06/2006
* @author Erix Henrique Morato <emorato@unibh.br>
* @access public
*/
RetornoAjax = function(strMensagemErro,arrRetorno,strRetorno, intTempoInicialAjax, intTempoFinalAjax)
{
	//array com os dados de retorno
	this.arrRetorno = new Array();
	
	if(strMensagemErro!=undefined && strMensagemErro!='')
	{
		this.bolErro = true;
		this.strMsgErro = strMensagemErro;
		this.strMsgErro = trocarTodos(this.strMsgErro, "<BR>", "\n");
	}
	else
	{
		this.bolErro = false;
		this.strMsgErro = '';
		this.strRetorno = strRetorno;		
		this.arrRetorno = arrRetorno;		
	}
	if(intTempoInicialAjax!=undefined)
			this.intTempoInicialAjax  = intTempoInicialAjax;
	if(intTempoFinalAjax!=undefined)
			this.intTempoFinalAjax  = intTempoFinalAjax;			
}

/**
* Metodo que verifica se o erro aconteceu
*
* @since 07/06/2006
* @author Erix Henrique Morato <emorato@unibh.br>
* @access public
*/
RetornoAjax.prototype.getErro = function()
{
	return this.bolErro;
}

/**
* Metodo para retornar a mensagem de erro
*
* @since 07/06/2006
* @author Erix Henrique Morato <emorato@unibh.br>
* @access public
*/
RetornoAjax.prototype.getMsgErro = function()
{
	return this.strMsgErro;
}

/**
* Metodo para retornar o array de retorno
*
* @since 07/06/2006
* @author Erix Henrique Morato <emorato@unibh.br>
* @access public
*/
RetornoAjax.prototype.getArrayRetorno = function()
{
	return this.arrRetorno;
}

/**
* Metodo para retornar o string de retorno
*
* @since 07/06/2006
* @author Erix Henrique Morato <emorato@unibh.br>
* @access public
*/
RetornoAjax.prototype.getStringRetorno = function()
{
	return this.strRetorno;
}

/**
* Metodo para retornar o conteudo da posicao do array
*
* @since 07/06/2006
* @author Erix Henrique Morato <emorato@unibh.br>
* @access public
*/
RetornoAjax.prototype.getArrayItens = function(intPosicao)
{
	return this.arrRetorno[intPosicao];
}


/**
* Metodo para retornar o tempo em milisegundos que o ajax foi retornado
*
* @since 07/06/2006
* @author Erix Henrique Morato <emorato@unibh.br>
* @access public
*/
RetornoAjax.prototype.getTempoInicialAjax = function()
{
	return this.intTempoInicialAjax;
}

/** Metodo para retornar o tempo em milisegundos que o ajax foi retornado
*
* @since 07/06/2006
* @author Erix Henrique Morato <emorato@unibh.br>
* @access public
*/
RetornoAjax.prototype.getTempoFinalAjax = function()
{
	return this.intTempoFinalAjax;
}
