// Contato

function Esvazia(valor_campo){
if (valor_campo.value == valor_campo.defaultValue){
valor_campo.value='';
}
}

function padrao(valor_campo){
if (valor_campo.value == ''){
valor_campo.value=valor_campo.defaultValue;
}
}

function EsvaziaText(){
if (document.getElementById("mensagem").value == "Mensagem"){
	document.getElementById("mensagem").value = "";
}
}

function padraoText(){
if (document.getElementById("mensagem").value == ""){
	document.getElementById("mensagem").value = "Mensagem";
}
}

function ValidaContato(){
	
	document.getElementById("data").style.backgroundColor="#FFF";
	document.getElementById("nome").style.backgroundColor="#FFF";
	document.getElementById("endereco").style.backgroundColor="#FFF";
	document.getElementById("cidade").style.backgroundColor="#FFF";
	document.getElementById("cep").style.backgroundColor="#FFF";
	document.getElementById("nascimento").style.backgroundColor="#FFF";
	document.getElementById("tel").style.backgroundColor="#FFF";
	document.getElementById("email").style.backgroundColor="#FFF";
	
	var emailER =/^[\w!#$%&'*+\/=?^`{|}~-]+(\.[\w!#$%&'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
			
		if(document.contato.data.value == "" || document.contato.data.value == "Data"){
			document.getElementById("avisocontato").innerHTML="INFORME A DATA";
			document.getElementById("data").style.backgroundColor="#9a161c";
			document.contato.data.focus();return false;
			}
			if(document.contato.nome.value == "" || document.contato.nome.value == "Nome"){
			document.getElementById("avisocontato").innerHTML="INFORME SEU NOME";
			document.getElementById("nome").style.backgroundColor="#9a161c";
			document.contato.nome.focus();return false;
			}
			if(document.contato.endereco.value == "" || document.contato.endereco.value == "Endereço"){
			document.getElementById("avisocontato").innerHTML="INFORME SEU ENDEREÇO";
			document.getElementById("endereco").style.backgroundColor="#9a161c";
			document.contato.endereco.focus();return false;
			}
			if(document.contato.cidade.value == "" || document.contato.cidade.value == "Cidade"){
			document.getElementById("avisocontato").innerHTML="INFORME SUA CIDADE";
			document.getElementById("cidade").style.backgroundColor="#9a161c";
			document.contato.cidade.focus();return false;
			}
			if(document.contato.cep.value == "" || document.contato.cep.value == "Cep"){
			document.getElementById("avisocontato").innerHTML="INFORME SEU CEP";
			document.getElementById("cep").style.backgroundColor="#9a161c";
			document.contato.cep.focus();return false;
			}
			if(document.contato.nascimento.value == "" || document.contato.nascimento.value == "Nascimento"){
			document.getElementById("avisocontato").innerHTML="INFORME A DATA DO SEU NASCIMENTO";
			document.getElementById("nascimento").style.backgroundColor="#9a161c";
			document.contato.nascimento.focus();return false;
			}
			if(document.contato.tel.value == "" || document.contato.tel.value == "Telefone"){
			document.getElementById("avisocontato").innerHTML="INFORME SEU TELEFONE";
			document.getElementById("tel").style.backgroundColor="#9a161c";
			document.contato.tel.focus();return false;
			}
			if(document.contato.email.value == "" || document.contato.email.value == "E-mail"){
			document.getElementById("avisocontato").innerHTML="INFORME SEU E-MAIL";
			document.getElementById("email").style.backgroundColor="#9a161c";
			document.contato.email.focus();return false;
			}
			if(!emailER.test(document.contato.email.value)){
			document.getElementById("avisocontato").innerHTML="INFORME UM E-MAIL VÁLIDO";
			document.getElementById("email").style.backgroundColor="#9a161c";
			document.contato.email.focus();return false;
			}
}


function ValidaExpress(){
	
	var emailER =/^[\w!#$%&'*+\/=?^`{|}~-]+(\.[\w!#$%&'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
	
			if(document.express.nome.value == "" || document.express.nome.value == "Nome"){
			document.getElementById("avisoexpress").innerHTML="INFORME SEU NOME";
			document.getElementById("nome").style.backgroundColor="#9a161c";
			document.express.nome.focus();return false;
			}
			
			if(document.express.email.value == "" || document.express.email.value == "E-mail"){
			document.getElementById("avisoexpress").innerHTML="INFORME SEU E-MAIL";
			document.getElementById("email").style.backgroundColor="#9a161c";
			document.express.email.focus();return false;
			}
			if(!emailER.test(document.express.email.value)){
			document.getElementById("avisoexpress").innerHTML="INFORME UM E-MAIL VÁLIDO";
			document.getElementById("email").style.backgroundColor="#9a161c";
			document.express.email.focus();return false;
			}
	
	
       marcado1=-1;
       for (i=0; i<document.express.tamanho.length; i++) {
               if (document.express.tamanho[i].checked) {
                       marcado1 = i
               }
       }
       if(marcado1==-1){
                       document.getElementById("avisoexpress").innerHTML="SELECIONE UM FORMATO (ITEM 1)";
                       return false;
                       }
					   
      
	   
	   
	   marcado2=-1;
       
       for (i=0; i<document.express.fotos.length; i++) {
               if (document.express.fotos[i].checked) {
                       marcado2 = i
               }
       }
       if(marcado2==-1){
                       document.getElementById("avisoexpress").innerHTML="SELECIONE UMA OPÇÃO (ITEM 2)";
                       return false;
                       }
		
		
     /*marcado3=-1; 
    for(i=0; i < document.express.imagina.length; i++){
                if(document.express.imagina[i].checked) {
                    marcado3 = i;
                }
       }
       if(marcado3==-1){
                       document.getElementById("avisoexpress").innerHTML="SELECIONE UMA OPÇÃO (ITEM 3)";
                       return false;
                       }*/
					   
					   
					   
					   
		marcado4=-1;
      
       for (i=0; i<document.express.capa.length; i++) {
               if (document.express.capa[i].checked) {
                       marcado4 = i
               }
       }
       if(marcado4==-1){
                       document.getElementById("avisoexpress").innerHTML="SELECIONE UMA OPÇÃO (ITEM 4)";
                       return false;
                       }
					
					
					   		   
		if (document.express.aceito.checked==0) {
			document.getElementById("avisoexpress").innerHTML="VOCÊ DEVE ACEITAR OS TERMOS";
			return false;
		}


}
