function CampoNumerico(numero){
   var CaractereInvalido = false;

   for (i=0; i < numero.length; i++){
      var Caractere = numero.charAt(i);
      if(Caractere != "." && Caractere != "," && Caractere != "-"){
         if (isNaN(parseInt(Caractere))) CaractereInvalido = true;
      }
   }
   return !CaractereInvalido;
}

function ValidarDADOS(){

	if(document.BoletoWebCaixa.nome.value=="" || document.BoletoWebCaixa.nome.value.length < 8)
	{
		alert( "Preencha campo NOME corretamente!" );
		document.BoletoWebCaixa.nome.focus();
		return false;
	}
	if( document.BoletoWebCaixa.email.value=="" || document.BoletoWebCaixa.email.value.indexOf('@')==-1 || document.BoletoWebCaixa.email.value.indexOf('.')==-1 )
	{
		alert( "Preencha campo E-MAIL corretamente!" );
		document.BoletoWebCaixa.email.focus();
		return false;
	}

	if (document.BoletoWebCaixa.cpf.value=="")
	{
		alert( "Preencha o campo CPF!" );
		document.BoletoWebCaixa.cpf.focus();
		return false;
	}else{
		var i;
		s = document.BoletoWebCaixa.cpf.value;
		var c = s.substr(0,9);
		var dv = s.substr(9,2);
		var d1 = 0;
		
		for (i = 0; i < 9; i++)
		{
			d1 += c.charAt(i)*(10-i);
		}
		if (d1 == 0){
			alert("CPF Invalido")
			document.BoletoWebCaixa.cpf.focus();
			return false;
		}
		d1 = 11 - (d1 % 11);
		if (d1 > 9) d1 = 0;
		if (dv.charAt(0) != d1)
		{
			alert("CPF Invalido");
			document.BoletoWebCaixa.cpf.focus();
			return false;
		}
		d1 *= 2;
		for (i = 0; i < 9; i++)
		{
			d1 += c.charAt(i)*(11-i);
		}
		d1 = 11 - (d1 % 11);
		if (d1 > 9) d1 = 0;
		if (dv.charAt(1) != d1)
		{
			alert("CPF Invalido");
			document.BoletoWebCaixa.cpf.focus();
			return false;
		}
		if( s == 11111111111 || s == 22222222222 || s == 33333333333 || s == 44444444444 || s == 55555555555
		|| s == 66666666666 || s == 77777777777 || s == 88888888888 || s == 99999999999) {
			alert("CPF Invalido");
			document.BoletoWebCaixa.cpf.focus();
			return false;		
		}
	
	} 
	
	<!-- ValidarCPF(document.BoletoWebCaixa.cpf.value);->

	if (document.BoletoWebCaixa.empresa.value=="")
	{
		alert( "Preencha o campo EMPRESA!" );
		document.BoletoWebCaixa.empresa.focus();
		return false;
	}

	if (document.BoletoWebCaixa.cargo.value=="")
	{
		alert( "Preencha o campo CARGO!" );
		document.BoletoWebCaixa.cargo.focus();
		return false;
	}

/**
	if (document.BoletoWebCaixa.ddd_res.value=="")
	{
		alert( "Preencha o campo DDD!" );
		document.BoletoWebCaixa.ddd_res.focus();
		return false;
	} 
	else if (!CampoNumerico(document.BoletoWebCaixa.ddd_res.value))
	{
		alert("Preencha o DDD apenas númerico!");
		return false;
	}

	if (document.BoletoWebCaixa.fone_res.value=="")
	{
		alert( "Preencha o campo FONE!" );
		document.BoletoWebCaixa.fone_res.focus();
		return false;
	}
	else if (!CampoNumerico(document.BoletoWebCaixa.fone_res.value))
	{
		alert("Preencha o FONE apenas númerico!");
		return false;
	}
*/
	if (document.BoletoWebCaixa.cep.value=="")
	{
		alert( "Preencha o campo CEP!" );
		document.BoletoWebCaixa.cep.focus();
		return false;
	}
	else if (!CampoNumerico(document.BoletoWebCaixa.cep.value))
	{
		alert("Preencha o CEP apenas númerico!");
		return false;
	}

/**
	if (document.BoletoWebCaixa.cidade.value=="")
	{
		alert( "Preencha o campo CIDADE!" );
		document.BoletoWebCaixa.cidade.focus();
		return false;
	}
*/
	if (document.BoletoWebCaixa.nacionalidade.value=="")
	{
		alert( "Preencha o campo NACIONALIDADE!" );
		document.BoletoWebCaixa.nacionalidade.focus();
		return false;
	}
	return true;
} 