function ValidarPesquisa(theForm)
{

  if (theForm.operacao.selectedIndex == "")
  {
    alert("Selecione uma operação");
    theForm.operacao.focus();
    return (false);
  }

  if (theForm.tipo.selectedIndex  == "")
  {
    alert("Selecione o tipo");
    theForm.tipo.focus();
    return (false);
  }

  if (theForm.finalidade.selectedIndex  == "")
  {
    alert("Selecione uma finalidade");
    theForm.finalidade.focus();
    return (false);
  }

  if (theForm.valorminimo.value == "")
  {
    alert("Digite o valor mínimo");
    theForm.valorminimo.focus();
    return (false);
  }

  if (theForm.valorminimo.value.length < 6)
  {
    alert("Digite um valor mínimo acima de R$ 100,00");
    theForm.valorminimo.focus();
    return (false);
  }

  if (theForm.valormaximo.value == "")
  {
    alert("Digite o valor máximo");
    theForm.valormaximo.focus();
    return (false);
  }

  if (theForm.valormaximo.value.length < 6)
  {
    alert("Digite um valor máximo acima de R$ 100,00");
    theForm.valormaximo.focus();
    return (false);
  }

	var valorminimoa = theForm.valorminimo.value;
	var valormaximoa = theForm.valormaximo.value;

	var valorminimob = valorminimoa.replace(".","");
	var valormaximob = valormaximoa.replace(".","");

	var valorminimoc = valorminimob.replace(",","");
	var valormaximoc = valormaximob.replace(",","");

	var valorminimo = parseFloat(valorminimoc.replace(".",""));
	var valormaximo = parseFloat(valormaximoc.replace(".",""));

  if (valormaximo <= valorminimo)
  {
    alert("O valor máximo deve ser maior que o valor mínimo");
    theForm.valormaximo.focus();
    return (false);
  }

  if (theForm.uf.selectedIndex == "")
  {
    alert("Escolha um estado");
    theForm.uf.focus();
    return (false);
  }

  if (theForm.cidade.selectedIndex == "")
  {
    alert("Escolha uma cidade");
    theForm.cidade.focus();
    return (false);
  }
  return (true);
}
