function valida(x){
	if(x.matricula.value == ""){
		alert("Matrícula é campo obrigatório");
		x.matricula.focus();
		return false;
	}
	if(x.senha.value == ""){
		alert("Senha é campo obrigatório");
		x.senha.focus();
		return false;
	}


}

function valida_artigo(x){

	if(x.titulo.value == "" ){
		alert("Título é campo obrigatório");
		x.titulo.focus();
		return false;
	}
	
	
	if(x.texto.value == "" ){
		alert("Texto é campo obrigatório");
		x.texto.focus();
		return false;
	}
	

	
}
function valida2(x){
	
	
		if(x.num_carteira.value == ""){
			alert("No Carteira é campo obrigatório");
			x.num_carteira.focus();
			return false;
		}
		if(x.nome.value == ""){
			alert("Paciente é campo obrigatório");
			x.nome.focus();
			return false;
		}
		if(x.ddd.value == "" ){
			alert("DDD é campo obrigatório");
			x.ddd.focus();
			return false;
			
		}
		if(x.telefone.value == "" ){
			alert("Telefone é campo obrigatório");
			x.telefone.focus();
			return false;
			
		}
		if(x.titular.value == ""){
			alert("Nome do titular é campo obrigatório");
			x.titular.focus();
			return false;
		}
		
		
}		
function valida3(x){

		if(x.tabela.value == ""){
			alert("Tabela é campo obrigatório");
			x.tabela.focus();
			return false;
		}
		if(x.cod_proc.value == ""){
			alert("Código é campo obrigatório");
			x.cod_proc.focus();
			return false;
		}
		if(x.descricao.value == "" ){
			alert("Descriçao é campo obrigatório");
			x.descricao.focus();
			return false;
		}
		if(x.dente.value == ""  ){
			alert("Dente é campo obrigatório");
			x.dente.focus();
			return false;
		}
		if(x.face.value == ""  ){
			alert("Face é campo obrigatório");
			x.face.focus();
			return false;
		}
		
		
		if(x.qtd.value == "" ){
			alert("Quantidade é campo obrigatório");
			x.qtd.focus();
			return false;
	}else{
			
			if (isNaN(x.qtd.value)) {
				alert("Quantidade é campo numérico");
				x.qtd.focus();
			   return false;
			 }
				
	}
		
		
}	
function valida_pre($x){
	
	
	
	if(x.nome.value == "" ){
		alert("Dentista é campo obrigatório");
		x.nome.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.cro.value == "" ){
		alert("CRO é campo obrigatório");
		x.cro.focus();
		return false;
	}
	
	if(x.uf_cro.value == "" ){
		alert("UF do CRO é campo obrigatório");
		x.uf_cro.focus();
		return false;
	}
	
	
	if(x.cbos.value == 0 ){
		alert("cbos é campo obrigatório");
		x.cbos.focus();
		return false;
	}	
	if(x.cpf.value == ""){
			alert("CPF é campo obrigatório");
			x.cpf.focus();
			return false;
	}
			
	if(x.id_estado.value == 0 ){
		alert("Estado é campo obrigatório");
		x.id_estado.focus();
		return false;
	}
	if(x.id_cidade.value == 0 ){
		alert("Cidade é campo obrigatório");
		x.id_cidade.focus();
		return false;
	}
	if(x.endereco.value == ""){
			alert("Endereço é campo obrigatório");
			x.endereco.focus();
			return false;
	}
	
	
	
		if(x.cep.value == ""){
			alert("CEP é campo obrigatório");
			x.cep.focus();
			return false;
		}else{
			
			if (isNaN(x.cep.value)) {
				alert("CEP é campo numérico");
				x.cep.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;
			
		}
		
		
	
	

	
	
}

function valida_associe($x){
	
	
	
	if(x.nome.value == "" ){
		alert("Dentista é campo obrigatório");
		x.nome.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.id_estado.value == 0 ){
		alert("Estado é campo obrigatório");
		x.id_estado.focus();
		return false;
	}
	if(x.id_cidade.value == 0 ){
		alert("Cidade é campo obrigatório");
		x.id_cidade.focus();
		return false;
	}		
		
	if(x.endereco.value == ""){
			alert("Endereço é campo obrigatório");
			x.endereco.focus();
			return false;
	}
	
	
	
		if(x.cep.value == ""){
			alert("CEP é campo obrigatório");
			x.cep.focus();
			return false;
		}else{
			
			if (isNaN(x.cep.value)) {
				alert("CEP é campo numérico");
				x.cep.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;
			
		}
		
		
	
	

	
	
}
function valida_contato(x){

	if(x.contato.value == "" ){
		alert("Contato é campo obrigatório");
		x.contato.focus();
		return false;
	}
	
	
	if(x.nome.value == "" ){
		alert("Nome é campo obrigatório");
		x.nome.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.endereco.value == ""){
			alert("Endereço é campo obrigatório");
			x.endereco.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.uf.value == ""){
			alert("Estado é campo obrigatório");
			x.uh.focus();
			return false;
	}
	
	
	if(x.cep.value == ""){
			alert("CEP é campo obrigatório");
			x.cep.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.fone.value == "" ){
			alert("Telefone é campo obrigatório");
			x.fone.focus();
			return false;
			
		}
		
		
	
	
		
	if(x.informacoes.value == ""){
			alert("Mensagem é campo obrigatório");
			x.informacoes.focus();
			return false;
	}	
		
	
	
}
function valida_corretor(x){

	
	
	if(x.nome.value == ""){
		alert("Nome é campo obrigatório");
		x.nome.focus();
		return false;
	}
	
	if(x.empresa.value == ""){
		alert("Empresa é campo obrigatório");
		x.empresa.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.endereco.value == ""){
			alert("Endereço é campo obrigatório");
			x.endereco.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.uf.value == ""){
			alert("Estado é campo obrigatório");
			x.uh.focus();
			return false;
	}
	
	
	if(x.cep.value == ""){
			alert("CEP é campo obrigatório");
			x.cep.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;
			
		}
	

		
	
	
}
function valida_mini_contato(x){

	
	
	if(x.nome.value == "" || x.nome.value == "Seu nome"){
		alert("Nome é campo obrigatório");
		x.nome.focus();
		return false;
	}
	
	
	if(x.ddd.value == ""  || x.ddd.value == "DDD"){
			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 == ""   || x.telefone.value == "Seu Telefone"){
			alert("Telefone é campo obrigatório");
			x.telefone.focus();
			return false;
			
		}
	
	
	
	if( x.email.value == '' || x.email.value == 'Seu E-mail' || 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.informacoes.value == ""){
			alert("Mensagem é campo obrigatório");
			x.informacoes.focus();
			return false;
	}	
		
	
	
}