// JavaScript Document
/*----------------------------------Muda Cor---------------------------------------------*/
function mudacor(ref,cor){
  ref.style.backgroundColor=cor;
}
/*---------------------------------Texto Input-------------------------------------------*/
function set(field, val1, val2)
{
    if (field.value == val1) field.value = val2;
}
/*-----------------------------------CONTATO---------------------------------------------*/
 function vercontato(contato)
  {
  
  if (document.contato.nome.value=="")
  {
    alert("Preencha o campo Nome");
	contato.nome.focus();
	return (false);
  }
  
  
  if (document.contato.email.value=="")
  {
    alert("Preencha o campo E-mail");
	contato.email.focus();
	return (false);
  }
  
  
    if (document.contato.assunto.value=="")
  {
    alert("Preencha o campo Assunto");
	contato.assunto.focus();
	return (false);
  }
  
  if (document.contato.mensagem.value=="")
  {
    alert("Preencha o campo Mensagem");
	contato.mensagem.focus();
	return (false);
  }
  
 var a = document.contato.email.value
              
              if (a.indexOf("@")==-1 || a.indexOf(".")==-1)
              {
               alert("Preencha o e-mail corretamente"); 
			   contato.email.focus();
	           return (false);  
              }
  
  }
  
/*----------------------------------CADASTRO------------------------------------------*/
 function vercadastro(cadastro)
  {
  
  if (document.cadastro.nome.value=="")
  {
    alert("Preencha o campo Nome");
	cadastro.nome.focus();
	return (false);
  }
  
  
  if (document.cadastro.email.value=="")
  {
    alert("Preencha o campo E-mail");
	cadastro.email.focus();
	return (false);
  }
  
  
    if (document.cadastro.nascimento.value=="")
  {
    alert("Preencha o campo Nascimento");
	cadastro.nascimento.focus();
	return (false);
  }
  
  if (document.cadastro.telefone.value=="")
  {
    alert("Preencha o campo Telefone");
	cadastro.telefone.focus();
	return (false);
  }
  if (document.cadastro.telefone.value=="")
  {
    alert("Preencha o campo Telefone");
	cadastro.telefone.focus();
	return (false);
  }
  if (document.cadastro.endereco.value=="")
  {
    alert("Preencha o campo Endereço");
	cadastro.endereco.focus();
	return (false);
  }
  if (document.cadastro.bairro.value=="")
  {
    alert("Preencha o campo Bairro");
	cadastro.bairro.focus();
	return (false);
  }
  if (document.cadastro.estados.value=="selecione")
  {
    alert("Selecione algum Estado");
	cadastro.estados.focus();
	return (false);
  }
  if (document.cadastro.cep.value=="")
  {
    alert("Preencha o campo CEP");
	cadastro.cep.focus();
	return (false);
  }
 var a = document.cadastro.email.value
              
              if (a.indexOf("@")==-1 || a.indexOf(".")==-1)
              {
               alert("Preencha o e-mail corretamente"); 
			   cadastro.email.focus();
	           return (false);  
              }
  
  }