function checkdata() {
	with(document.form1) {	
	    if (Nome.value == "") {
			alert("Campo Nome esta em branco!");
			Nome.focus();
			return false; }
			
		if (RG.value == "") {
			alert("Campo RG esta em branco!");
			RG.focus();
			return false; }


            if (CPF.value == "") {
			alert("Campo CPF esta em branco!");
			CPF.focus();
			return false;}

		if (Endereco_residencial.value == "") {
			alert("Campo Endereço Residencial esta em branco!");
			Endereco_residencial.focus();
			return false;}

		if (Bairro_Residencial.value == "") {
			alert("Campo Bairro Residencial esta em branco!");
			Bairro_Residencial.focus();
			return false;}
			
		if (Cidade_Residencial.value == "") {
			alert("Campo Cidade Residencial esta em branco!");
			Cidade_Residencial.focus();
			return false;}
			
		if (CEP_Residencial.value == "") {
			alert("Campo CEP esta em branco!");
			CEP_Residencial.focus();
			return false;}
			
		if (Fone_Residencial.value == "") {
			alert("Campo Fone Residencial esta em branco!");
			Fone_Residencial.focus();
			return false;}

		if (E_Mail.value == "") {
			alert("Campo e-Mail esta em branco!");
			E_Mail.focus();
			return false;}

		 parte1 = E_Mail.value.indexOf("@");
         parte2 = E_Mail.value.indexOf(".");
         parte3 = E_Mail.value.length;
         if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
            alert ("O campo e-Mail deve ter um endereco eletronico!");
            E_Mail.focus();
            return false;}

		if (Aniversario.value == "") {
			alert("Campo Aniversário esta em branco!");
			Aniversario.focus();
			return false;}
			
		if (Login.value == "") {
			alert("Campo Login esta em branco!");
			Login.focus();
			return false;}
	
			
		if (Senha.value == "") {
			alert("Campo Senha esta em branco!");
			Senha.focus();
			return false;}
			
      if (confirma_senha.value == "") {
			alert("Campo Confirma senha esta em branco!");
			confirma_senha.focus();
			return false;}
			
		if (Senha.value != confirma_senha.value) {
			alert("Senha não confere!");
			confirma_senha.focus();
			return false;}
	}
			
//------------------------MDYCARD---------------------------

with(document.form2) {
	 if (Nome_completo.value == "") {
			alert("Campo Nome esta em branco!");
			Nome_completo.focus();
			return false; }
			
	if (email.value == "") {
			alert("Campo E-Mail esta em branco!");
			email.focus();
			return false;}

		 parte1 = email.value.indexOf("@");
         parte2 = email.value.indexOf(".");
         parte3 = email.value.length;
			
	if (registro_geral.value == "") {
			alert("Campo RG esta em branco!");
			registro_geral.focus();
			return false; }
			
	if (orgaoE.value == "") {
			alert("Campo Orgão Expeditor esta em branco!");
			orgaoE.focus();
			return false; }
			
	if (cpf.value == "") {
			alert("Campo CPF esta em branco!");
			cpf.focus();
			return false; }
			
	if (dataN.value == "") {
			alert("Campo Data de Nascimento esta em branco!");
			dataN.focus();
			return false; }
			
	if (login_pessoal.value == "") {
			alert("Campo Login esta em branco!");
			login_pessoal.focus();
			return false; }
			
	if (senha_numerica.value == "") {
			alert("Campo Senha esta em branco!");
			cpf.focus();
			return false; }
			
	if (endereco_res.value == "") {
			alert("Campo Endereço esta em branco!");
			endereco_res.focus();
			return false; }
			
	if (bairro_res.value == "") {
			alert("Campo Bairro esta em branco!");
			bairro_res.focus();
			return false; }
			
	if (cidade_res.value == "") {
			alert("Campo Cidade esta em branco!");
			cidade_res.focus();
			return false; }
			
	if (cep_res.value == "") {
			alert("Campo CEP esta em branco!");
			cep_res.focus();
			return false; }
			
	if (fone_res.value == "") {
			alert("Campo Telefone esta em branco!");
			cpf.focus();
			return false; }
			
	 } return true;
	
}

function ValidaCPF() {
	var i = 0;
	var n_checked = 0;
	var error = 0;
	var error_message = "";
	var CPF = document.form1.CPF.value;

	if (CPF.length != 11 || CPF == "00000000000" || CPF == "11111111111" || CPF == "22222222222" || CPF == "33333333333" || CPF == "44444444444" || CPF == "55555555555" || CPF == "66666666666" || CPF == "77777777777" || CPF == "88888888888" || CPF == "99999999999") {
		error_message = "Por favor digite um CPF válido!\n";
		error = 1;
	}
	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))) {
		error_message = "Por favor digite um CPF válido!\n";
		error = 1;
	}
	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))) {
		error_message = "Por favor digite um CPF válido!\n";
		error = 1;
	}
	if (error == 1) {
		alert(error_message);
		return false;
	} else {
		return true;
	}
}