function getVars(){

	var varArray = document.location.href.split('?');
	
	if( varArray[1] != null ){

		varArray = varArray[1].split('&');
		
		for(var x=0; x<varArray.length; x++){
			var tmp = varArray[x].split('=');
			if(tmp[0] != null && tmp[0] != ""){
				eval(unescape(tmp[0]) + '="' + unescape(tmp[1]) + '"');
			}
		}
		
	}
}



// FUNCOES PARA CARREGAR A PAGINA DESEJADA

var respostasURL = [];

var rootPath = "/home/html/pt_br/central_atendimento/respostas/";

respostasURL[0] = rootPath + "resolva_alterar_cadastro.html";
respostasURL[1] = rootPath + "resolva_alterar_senha.html";
respostasURL[2] = rootPath + "resolva_imprimir_boleto.html";
respostasURL[3] = rootPath + "resolva_esqueci_senha.html";
respostasURL[4] = rootPath + "ajuda_sobre_porque_leilao.html";
respostasURL[5] = rootPath + "ajuda_sobre_produto.html";
respostasURL[6] = rootPath + "ajuda_sobre_produto_informacoes.html";
respostasURL[7] = rootPath + "ajuda_sobre_produto_ver.html";
respostasURL[8] = rootPath + "ajuda_sobre_arrematacao.html";
respostasURL[9] = rootPath + "ajuda_sobre_arrematacao_procedimento.html";
respostasURL[10] = rootPath + "ajuda_sobre_arrematacao_condicional.html";
respostasURL[11] = rootPath + "ajuda_sobre_arrematacao_pagamento.html";
respostasURL[12] = rootPath + "ajuda_sobre_arrematacao_nota.html";
respostasURL[13] = rootPath + "ajuda_sobre_arrematacao_nota_sedex.html";
respostasURL[14] = rootPath + "ajuda_sobre_arrematacao_proposta.html";
respostasURL[15] = rootPath + "ajuda_sobre_arrematacao_penalidade.html";
respostasURL[16] = rootPath + "ajuda_first_cadastro.html";
respostasURL[17] = rootPath + "ajuda_first_cadastro_primeira_vez.html";
respostasURL[18] = rootPath + "ajuda_first_cadastro_liberacao.html";
respostasURL[19] = rootPath + "ajuda_first_cadastro_bloqueado.html";
respostasURL[20] = rootPath + "ajuda_first_habilitacao.html";
respostasURL[21] = rootPath + "ajuda_first_habilitacao_definicao.html";
respostasURL[22] = rootPath + "ajuda_first_habilitacao_solicitar.html";
respostasURL[23] = rootPath + "ajuda_first_habilitacao_aceitar.html";
respostasURL[24] = rootPath + "ajuda_first_como_dar_lances.html";
respostasURL[25] = rootPath + "ajuda_faq_leilao.html";
respostasURL[26] = rootPath + "ajuda_faq_fax.html";
respostasURL[27] = rootPath + "ajuda_faq_quem_participa.html";
respostasURL[28] = rootPath + "ajuda_faq_quem_vende.html";
respostasURL[29] = rootPath + "ajuda_faq_lance.html";
respostasURL[30] = rootPath + "ajuda_faq_lance_automatico.html";
respostasURL[31] = rootPath + "ajuda_faq_incremento_minimo.html";
respostasURL[32] = rootPath + "ajuda_faq_ofertar_lance.html";
respostasURL[33] = rootPath + "ajuda_faq_usuario_rejeitado.html";
respostasURL[34] = rootPath + "ajuda_faq_valor_minimo.html";
respostasURL[35] = rootPath + "ajuda_faq_lance_inicial.html";
respostasURL[36] = rootPath + "ajuda_faq_lote.html";
respostasURL[37] = rootPath + "ajuda_faq_lance_condicional.html";
respostasURL[38] = rootPath + "ajuda_faq_recebido_condicionalmente.html";
respostasURL[39] = rootPath + "ajuda_faq_bens_leiloados.html";
respostasURL[40] = rootPath + "ajuda_faq_divulgacao.html";
respostasURL[41] = rootPath + "ajuda_faq_lance_preapregoamento.html";
respostasURL[42] = rootPath + "ajuda_faq_duracao_leilao.html";
respostasURL[43] = rootPath + "ajuda_faq_leilao_empresa.html";
respostasURL[44] = rootPath + "ajuda_faq_lote_fracionado.html";
respostasURL[45] = rootPath + "ajuda_faq_lote_comercial.html";
respostasURL[46] = rootPath + "resolva_alterar_login.html";
respostasURL[47] = rootPath + "ajuda_sobre_arrematacao_fixa_condicional.html";
respostasURL[48] = rootPath + "seguranca.html";



function carregaRespostaPorGetOnLoad(){
	
	//alert("teste!!!!");
	
	// inicializa variavel para evitar erro de js
	//var respostaGet = document.location.href.split('?')[1];
	//var respostaDaResposta = respostaGet.split('=')[1];
	
	//alert("resposta da resposta: " + respostaDaResposta);
	
	// cria variaveis via get
	//var resp = null; ESTE CARA QUE É PARA MUDAR< POIS DA UM ERRO!!!
	getVars();
	
	// se existir um variavel get respostaGet chama via ajax.
	if( resp != null && resp != undefined ){
		//alert("resposta: " + resp);
		carregaRespostaAjax(resp);
	}else{
	// se nao, carrega a primeira resposta
		//alert("respostaGet 02: " + respostaGet);

		carregaRespostaAjax(0);

	}

}


function carregaRespostaAjax(resp){
	//alert("entrou na função carregaRespostaAjax");
	// pega a url da matriz
	var urlDessaResposta = respostasURL[resp];
	//alert(respostasURL[resp]);
	
	// chama funcao ajax passando a url
	ajaxpage( urlDessaResposta , 'respostas');
	//alert(urlDessaResposta);
	
}

