function verificar() {
with(document.formulario)
{	
if (CORRETOR.value == "")
{
alert("Informe o CORRETOR!");
CORRETOR.focus();
return false;}
if (ALUGUEL.value == "")
{
alert("Informe o valor do ALUGUEL PRETENDIDO!");
ALUGUEL.focus();
return false;}
if (IMOVEL.value == "")
{
alert("Informe o ENDEREÇO DO IMÓVEL!");
IMOVEL.focus();
return false;}
if (NUMERO_DO_IMOVEL.value == "")
{
alert("Informe o NÚMERO DO IMÓVEL!");
NUMERO_DO_IMOVEL.focus();
return false;}
if (NOME.value == "")
{
alert("Preencha o campo NOME!");
NOME.focus();
return false;}
if (NASCIMENTO.value == "")
{
alert("Preencha a DATA DE NASCIMENTO!");
NASCIMENTO.focus();
return false;}
if (PAI.value == "")
{
alert("Preencha a FILIAÇÃO 'PAI'!");
PAI.focus();
return false;}
if (MAE.value == "")
{
alert("Preencha a FILIAÇÃO 'MÃE'!");
MAE.focus();
return false;}
if (NATURAL.value == "")
{
alert("Preencha a NATURALIDADE!");
NATURAL.focus();
return false;}
if (ESCOLARIDADE.value == "")
{
alert("Informe o GRAU DE INSTRUÇÃO!");
ESCOLARIDADE.focus();
return false;}
if (PROFISSAO.value == "")
{
alert("Informe a PROFISSÃO!");
PROFISSAO.focus();
return false;}
if (RG.value == "")
{
alert("Informe o NÚMERO DO RG!");
RG.focus();
return false;}
if (EMISSOR.value == "")
{
alert("Informe o ESTADO EMISSOR DO SEU RG!");
EMISSOR.focus();
return false;}
if (CPF.value == "")
{
alert("Informe o NÚMERO DO SEU CPF!");
CPF.focus();
return false;}
if (FONE_RES.value == "")
{
alert("Informe o seu TELEFÔNE RESIDENCIAL!");
FONE_RES.focus();
return false;}
if (CELULAR.value == "")
{
alert("Informe o seu TELEFÔNE CELULAR!");
CELULAR.focus();
return false;}
if (Email.value == "")
{
alert("Informe o seu EMAIL!");
Email.focus();
return false;}
if (RENDA.value == "")
{
alert("Informe a sua RENDA MENSAL!");
RENDA.focus();
return false;}
if (ENDEREÇO.value == "")
{
alert("Informe o seu ENDEREÇO ATUAL!");
ENDEREÇO.focus();
return false;}
if (NUMERO.value == "")
{
alert("Informe o NÚMERO DO SEU ENDEREÇO ATUAL!");
NUMERO.focus();
return false;}
if (BAIRRO.value == "")
{
alert("Informe o BAIRRO DO SEU ENDEREÇO ATUAL!");
BAIRRO.focus();
return false;}
if (CIDADE.value == "")
{
alert("Informe a CIDADE DO SEU ENDEREÇO ATUAL!");
CIDADE.focus();
return false;}
if (ESTADO.value == "")
{
alert("Informe em QUAL ESTADO SE LOCALIZAO SEU ENDEREÇO ATUAL!");
ESTADO.focus();
return false;}
if (QUANTO_TEMPO_MORA.value == "")
{
alert("Informe a QUANTO TEMPO MORA DO IMÓVEL!");
QUANTO_TEMPO_MORA.focus();
return false;}
if (ALUGADA.value == "")
{
alert("Informe se o seu IMÓVEL É ALUGADO!");
ALUGADA.focus();
return false;}
if (MOTIVO_DA_LOCAÇAO.value == "")
{
alert("Informe QUAL O MOTIVO DA LOCAÇÃO!");
MOTIVO_DA_LOCAÇAO.focus();
return false;}
if (NOME_EMPRESA.value == "")
{
alert("Informe o NOME DA EMPRESA!");
NOME_EMPRESA.focus();
return false;}
if (NOME_EMPRESA.value == "")
{
alert("Informe o RAMO DE ATIVIDADE DA EMPRESA!");
NOME_EMPRESA.focus();
return false;}
if (RETIRADA.value == "")
{
alert("Informe sua RETIRADA MENSAL!");
RETIRADA.focus();
return false;}
if (ENDEREÇO_EMPRESA.value == "")
{
alert("Informe o ENDEREÇO DA EMPRESA!");
ENDEREÇO_EMPRESA.focus();
return false;}

if (NUMERO_EMPRESA.value == "")
{
alert("Informe o NÚMERO DO IMÓVEL ONDE SE LOCALIZA A EMPRESA!");
NUMERO_EMPRESA.focus();
return false;}
if (BAIRRO_EMPRESA.value == "")
{
alert("Informe o BAIRRO ONDE SE LOCALIZA A EMPRESA!");
BAIRRO_EMPRESA.focus();
return false;}
if (CIDADE_EMPRESA.value == "")
{
alert("Informe a CIDADE ONDE SE LOCALIZA A EMPRESA!");
CIDADE_EMPRESA.focus();
return false;}
if (ESTADO_EMPRESA.value == "")
{
alert("Informe o ESTADO ONDE SE LOCALIZA A EMPRESA!");
ESTADO_EMPRESA.focus();
return false;}
if (FONE_EMPRESA.value == "")
{
alert("Informe o seu TELEFONE COMERCIAL!");
FONE_EMPRESA.focus();
return false;}
if (CARGO.value == "")
{
alert("Informe o seu CARGO NA EMPRESA!");
CARGO.focus();
return false;}
if (ADMISSÃO.value == "")
{
alert("Informe a DATA DE SUA ADMISSÃO!");
ADMISSÃO.focus();
return false;}

if (NOME_1.value == "")
{
alert("Informe o NOME DE UMA PESSOA QUE POSSA NOS DAR REFERÊNCIAS SUAS!");
NOME_1.focus();
return false;}
if (FONE_1.value == "")
{
alert("Informe o NÚMERO DE TELEFÔNE PARA REFERÊNCIAS!");
FONE_1.focus();
return false;}
if (PARENTESCO_1.value == "")
{
alert("Informe o GRAU DE PARENTESCO");
PARENTESCO_1.focus();
return false;}
if (NOME_2.value == "")
{
alert("Informe o NOME DE UMA SEGUNDA PESSOA QUE POSSA NOS DAR REFERÊNCIAS SUAS!");
NOME_2.focus();
return false;}
if (FONE_3.value == "")
{
alert("Informe o NÚMERO DE TELEFÔNE PARA REFERÊNCIAS!");
FONE_3.focus();
return false;}
if (PARENTESCO_2.value == "")
{
alert("Informe o GRAU DE PARENTESCO");
PARENTESCO_2.focus();
return false;}

/* DESATIVADO - VALIDAÇÃO DOS DADOS DO IMÓVEL DO FIADOR

if (ENDEREÇO_IMOVEL.value == "")
{
alert("Informe o Endereço do IMÓVEL DE SUA PROPRIEDADE");
ENDEREÇO_IMOVEL.focus();
return false;}
if (NUMERO_IMOVEL.value == "")
{
alert("Informe o Número do IMÓVEL DE SUA PROPRIEDADE");
NUMERO_IMOVEL.focus();
return false;}
if (BAIRRO_IMOVEL.value == "")
{
alert("Informe o Bairro do IMÓVEL DE SUA PROPRIEDADE");
BAIRRO_IMOVEL.focus();
return false;}
if (CIDADE_IMOVEL.value == "")
{
alert("Informe a Cidade do IMÓVEL DE SUA PROPRIEDADE");
CIDADE_IMOVEL.focus();
return false;}
if (ESTADO_IMOVEL.value == "")
{
alert("Informe o Estado do IMÓVEL DE SUA PROPRIEDADE");
ESTADO_IMOVEL.focus();
return false;}
if (MATRICULA.value == "")
{
alert("Informe o número da MATRÍCULA DO IMÓVEL DE SUA PROPRIEDADE");
MATRICULA.focus();
return false;}*/


submit();
}
}	

/* LIMPAR CAMPO */

function limpa_PAI() {
if (document.formulario.PAI.value == "Pai") 
{
document.formulario.PAI.value = "";
}
}
function preenche_PAI() {
if (document.formulario.PAI.value == "") 
{
document.formulario.PAI.value = "Pai";
document.formulario.PAI.style.color = "999999";
}
}
function limpa_MAE() {
if (document.formulario.MAE.value == "Mãe") 
{
document.formulario.MAE.value = "";
}
}
function preenche_MAE() {
if (document.formulario.MAE.value == "") 
{
document.formulario.MAE.value = "Mãe";
document.formulario.MAE.style.color = "999999";
}
}
function limpa_LOCAL() {
if (document.formulario.LOCAL_TABELIAO.value == "Onde se localiza?") 
{
document.formulario.LOCAL_TABELIAO.value = "";
}
}
function preenche_LOCAL() {
if (document.formulario.LOCAL_TABELIAO.value == "") 
{
document.formulario.LOCAL_TABELIAO.value = "Onde se localiza?";
document.formulario.LOCAL_TABELIAO.style.color = "999999";
}
}

/* divisor de valor */

function FormataValor(obj,tammax,teclapres) {
 var tecla = teclapres.keyCode;
 var  vr = obj.value;
 vr = vr.replace( "/", "" );
 vr = vr.replace( "/", "" );
 vr = vr.replace( ",", "" );
 vr = vr.replace( ",", "" );
 vr = vr.replace( ".", "" );
 vr = vr.replace( ".", "" );
 vr = vr.replace( ".", "" );
 vr = vr.replace( ".", "" );
 //Replaces adicionais
 //vr = vr.replace( "-", "" );
 //vr = vr.replace( "+", "" );
 //vr = vr.replace( "*", "" );
 tam = vr.length;
 
 if (tam < tammax && tecla != 8)
 {
	 tam = vr.length + 1 ; 
 }
 
 if (tecla == 8 )
 {
	 tam = tam - 1 ;
 }
  
 if ( (tecla == 8) || (tecla >= 48 && tecla <= 57) || (tecla >= 96 && tecla <= 105) )
 {
  if ( tam <= 2 )
  { 
   obj.value = vr ;
  }
  if ( (tam > 2) && (tam <= 5) )
  {
   obj.value = vr.substr( 0, tam - 2 ) + ',' + vr.substr( tam - 2, tam ) ;
  }
  if ( (tam >= 6) && (tam <= 8) )
  {
   obj.value = vr.substr( 0, tam - 5 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ;
  }
  if ( (tam >= 9) && (tam <= 11) )
  {
   obj.value = vr.substr( 0, tam - 8 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ;
  }
  if ( (tam >= 12) && (tam <= 14) )
  {
   obj.value = vr.substr( 0, tam - 11 ) + '.' + vr.substr( tam - 11, 3 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ;
  }
  if ( (tam >= 15) && (tam <= 17) )
  {
   obj.value = vr.substr( 0, tam - 14 ) + '.' + vr.substr( tam - 14, 3 ) + '.' + vr.substr( tam - 11, 3 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ;
  }
 }
}

/* DIVISOR DE NÚMEROS */

function Formatar(src, mask)
{
 var i = src.value.length;
 var saida = mask.substring(0,1);
 var texto = mask.substring(i)
if (texto.substring(0,1) != saida)
 {
        src.value += texto.substring(0,1);
 }
}

/* SOMENTE NÚMEROS */
function numeros(x)
{   
if(navigator.appName=='Microsoft Internet Explorer'){
      var y=x.keyCode;
      if(y>=48 && y<=57 || y==8){
         return true;
      } else {
         return false;
      }
   }

   if(navigator.appName=='Netscape'){
      var y=x.which;
      if(y>=48 && y<=57 || y==8){
         return true;
      } else {
         return false;
      }
   }
}

/* EXPANDIR CAMPOS */
	function desativar_imovel(){
	if (document.formulario.PRETENÇAO.value == "LOCATÁRIO"){
	xDisplay('fundo_imovel', 'none')
	}
	if (document.formulario.PRETENÇAO.value == "FIADOR"){
	xDisplay('fundo_imovel', 'block')
	}}

	function desativar_aluguel(){
	if (document.formulario.ALUGADA.value == "SIM"){
	xDisplay('nome_aluguel', 'block')
	xDisplay('valor', 'block')
	xDisplay('tel_aluguel', 'block')
	}
	if (document.formulario.ALUGADA.value == "NÃO"){
	xDisplay('nome_aluguel', 'none')
	xDisplay('valor', 'none')
	xDisplay('tel_aluguel', 'none')
	}}

	function desativar_automovel(){
	if (document.formulario.AUTOMOVEL.value == "SIM"){
	xDisplay('modelo', 'block')
	xDisplay('ano', 'block')
	xDisplay('divida', 'block')
	xDisplay('valor_autom', 'block')
	xDisplay('modelo2', 'block')
	xDisplay('ano2', 'block')
	xDisplay('divida2', 'block')
	xDisplay('valor_autom2', 'block')
	}
	if (document.formulario.AUTOMOVEL.value == "NÃO"){
	xDisplay('modelo', 'none')
	xDisplay('ano', 'none')
	xDisplay('divida', 'none')
	xDisplay('valor_autom', 'none')
	xDisplay('modelo2', 'none')
	xDisplay('ano2', 'none')
	xDisplay('divida2', 'none')
	xDisplay('valor_autom2', 'none')
	}}

	function desativar_conjuge(){
	if (document.formulario.ESTADO_CIVIL.value == "Selecione"){
	xDisplay('fundo_conjuge', 'none');
	document.getElementById('fundo_renda').style.top = "700px";
	document.getElementById('fundo_bancarias').style.top = "1160px";
	document.getElementById('fundo_imovel').style.top = "1550px";
	document.getElementById('fundo_automovel').style.top = "1840px";
	document.getElementById('enviar').style.top = "2060px";
	document.getElementById('geral_form').style.height = "2390px";
	document.getElementById('rodap_form').style.top = "2600px";
	document.getElementById('topo_form').style.top = "2555px";
	document.getElementById('home_form').style.top = "2555px";
	}
	if (document.formulario.ESTADO_CIVIL.value == "Casado(a)"){
	xDisplay('fundo_conjuge', 'block');
	document.getElementById('fundo_renda').style.top = "1010px";
	document.getElementById('fundo_bancarias').style.top = "1470px";
	document.getElementById('fundo_imovel').style.top = "1855px";
	document.getElementById('fundo_automovel').style.top = "2140px";
	document.getElementById('enviar').style.top = "2360px";
	document.getElementById('geral_form').style.height = "2710px";
	document.getElementById('rodap_form').style.top = "2910px";
	document.getElementById('topo_form').style.top = "2875px";
	document.getElementById('home_form').style.top = "2875px";
	}
	if (document.formulario.ESTADO_CIVIL.value == "Divorciado(a)"){
	xDisplay('fundo_conjuge', 'none');
	document.getElementById('fundo_renda').style.top = "700px";
	document.getElementById('fundo_bancarias').style.top = "1160px";
	document.getElementById('fundo_imovel').style.top = "1550px";
	document.getElementById('fundo_automovel').style.top = "1840px";
	document.getElementById('enviar').style.top = "2060px";
	document.getElementById('geral_form').style.height = "2390px";
	document.getElementById('rodap_form').style.top = "2600px";
	document.getElementById('topo_form').style.top = "2555px";
	document.getElementById('home_form').style.top = "2555px";
	}
	if (document.formulario.ESTADO_CIVIL.value == "Separado(a)"){
	xDisplay('fundo_conjuge', 'none');
	document.getElementById('fundo_renda').style.top = "700px";
	document.getElementById('fundo_bancarias').style.top = "1160px";
	document.getElementById('fundo_imovel').style.top = "1550px";
	document.getElementById('fundo_automovel').style.top = "1840px";
	document.getElementById('enviar').style.top = "2060px";
	document.getElementById('geral_form').style.height = "2390px";
	document.getElementById('rodap_form').style.top = "2600px";
	document.getElementById('topo_form').style.top = "2555px";
	document.getElementById('home_form').style.top = "2555px";
	}
	if (document.formulario.ESTADO_CIVIL.value == "Solteiro(a)"){
	xDisplay('fundo_conjuge', 'none');
	document.getElementById('fundo_renda').style.top = "700px";
	document.getElementById('fundo_bancarias').style.top = "1160px";
	document.getElementById('fundo_imovel').style.top = "1550px";
	document.getElementById('fundo_automovel').style.top = "1840px";
	document.getElementById('enviar').style.top = "2060px";
	document.getElementById('geral_form').style.height = "2390px";
	document.getElementById('rodap_form').style.top = "2600px";
	document.getElementById('topo_form').style.top = "2555px";
	document.getElementById('home_form').style.top = "2555px";
	}
	if (document.formulario.ESTADO_CIVIL.value == "Viúvo(a)"){
	xDisplay('fundo_conjuge', 'none');
	document.getElementById('fundo_renda').style.top = "700px";
	document.getElementById('fundo_bancarias').style.top = "1160px";
	document.getElementById('fundo_imovel').style.top = "1550px";
	document.getElementById('fundo_automovel').style.top = "1840px";
	document.getElementById('enviar').style.top = "2060px";
	document.getElementById('geral_form').style.height = "2390px";
	document.getElementById('rodap_form').style.top = "2600px";
	document.getElementById('topo_form').style.top = "2555px";
	document.getElementById('home_form').style.top = "2555px";
	}}


/* CHECAGEM DE EMAIL */

function ValidaEmail()
{
  var obj = eval("document.forms[0].Email");
  var txt = obj.value;
  if ((txt.length != 0) && ((txt.indexOf("@") < 1) || (txt.indexOf('.') < 7)))
  {
    alert('Email incorreto!');
	obj.focus();
  }
}

