 // a função recebe como parâmetro uma variável string
 function checaCPF (CPF) {
	if (CPF.length != 11 || CPF == "00000000000" || CPF == "11111111111" ||
		CPF == "22222222222" ||	CPF == "33333333333" || CPF == "44444444444" ||
		CPF == "55555555555" || CPF == "66666666666" || CPF == "77777777777" ||
		CPF == "88888888888" || CPF == "99999999999")
	{	alert('CPF Invalido!'); 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)))
	{	alert('CPF Invalido!'); 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)))
	{	alert('CPF Invalido!'); return false; }
//	return true;
    verificaNull();
 }

// verifica alguns campos
 function verificaNull() {
    var nome = document.getElementById('nome').value;
    var senha = document.getElementById('senha').value;
    var csenha = document.getElementById('csenha').value;
    var email = document.getElementById('email').value;
    if ((nome == '') || (senha == '') || (csenha == '') || (email == '')) { alert('Os campos Nome, Senha, Confere Senha e E-mail sao obrigatorios'); return false; }
    else { document.cad.submit(); }
 }