// JavaScript Document

// VERIFICA SE DATA FINAL ? MAIOR QUE INICIAL
function verificaDatas(dtInicial, dtFinal){

	var dtini = dtInicial;
	var dtfim = dtFinal;

	/*if ((dtini == '') && (dtfim == '')) {
		alert('Complete os Campos.');
		campos.periodo1.focus();
		return false;
	}*/

	datInicio = new Date(dtini.substring(6,10),
						 dtini.substring(3,5),
						 dtini.substring(0,2));
	datInicio.setMonth(datInicio.getMonth() - 1);


	datFim = new Date(dtfim.substring(6,10),
					  dtfim.substring(3,5),
					  dtfim.substring(0,2));

	datFim.setMonth(datFim.getMonth() - 1);

	if(datInicio <= datFim){
		//alert('Data Confere!');
		return true;
	} else {
		alert('ATEN??O: Data Inicial ? maior que Data Final');
		document.all.campos.periodo2.focus();
		document.all.campos.periodo2.select();
		return false;
	}
}

//VALIDA O CAMPO DATA PASSANDO O FOCO
function verificaFoco(objeto,foco) {

	if (objeto.value.length == 10) {
		foco.focus();
		return false;
	}

}

// colocar no evento onKeyUp passando o objeto como parametro
function FormatMesAno(val)
{
   	var strPass = val.value;
	var mikExp = /[0123456789]/;

	for(i=0; i<strPass.length; i++){
		// charAt -> retorna o caractere posicionado no ?ndice especificado
		var lchar = val.value.charAt(i);
		var nchar = val.value.charAt(i+1);

		if(i==0){
		   // search -> retorna um valor inteiro, indicando a posi??o do inicio da primeira
		   // ocorr?ncia de expReg dentro de instStr. Se nenhuma ocorrencia for encontrada o m?todo retornara -1
		   // instStr.search(expReg);
		   if ((lchar.search(mikExp) != 0) || (lchar>3)){
			  val.value = "";
		   }

		}else if(i==1){

			   if(lchar.search(mikExp) != 0){
				  // substring(indice1,indice2)
				  // indice1, indice2 -> ser? usado para delimitar a string
				  var tst1 = val.value.substring(0,(i));
				  val.value = tst1;
 				  continue;
			   }

			   if ((nchar != '/') && (nchar != '')){
				 	var tst1 = val.value.substring(0, (i)+1);

					if(nchar.search(mikExp) != 0)
						var tst2 = val.value.substring(i+2, strPass.length);
					else
						var tst2 = val.value.substring(i+1, strPass.length);

					val.value = tst1 + '/' + tst2;
			   }

		 }else if(i==4){

				if(lchar.search(mikExp) != 0){
					var tst1 = val.value.substring(0, (i));
					val.value = tst1;
					continue;
				}

				if	((nchar != '/') && (nchar != '')){
					var tst1 = val.value.substring(0, (i)+1);

					if(nchar.search(mikExp) != 0)
						var tst2 = val.value.substring(i+2, strPass.length);
					else
						var tst2 = val.value.substring(i+1, strPass.length);

					val.value = tst1 + '/' + tst2;
				}
   		  }

		  if(i>=6){
			  if(lchar.search(mikExp) != 0) {
					var tst1 = val.value.substring(0, (i));
					val.value = tst1;
			  }
		  }
	 }

     if(strPass.length>10)
		val.value = val.value.substring(0, 10);
	 	return true;
}

// colocar no evento onKeyUp passando o objeto como parametro

function FormatCEP(val)
{
   	var strPass = val.value;
	var mikExp = /[0123456789]/;

	for(i=0; i<strPass.length; i++){
		// charAt -> retorna o caractere posicionado no ?ndice especificado
		var lchar = val.value.charAt(i);
		var nchar = val.value.charAt(i+1);

		if(i==0){

		   // search -> retorna um valor inteiro, indicando a posi??o do inicio da primeira
		   // ocorr?ncia de expReg dentro de instStr. Se nenhuma ocorrencia for encontrada o m?todo retornara -1
		   // instStr.search(expReg);
		   if ((lchar.search(mikExp) != 0) || (lchar>9)){
			  val.value = "";
		   }

		}else if(i==1){

			   if(lchar.search(mikExp) != 0){
				  // substring(indice1,indice2)
				  // indice1, indice2 -> ser? usado para delimitar a string
				  var tst1 = val.value.substring(0,(i));
				  val.value = tst1;
 				  continue;
			   }

			   if ((nchar != '') && (nchar != '')){
				 	var tst1 = val.value.substring(0, (i)+1);

					if(nchar.search(mikExp) != 0)
						var tst2 = val.value.substring(i+2, strPass.length);
					else
						var tst2 = val.value.substring(i+1, strPass.length);

					val.value = tst1 + '' + tst2;
			   }

		 }else if(i==2){

				if(lchar.search(mikExp) != 0){
					var tst1 = val.value.substring(0, (i));
					val.value = tst1;
					continue;
				}

				if	((nchar != '') && (nchar != '')){
					var tst1 = val.value.substring(0, (i)+1);

					if(nchar.search(mikExp) != 0)
						var tst2 = val.value.substring(i+2, strPass.length);
					else
						var tst2 = val.value.substring(i+1, strPass.length);

					val.value = tst1 + '' + tst2;
				}
   		  }

		  if(i>=6){
			  if(lchar.search(mikExp) != 0) {
					var tst1 = val.value.substring(0, (i));
					val.value = tst1;
			  }
		  }
	 }

     if(strPass.length>10)
		val.value = val.value.substring(0, 8);
	 	return true;
}

function Formatar() {
	if ( document.nform.cnpj.value.length < 15 ) {
		FormataCPF(document.nform,'cnpj');
	} else {
		FormataCNPJ(document.nform,'cnpj');
	}
}

function Testar() {
	if ( document.nform.cnpj.value.length < 15 ) {
		TestaCPF();
	} else {
		TestaCNPJ();
	}
}

function FormataCPF(nform,campo) {
if (event.keyCode < 45 || event.keyCode > 57) {
event.returnValue = false;
} else {
x = nform[campo].value;
x = x.toString().replace( ".", "" );
x = x.toString().replace( ".", "" );
x = x.toString().replace( "-", "" );
t = x.length ;
if (t >= 3 && t < 6) { x = '' + x.substr(0,3) + '.' + x.substr(3) + ''; }
if (t >= 6 && t < 9) { x = '' + x.substr(0,3) + '.' + x.substr(3,3) + '.' + x.substr(6) + ''; }
if (t >= 9) { x = '' + x.substr(0,3) + '.' + x.substr(3,3) + '.' + x.substr(6,3) + '-' + x.substr(9) + ''; }
nform[campo].value = x;
}
}
function TestaCPF() {
x = document.nform.cnpj.value;
x = x.toString().replace( ".", "" );
x = x.toString().replace( ".", "" );
x = x.toString().replace( "-", "" );
if (checaCPF(x)) {
document.nform.cnpj.style.backgroundColor='#FFFFFF';
document.nform.cnpj.style.color='#000000';
//alert("Ok, o CPF ? valido.");
}
else {
errors="1";
if (errors)
document.nform.cnpj.style.backgroundColor='#FFFFFF';
document.nform.cnpj.style.color='#FF0000';
if (document.nform.cnpj.value != '') {
alert('CNPJ ou CPF Inv?lido: ' + document.nform.cnpj.value + '');
document.all("cnpj").focus();

} else {
//alert('Digite um CNPJ ou CPF V?lido');
document.all("cnpj").focus();
}
document.MM_returnValue = (errors == '');
}
}
function checaCPF (CPF) {
CPF = CPF.toString().replace( ".", "" );
CPF = CPF.toString().replace( ".", "" );
CPF = CPF.toString().replace( "-", "" );
if (CPF.length != 11 || CPF == "00000000000" || CPF == "11111111111" ||
CPF == "22222222222" ||	CPF == "33333333333" || CPF == "44444444444" ||
CPF == "55555555555" || CPF == "66666666666" || CPF == "77777777777" ||
CPF == "88888888888" || CPF == "99999999999")
return false;
soma = 0;
for (i=0; i < 9; i ++)
soma += parseInt(CPF.charAt(i)) * (10 - i);
resto = 11 - (soma % 11);
if (resto == 10 || resto == 11)
resto = 0;
if (resto != parseInt(CPF.charAt(9)))
return false;
soma = 0;
for (i = 0; i < 10; i ++)
soma += parseInt(CPF.charAt(i)) * (11 - i);
resto = 11 - (soma % 11);
if (resto == 10 || resto == 11)
resto = 0;
if (resto != parseInt(CPF.charAt(10)))
return false;
return true;
}
function FormataCNPJ(nform,campo) {
if (event.keyCode < 45 || event.keyCode > 57) {
event.returnValue = false;
} else {
x = nform[campo].value;
x = x.toString().replace( ".", "" );
x = x.toString().replace( ".", "" );
x = x.toString().replace( "/", "" );
x = x.toString().replace( "-", "" );
t = x.length ;
if (t >= 2 && t < 5) { x = '' + x.substr(0,2) + '.' + x.substr(2) + ''; }
if (t >= 5 && t < 8) { x = '' + x.substr(0,2) + '.' + x.substr(2,3) + '.' + x.substr(5) + ''; }
if (t >= 8 && t < 12) { x = '' + x.substr(0,2) + '.' + x.substr(2,3) + '.' + x.substr(5,3) + '/' + x.substr(8) + ''; }
if (t >= 12) { x = '' + x.substr(0,2) + '.' + x.substr(2,3) + '.' + x.substr(5,3) + '/' + x.substr(8,4) + '-' + x.substr(12) + ''; }
nform[campo].value = x;
}
}
function TestaCNPJ() {
FORM = document.nform.cnpj.value;

FORM = FORM.toString().replace( ".", "" );
FORM = FORM.toString().replace( ".", "" );
FORM = FORM.toString().replace( "/", "" );
FORM = FORM.toString().replace( "-", "" );
CAMPO = "cnpj";
if(Verify(FORM, CAMPO))
{
document.nform.cnpj.style.backgroundColor='#FFFFFF';
document.nform.cnpj.style.color='#000000';
//alert("Ok, o CNPJ ? valido.");
}
else
{
document.nform.cnpj.style.backgroundColor='#FFFFFF';
document.nform.cnpj.style.color='#FF0000';
if (document.nform.cnpj.value != '') {
alert('CNPJ ou CPF Inv?lido: ' + document.nform.cnpj.value + '');
document.all("cnpj").focus();
} else {
//alert('Digite um CNPJ ou CPF V?lido');
document.all("cnpj").focus();
}
}
return;
}
function Verify(FORM,CAMPO)
{
if(FORM == 0)
{
return(false);
}
else
{
g=FORM.length-2;
if(TestDigit(FORM,CAMPO,g))
{
g=FORM.length-1;
if(TestDigit(FORM,CAMPO,g))
{	
return(true);
}
else
{
return(false);
}
}
else
{
return(false);
}
}
}
function TestDigit(FORM,CAMPO,g)
{
var dig=0;
var ind=2;
for(f=g;f>0;f--)
{
dig+=parseInt(FORM.charAt(f-1))*ind;
if (CAMPO=='cnpj')
{ if(ind>8) {ind=2} else {ind++} }
else
{ ind++ }
}
dig%=11;
if(dig<2)
{
dig=0;
}
else
{
dig=11-dig;
}
if(dig!=parseInt(FORM.charAt(g)))
{
return(false);
}
else
{
return(true);
}
}
window.status="";

function FormatarCampoCPF() {
if ( document.nform.cpf.value.length < 15 ) {
FormataCPF(document.nform,'cpf');
} else {
FormataCNPJ(document.nform,'cnpj');
}
}
function TestarCampoCPF() {
if ( document.nform.cpf.value.length < 15 ) {
TestaCPF();
} else {
TestaCNPJ();
}
}
function FormataCPF(nform,campo) {
if (event.keyCode < 45 || event.keyCode > 57) {
event.returnValue = false;
} else {
x = nform[campo].value;
x = x.toString().replace( ".", "" );
x = x.toString().replace( ".", "" );
x = x.toString().replace( "-", "" );
t = x.length ;
if (t >= 3 && t < 6) { x = '' + x.substr(0,3) + '.' + x.substr(3) + ''; }
if (t >= 6 && t < 9) { x = '' + x.substr(0,3) + '.' + x.substr(3,3) + '.' + x.substr(6) + ''; }
if (t >= 9) { x = '' + x.substr(0,3) + '.' + x.substr(3,3) + '.' + x.substr(6,3) + '-' + x.substr(9) + ''; }
nform[campo].value = x;
}
}
function TestaCPF() {
x = document.nform.cpf.value;
x = x.toString().replace( ".", "" );
x = x.toString().replace( ".", "" );
x = x.toString().replace( "-", "" );
if (checaCPF(x)) {
document.nform.cpf.style.backgroundColor='#FFFFFF';
document.nform.cpf.style.color='#000000';
//alert("Ok, o CPF ? valido.");
}
else {
errors="1";
if (errors)
document.nform.cpf.style.backgroundColor='#FFFFFF';
document.nform.cpf.style.color='#FF0000';
if (document.nform.cpf.value != '') {
alert('CPF Invalido: ' + document.nform.cpf.value + '');
document.all("cpf").focus();

} else {
//alert('Digite um CNPJ ou CPF V?lido');
//document.all("cpf").focus();
}
document.MM_returnValue = (errors == '');
}
}
function checaCPF (CPF) {
CPF = CPF.toString().replace( ".", "" );
CPF = CPF.toString().replace( ".", "" );
CPF = CPF.toString().replace( "-", "" );
if (CPF.length != 11 || CPF == "00000000000" || CPF == "11111111111" ||
CPF == "22222222222" ||	CPF == "33333333333" || CPF == "44444444444" ||
CPF == "55555555555" || CPF == "66666666666" || CPF == "77777777777" ||
CPF == "88888888888" || CPF == "99999999999")
return false;
soma = 0;
for (i=0; i < 9; i ++)
soma += parseInt(CPF.charAt(i)) * (10 - i);
resto = 11 - (soma % 11);
if (resto == 10 || resto == 11)
resto = 0;
if (resto != parseInt(CPF.charAt(9)))
return false;
soma = 0;
for (i = 0; i < 10; i ++)
soma += parseInt(CPF.charAt(i)) * (11 - i);
resto = 11 - (soma % 11);
if (resto == 10 || resto == 11)
resto = 0;
if (resto != parseInt(CPF.charAt(10)))
return false;
return true;
}
function FormataCNPJ(nform,campo) {
if (event.keyCode < 45 || event.keyCode > 57) {
event.returnValue = false;
} else {
x = nform[campo].value;
x = x.toString().replace( ".", "" );
x = x.toString().replace( ".", "" );
x = x.toString().replace( "/", "" );
x = x.toString().replace( "-", "" );
t = x.length ;
if (t >= 2 && t < 5) { x = '' + x.substr(0,2) + '.' + x.substr(2) + ''; }
if (t >= 5 && t < 8) { x = '' + x.substr(0,2) + '.' + x.substr(2,3) + '.' + x.substr(5) + ''; }
if (t >= 8 && t < 12) { x = '' + x.substr(0,2) + '.' + x.substr(2,3) + '.' + x.substr(5,3) + '/' + x.substr(8) + ''; }
if (t >= 12) { x = '' + x.substr(0,2) + '.' + x.substr(2,3) + '.' + x.substr(5,3) + '/' + x.substr(8,4) + '-' + x.substr(12) + ''; }
nform[campo].value = x;
}
}
function TestaCNPJ() {
FORM = document.nform.cnpj.value;
FORM = FORM.toString().replace( ".", "" );
FORM = FORM.toString().replace( ".", "" );
FORM = FORM.toString().replace( "/", "" );
FORM = FORM.toString().replace( "-", "" );
CAMPO = "cnpj";
if(Verify(FORM, CAMPO))
{
document.nform.cnpj.style.backgroundColor='#FFFFFF';
document.nform.cnpj.style.color='#000000';
//alert("Ok, o CNPJ ? valido.");
}
else
{
document.nform.cnpj.style.backgroundColor='#FFFFFF';
document.nform.cnpj.style.color='#FF0000';
if (document.nform.cnpj.value != '') {
alert('CNPJ Invalido: ' + document.nform.cnpj.value + '');
document.all("cnpj").focus();
} else {
//alert('Digite um CNPJ ou CPF V?lido');
//document.all("cnpj").focus();
}
}
return;
}
function Verify(FORM,CAMPO)
{
if(FORM == 0)
{
return(false);
}
else
{
g=FORM.length-2;
if(TestDigit(FORM,CAMPO,g))
{
g=FORM.length-1;
if(TestDigit(FORM,CAMPO,g))
{	
return(true);
}
else
{
return(false);
}
}
else
{
return(false);
}
}
}
function TestDigit(FORM,CAMPO,g)
{
var dig=0;
var ind=2;
for(f=g;f>0;f--)
{
dig+=parseInt(FORM.charAt(f-1))*ind;
if (CAMPO=='cnpj')
{ if(ind>8) {ind=2} else {ind++} }
else
{ ind++ }
}
dig%=11;
if(dig<2)
{
dig=0;
}
else
{
dig=11-dig;
}
if(dig!=parseInt(FORM.charAt(g)))
{
return(false);
}
else
{
return(true);
}
}
window.status="";

function myClient() {
    var cep;
    var endereco;
    var bairro;
    var cidade;
    var uf;

}

function LocalizaCEP() {
	var cep=document.nform.CEP.value;
	var endereco=document.nform.Endereco.value;
	var cidade=document.nform.Cidade.value;
	var uf=document.nform.uf.value;
	var strURL;

	strURL="BuscaCep.asp?cep=" + cep + "&endereco=" + endereco + "&cidade=" + cidade + "&uf=" + uf;

	if (showModalDialog(strURL, myClient,"dialogWidth:60em;dialogHeight:30em;center:1;resizable:0;status:No;")==false)
		return;    // user canceled search
	else {
		// search for the string
		if (myClient.cep!="" && myClient.cep!="undefined" && myClient.cep!=null) {
			document.nform.CEP.value=myClient.cep;
			document.nform.Endereco.value=myClient.endereco;
			document.nform.Bairro.value=myClient.bairro;
			document.nform.Cidade.value=myClient.cidade;
			document.nform.uf.value=myClient.uf;
			document.all("Numero").focus();
		}
	}
}

function BuscaCartao() {
	var cartao="";
	var strURL;

	strURL="BuscaCartao.asp";

	if (showModalDialog(strURL, BC,"dialogWidth:15em;dialogHeight:25em;center:1;resizable:0;status:No;")==false)
		return;    // user canceled search
	else {
		// search for the string
		if (BC.cartao!="" && BC.cartao!="undefined" && BC.cartao!=null) {
			document.nform.cartao.value=BC.cartao;
			document.all("Nome").focus();
		}
		else
			document.all("cartao").focus();
	}
}

function BC() {
    var cartao;
}

function SomenteNumeros(input)
	{
	if ((event.keyCode<48)||(event.keyCode>57))
		event.returnValue = false;
	}
function FormataValor(campo,tammax,teclapres) {

	var tecla = teclapres.keyCode;
	var vr = campo.value;
	vr = vr.replace( "/", "" );
	vr = vr.replace( "/", "" );
	vr = vr.replace( ",", "" );
	vr = vr.replace( ".", "" );
	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 ){
	 		campo.value = vr ; }
	 	tam = tam - 1;
	 	if ( (tam > 2) && (tam <= 5) ){
	 		campo.value = vr.substr( 0, tam - 2 ) + ',' + vr.substr( tam - 2, tam ) ; }
	 	if ( (tam >= 6) && (tam <= 8) ){
	 		campo.value = vr.substr( 0, tam - 5 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ; }
	 	if ( (tam >= 9) && (tam <= 11) ){
	 		campo.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) ){
	 		campo.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) ){
	 		campo.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 ) ;}
	}
}

function checa(nform) {
		
	
	if (nform.Nome.value == "") {
		alert("Informe seu Nome.");
		nform.Nome.focus();
		nform.Nome.select();
		return false;
	}
	
	if (nform.Rg.value == "") {
		alert("Informe seu Rg.");
		nform.Rg.focus();
		nform.Rg.select();
		return false;
	}
	
	if (nform.cpf.value == "") {
		alert("Informe seu CPF.");
		nform.cpf.focus();
		nform.cpf.select();
		return false;
	}
		
	if (nform.email.value == "") {
		alert("Informe seu e-mail.");
		nform.email.focus();
		nform.email.select();
		return false;
	} else {
		prim = nform.email.value.indexOf("@")
		if(prim < 2) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf("@",prim + 1) != -1) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf(".") < 1) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf(" ") != -1) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf("zipmeil.com") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf("hotmeil.com") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf(".@") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf("@.") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf(".com.br.") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf("/") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf("[") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf("]") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf("(") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf(")") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		if(nform.email.value.indexOf("..") > 0) {
			alert("O e-mail informado parece não estar correto.");
			nform.email.focus();
			nform.email.select();
			return false;
		}
		
			if (nform.ddd.value == "") {
			alert("Informe seu DDD.");
			nform.ddd.focus();
			nform.ddd.select();
			return false;
		}
		
		if (nform.Telefone.value == "") {
			alert("Informe seu Telefone.");
			nform.Telefone.focus();
			nform.Telefone.select();
			return false;
		}
		
		if (nform.cep.value == "") {
			alert("Informe seu CEP.");
			nform.cep.focus();
			nform.cep.select();
			return false;
		}
		
		if (nform.Login.value == "") {
			alert("Informe seu login.");
			nform.Login.focus();
			nform.Login.select();
			return false;
		}
		
		if (nform.senha.value == "") {
			alert("Informe sua senha.");
			nform.senha.focus();
			nform.senha.select();
			return false;
		}
		
	   if (nform.senha.value != nform.senha2.value) {
       alert("Os campos SENHA e CONFIRMAR SENHA, DEVEM ser iguais!");
       nform.senha2.focus();
       return false;
	   }

	}
		return true;
}
