function opcaoBuscaSimples(tipo, campo) { 
	// pega o select secao
	var select_ = document.getElementById(campo);
	
	// limpa o resultado anterior
	if (select_.options.length>1)
		select_.options.length=1;
	
	// desabilita o campo até que termine a requisicao
	select_.options[0].text="Aguarde...";
	select_.disabled=true;

  // se o tipo for inválido	
  if (tipo <= 0) {
  	select_.options[0].text="Selecione";
  	select_.disabled=false;
  	return;
  }
   
  $.ajax({
		type: "GET",
    url: 'classif_buscaImoveisSimples.xml.php/'+tipo,
		dataType: 'xml',
		success: function(xml){
		
			// ativa o campo novamente
			select_.options[0].text="Selecione";
			select_.disabled=false;	 
      	
			// percorre-os, criando linhas e colunas
      var i = 1;
			$(xml).find('secao').each(function(e) {
				select_.options[i] = new Option( $(this).find('nome').text() , $(this).find('codigo').text() );
				i++;
			});
      select_.options[0].text="Selecione";
      select_.disabled=false;
		}
	});
}

function ativarIndexador(secao, campo) {
	// pega o select campo
	var select_ = document.getElementById(campo);
	
	// não tem indexador
	if (secao > 2999 || secao < 2000) {
  	//select_.options[0].text="Subseção";
  	//select_.disabled=true;
  	select_.style.display='none';
    return;
	} else {
    select_.style.display='inline';
  }
	
	// limpa o resultado anterior
	if (select_.options.length>1)
		select_.options.length=1;
	
	// desabilita o campo até que termine a requisicao
	select_.options[0].text="Aguarde...";
	select_.disabled=true;
	
	  $.ajax({
		type: "GET",
  	url: 'classif_ativarIndexador.xml.php/'+secao,
		dataType: 'xml',
		success: function(xml){
		
			// ativa o campo novamente
			select_.options[0].text="Selecione";
			select_.disabled=false;	 
      	
			// percorre-os, criando linhas e colunas
			var i = 1;
			$(xml).find('indexador').each(function(e) {
				select_.options[i] = new Option( $(this).find('NOME').text() , $(this).find('NOME').text() );
				i++;
			});
      select_.options[0].text="Selecione";
      select_.disabled=false;
		}
	});
}