// Funções gerais function toggleMe(a){ var e=document.getElementById(a); if(!e) { return true; } if((e.style.display=="none")||(e.style.display=="")){ e.style.display="block" } else{ e.style.display="none" } return true; } function ValidacaoEmail(value) { return (value == "" || value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) != -1); } function TiraValue(){ if(document.busca.q.value == ''){ document.busca.q.value==""; } } function ColocaValue(){ if(document.busca.q.value == ''){ document.busca.q.value=""; } } function validaEnviaNews(){ if(document.formEnviaNews.seunome.value==""){ alert("Por favor, preencha o campo: 'Seu Nome'."); document.formEnviaNews.seunome.focus(); return false; } if(document.formEnviaNews.seuemail.value==""){ alert("Por favor, preencha o campo: 'Seu e-mail'."); document.formEnviaNews.seuemail.focus(); return false; } if(ValidacaoEmail(document.formEnviaNews.seuemail.value)==""){ alert("Por favor, preencha o campo: 'Seu e-mail' corretamente."); document.formEnviaNews.seuemail.focus(); return false; } if(document.formEnviaNews.destinatario.value==""){ alert("Por favor, preencha o campo: 'Destinatário'."); document.formEnviaNews.destinatario.focus(); return false; } if(document.formEnviaNews.emaildestinatario.value==""){ alert("Por favor, preencha o campo: 'E-mail'."); document.formEnviaNews.emaildestinatario.focus(); return false; } if(ValidacaoEmail(document.formEnviaNews.emaildestinatario.value)==""){ alert("Por favor, preencha o campo: 'E-mail' corretamente."); document.formEnviaNews.emaildestinatario.focus(); return false; } var url = 'ajaxEnviaNews.php?seunome='+document.formEnviaNews.seunome.value+ '&seuemail='+document.formEnviaNews.seuemail.value+ '&destinatario='+document.formEnviaNews.destinatario.value+ '&emaildestinatario='+document.formEnviaNews.emaildestinatario.value+ '&codnoticia='+document.formEnviaNews.codnoticia.value+ '&endereco_pag='+document.formEnviaNews.endereco_pag.value; ajaxEnviaNews('form-envie', url); } /* Funções para chamar AJAX *****************************************************************************/ function ajaxEnviaNews(idobj, endereco){ ajaxHTML(idobj, endereco); } function mudaConteudoProd(area, codproduto, codaux){ if(area == 7){ document.getElementById('galeriaContainer').style.display="block"; document.getElementById('conteudoProduto').innerHTML = ""; } else{ document.getElementById('galeriaContainer').style.display="none"; ajaxHTML("conteudoProduto", "ajaxDetProduto.php?area="+area+"&codproduto="+codproduto+"&codaux="+codaux); } if(document.getElementById('1')) document.getElementById('1').style.color="#999"; if(document.getElementById('2')) document.getElementById('2').style.color="#999"; if(document.getElementById('3')) document.getElementById('3').style.color="#999"; if(document.getElementById('4')) document.getElementById('4').style.color="#999"; if(document.getElementById('5')) document.getElementById('5').style.color="#999"; if(document.getElementById('6')) document.getElementById('6').style.color="#999"; if(document.getElementById('7')) document.getElementById('7').style.color="#999"; if(document.getElementById(area)) document.getElementById(area).style.color="#000"; if(document.getElementById('1')) document.getElementById('1').style.borderBottom="1px solid #aaa"; if(document.getElementById('2')) document.getElementById('2').style.borderBottom="1px solid #aaa"; if(document.getElementById('3')) document.getElementById('3').style.borderBottom="1px solid #aaa"; if(document.getElementById('4')) document.getElementById('4').style.borderBottom="1px solid #aaa"; if(document.getElementById('5')) document.getElementById('5').style.borderBottom="1px solid #aaa"; if(document.getElementById('6')) document.getElementById('6').style.borderBottom="1px solid #aaa"; if(document.getElementById('7')) document.getElementById('7').style.borderBottom="1px solid #aaa"; if(document.getElementById(area)) document.getElementById(area).style.borderBottom="1px dashed #000"; }