function valida_correcao(x){
	if(x.comentario.value == "" ){
		alert("Correção é campo obrigatório!");
		x.comentario.focus();
		return false;
	}
}


function validaCPF(x) {
                cpf = x.value;
                 erro = new String;
                if (cpf.length < 11) erro += "Sao necessarios 11 digitos para verificacao do CPF! \n\n"; 
                 var nonNumbers = /\D/;
                 if (nonNumbers.test(cpf)) erro += "A verificacao de CPF suporta apenas numeros! \n\n"; 
                if (cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || cpf == "88888888888" || cpf == "99999999999"){
                         erro += "Numero de CPF invalido!"
              }
               var a = [];
              var b = new Number;
               var c = 11;
               for (i=0; i<11; i++){
                       a[i] = cpf.charAt(i);
                       if (i < 9) b += (a[i] * --c);
               }
               if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11-x }
               b = 0;
               c = 11;
               for (y=0; y<10; y++) b += (a[y] * c--); 
               if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11-x; }
               if ((cpf.charAt(9) != a[9]) || (cpf.charAt(10) != a[10])){
                       erro +="Digito verificador com problema!";
               }
               if (erro.length > 0){
                       alert(erro);
                       return false;
               
			   }
			  return true;
       }


function valida_nota1(x){
	if(x.value > 4 ){
		alert("Valor Superior a 4.");
		x.focus();
		return false;
	}
}

function valida_nota2(x){
	if(x.value > 6 ){
		alert("Valor Superior a 6.");
		x.focus();
		return false;
	}
}

function valida_nota3(x){
	if(x.value > 10 ){
		alert("Valor Superior a 10.");
		x.focus();
		return false;
	}
}


function valida_inscr(x){
	if(x.conheceu.value == 0 ){
		alert("Conheceu é campo obrigatório");
		x.conheceu.focus();
		return false;
	}
	
}
function valida_ementa(x){
if(x.carga_horaria.value == "" ){
		alert("Carga horária é campo obrigatório");
		x.carga_horaria.focus();
		return false;
	}
	
	if(x.localizacao.value == ""){
			alert("Localizaçao é campo obrigatório");
			x.localizacao.focus();
			return false;
	}
	
	if(x.pre.value == ""){
			alert("Pré-requisitos é campo obrigatório");
			x.pre.focus();
			return false;
	}
	if(x.objetivo_geral.value == ""){
			alert("Objetivo geral é campo obrigatório");
			x.objetivo_geral.focus();
			return false;
		}
		if(x.objetivo_especifico.value == ""){
			alert("Objetivo específico é campo obrigatório");
			x.objetivo_especifico.focus();
			return false;
		}
		if(x.ementa.value == ""){
			alert("Ementa é campo obrigatório");
			x.ementa.focus();
			return false;
		}
		
	
}
function valida(x){
if(x.nome.value == "" ){
		alert("Nome é campo obrigatório");
		x.nome.focus();
		return false;
	}
	
	if(x.endereco.value == ""){
			alert("Endereço é campo obrigatório");
			x.endereco.focus();
			return false;
	}
	if(x.numero.value == "" ){
			alert("Número é campo obrigatório");
			x.numero.focus();
			return false;
		}else{
			
			if (isNaN(x.numero.value)) {
				alert("Número é campo numérico");
				x.numero.focus();
			   return false;
			 }
				
		}
	if(x.bairro.value == ""){
			alert("Bairro é campo obrigatório");
			x.bairro.focus();
			return false;
	}
	if(x.cidade.value == ""){
			alert("Cidade é campo obrigatório");
			x.cidade.focus();
			return false;
		}
		
	if( x.email.value == '' || x.email.value.indexOf('@', 0) == -1 || x.email.value.indexOf('.', 0) == -1 ){
			alert("Por favor, digite um e-mail válido.");
			x.email.focus();
			return false;
		}
	
		if(x.ddd.value == "" ){
			alert("DDD é campo obrigatório");
			x.ddd.focus();
			return false;
		}else{
			
			if (isNaN(x.ddd.value)) {
				alert("DDD é campo numérico");
				x.ddd.focus();
			   return false;
			 }
				
		}
		
		if(x.telefone.value == "" ){
			alert("Telefone é campo obrigatório");
			x.telefone.focus();
			return false;
			
		}
		
		if(x.cep.value == ""){
			alert("CEP é campo obrigatório");
			x.cep.focus();
			return false;
	
				
		}

}

function valida2(x){


	if(x.cpf.value == "" ){
		alert("CPF é campo obrigatório");
		x.cpf.focus();
		return false;
	}
	
	
}


function valida3(x){

	if(x.id_curso.value == 0 ){
		alert("Curso é campo obrigatório");
		x.id_curso.focus();
		return false;
	}
	
	if(x.nome.value == "" ){
		alert("Nome é campo obrigatório");
		x.nome.focus();
		return false;
	}
	if(x.cpf.value == ""){
		  alert("CPF é campo obrigatório ");
		  x.cpf.focus();
		  return false;
	}
	if(x.endereco.value == ""){
			alert("Endereço é campo obrigatório");
			x.endereco.focus();
			return false;
	}
	if(x.numero.value == "" ){
			alert("Número é campo obrigatório");
			x.numero.focus();
			return false;
		}else{
			
			if (isNaN(x.numero.value)) {
				alert("Número é campo numérico");
				x.numero.focus();
			   return false;
			 }
				
		}
	if(x.bairro.value == ""){
			alert("Bairro é campo obrigatório");
			x.bairro.focus();
			return false;
	}
	if(x.cidade.value == ""){
			alert("Cidade é campo obrigatório");
			x.cidade.focus();
			return false;
		}
		
	if( x.email.value == '' || x.email.value.indexOf('@', 0) == -1 || x.email.value.indexOf('.', 0) == -1 ){
			alert("Por favor, digite um e-mail válido.");
			x.email.focus();
			return false;
		}
	
		if(x.ddd.value == "" ){
			alert("DDD é campo obrigatório");
			x.ddd.focus();
			return false;
		}else{
			
			if (isNaN(x.ddd.value)) {
				alert("DDD é campo numérico");
				x.ddd.focus();
			   return false;
			 }
				
		}
		
		if(x.telefone.value == "" ){
			alert("Telefone é campo obrigatório");
			x.telefone.focus();
			return false;
			
		}
		
		if(x.cep.value == ""){
			alert("CEP é campo obrigatório");
			x.cep.focus();
			return false;
		
				
		}
	
	
}
function valida4(x){

	
	if(x.empresa.value == "" ){
		alert("Empresa é campo obrigatório");
		x.empresa.focus();
		return false;
	}
	
	if(x.endereco.value == ""){
			alert("Endereço é campo obrigatório");
			x.endereco.focus();
			return false;
	}
	if(x.numero.value == "" ){
			alert("Número é campo obrigatório");
			x.numero.focus();
			return false;
		}else{
			
			if (isNaN(x.numero.value)) {
				alert("Número é campo numérico");
				x.numero.focus();
			   return false;
			 }
				
		}
	if(x.bairro.value == ""){
			alert("Bairro é campo obrigatório");
			x.bairro.focus();
			return false;
	}
	if(x.cidade.value == ""){
			alert("Cidade é campo obrigatório");
			x.cidade.focus();
			return false;
		}
		
	if( x.email.value == '' || x.email.value.indexOf('@', 0) == -1 || x.email.value.indexOf('.', 0) == -1 ){
			alert("Por favor, digite um e-mail válido.");
			x.email.focus();
			return false;
		}
	
		if(x.ddd.value == "" ){
			alert("DDD é campo obrigatório");
			x.ddd.focus();
			return false;
		}else{
			
			if (isNaN(x.ddd.value)) {
				alert("DDD é campo numérico");
				x.ddd.focus();
			   return false;
			 }
				
		}
		
		if(x.telefone.value == "" ){
			alert("Telefone é campo obrigatório");
			x.telefone.focus();
			return false;
			
		}
		
		if(x.cep.value == ""){
			alert("CEP é campo obrigatório");
			x.cep.focus();
			return false;
		
				
		}
	
	if(x.contato.value == ""){
			alert("Contato é campo obrigatório");
			x.contato.focus();
			return false;
		}
		if(x.cargo.value == ""){
			alert("Cargo é campo obrigatório");
			x.cargo.focus();
			return false;
		}
}
function validaT(x){

	
	if(x.nome.value == "" ){
		alert("Nome é campo obrigatório");
		x.nome.focus();
		return false;
	}
	
	if(x.endereco.value == ""){
			alert("Endereço é campo obrigatório");
			x.endereco.focus();
			return false;
	}
	if(x.numero.value == "" ){
			alert("Número é campo obrigatório");
			x.numero.focus();
			return false;
		}else{
			
			if (isNaN(x.numero.value)) {
				alert("Número é campo numérico");
				x.numero.focus();
			   return false;
			 }
				
		}
	if(x.bairro.value == ""){
			alert("Bairro é campo obrigatório");
			x.bairro.focus();
			return false;
	}
	if(x.cidade.value == ""){
			alert("Cidade é campo obrigatório");
			x.cidade.focus();
			return false;
		}
		
	if( x.email.value == '' || x.email.value.indexOf('@', 0) == -1 || x.email.value.indexOf('.', 0) == -1 ){
			alert("Por favor, digite um e-mail válido.");
			x.email.focus();
			return false;
		}
	
		if(x.ddd.value == "" ){
			alert("DDD é campo obrigatório");
			x.ddd.focus();
			return false;
		}else{
			
			if (isNaN(x.ddd.value)) {
				alert("DDD é campo numérico");
				x.ddd.focus();
			   return false;
			 }
				
		}
		
		if(x.telefone.value == "" ){
			alert("Telefone é campo obrigatório");
			x.telefone.focus();
			return false;
			
		}
		
		if(x.cep.value == ""){
			alert("CEP é campo obrigatório");
			x.cep.focus();
			return false;
		
		}
	
	
}