function showPhotos(idObj,action){ var domDiv = document.getElementById(idObj) /*action = 1 mostra div com a listagem das fotos action = 0 esconde a div com a listagem das fotos */ switch(action){ case 0: domDiv.style.display = 'none' break case 1: domDiv.style.display = 'block' break default: break } } /*Checa o email*/ function isMail(string) { var reg = new RegExp('^([\.a-zA-Z0-9_-]+)@([\.a-zA-Z0-9_-]){1,}[\.]{1,1}[a-zA-Z]{2,3}$'); if (!reg.test(string)) return false; return true; } /*Fim Checa o email*/ /*Tira os espaços em branco*/ function trim(sString) { while (sString.substring(0,1) == ' ') { sString = sString.substring(1, sString.length); } while (sString.substring(sString.length-1, sString.length) == ' ') { sString = sString.substring(0,sString.length-1); } return sString; } /*Fim Tira os espaços em branco*/ /*Validação do formulário de contato*/ function checkFormFaleConosco(){ var form = document.getElementById('frContato'); if(trim(form.nome.value)==""){ alert('Campo Nome vazio!'); form.nome.focus(); return false; } if(trim(form.email.value)==""){ alert('Campo E-Mail vazio!'); form.email.focus(); return false; } else{ if(!isMail(form.email.value)){ alert('E-Mail inválido!'); form.email.focus(); return false; } } return true; } /*Fim Validação do formulário de contato*/ /*Validação do formulário de contato*/ function checkFormContato(){ var form = document.getElementById('frContato'); if(trim(form.nome.value)==""){ alert('Campo Nome vazio!'); form.nome.focus(); return false; } if(trim(form.email.value)==""){ alert('Campo E-Mail vazio!'); form.email.focus(); return false; } else{ if(!isMail(form.email.value)){ alert('E-Mail inválido!'); form.email.focus(); return false; } } if(trim(form.mensagem.value)==""){ alert('Campo Mensagem vazio!'); form.mensagem.focus(); return false; } return true; } /*Fim Validação do formulário de contato*/ /*Limpa Formulário*/ function checkFormClear(){ var form = document.getElementById('frContato'); form.document.reset(); } /*Fim Limpa Formulário*/ /*Abre popup*/ function openSendWin_lago(id) { window.open('/neophoto_lago/send.php?id='+id, '', 'width=330, height=300, scrollbars=yes'); } function openSendWin_cases(id) { window.open('/neophoto_cases/send.php?id='+id, '', 'width=330, height=300, scrollbars=yes'); } /* */ function neophotoNavigate_lago(id) { ajaxSendRequest('imagem','../neophoto_lago/modal2.php?id='+id,null); } function neophotoNavigate_cases(id) { ajaxSendRequest('imagem','/neophoto_cases/modal2.php?id='+id,null); } function trocaClasse(){ if (document.getElementById('conteudo')){ document.getElementById('conteudo').className = 'cont_internas' } } function trocaClasseProduto(){ if (document.getElementById('conteudo')){ document.getElementById('conteudo').className = 'cont_produtos' } } function mostraConteudo(acao) { document.getElementById('conteudoProd').className = acao; } /* Função que verifica o campo usuario e senha */ function verifica_login(){ var email = document.getElementById('seu_email'); var senha = document.getElementById('sua_senha'); if (email.value == "") { alert("O Campo 'Seu e-mail' não está preenchido!"); email.focus(); return false; } if (senha.value == "") { alert("O Campo 'Senha' não está preenchido!"); senha.focus(); return false; } return true; //ajaxSendRequest('conteudo','cadastro/login.php?senha='+senha.value,document.auth); //ajaxSendRequest('login','usuario.php',null); } /* Função que verifica o campo usuario e senha */ function verifica_usuario_capa(){ var email = document.getElementById('email'); var senha = document.getElementById('senha'); if (email.value == "") { alert("O Campo 'Login' não está preenchido!"); email.focus(); return false; } if (senha.value == "") { alert("O Campo 'Senha' não está preenchido!"); senha.focus(); return false; } /* ajaxSendRequest('conteudo','cadastro/login.php?email='+email.value+'&senha='+senha.value,document.frLogin); ajaxSendRequest('login','usuario.php',null); */ } /* Fim da Função que verifica o campo usuario e senha */ function submitItem(item,id_imagem,id_tipo){ var qtde = document.getElementById('qtdes'); var tipo = document.getElementById('modelo'); var preco = document.getElementById('precos'); if (qtde.value == '' || qtde.value == '0'){ qtde.focus(); alert('Quantidade desejada vazia!'); } else { var url = 'produtos_kart.php?add_item='+item+'&qtd='+qtde.value+'&tipo='+tipo.value+'&id_tipo='+id_tipo+'&id_imagem='+id_imagem+'&preco='+preco.value; window.open(url,'Produtos','width=540,height=500,scrollbars=yes'); } } function submitItens(id_item){ var id = id_item.split("_"); var total = id.length-1; var qtde = 0; var qtde_item = ""; id_item = ""; for(var i = 0; i < total; i++) { qtde = document.getElementById('qtde'+id[i]); if (qtde.value != '' && qtde.value != '0') { id_item = id_item + id[i] + "_"; qtde_item = qtde_item + qtde.value + "_"; } } var url = 'produtos_kart.php?add_item='+id_item+'&qtd='+qtde_item; window.open(url,'Produtos','width=540,height=500,scrollbars=yes'); } function submitItemLista(item,lista){ var qtde = document.getElementById('qtdes'); var tipo = document.getElementById('modelo'); var preco = document.getElementById('precos'); if (qtde.value == '' || qtde.value == '0'){ qtde.focus(); alert('Quantidade desejada vazia!'); } else { var url = 'produtos_kart.php?add_item='+item+'&add_lista='+lista+'&qtd='+qtde.value+'&tipo='+tipo.value+'&preco='+preco.value; window.open(url,'Produtos','width=540,height=500,scrollbars=yes'); } } function ow(url){ window.open(url,'Produtos','width=540,height=500,scrollbars=yes'); } /* Função de validação do formulário de cadastro na área restrita */ function cadastroAreaRest(){ form = document.getElementById("frAreaRest"); if (trim(form.NOME.value) == "") { alert("O Campo 'Nome' não está preenchido!"); form.NOME.select(); return false; } if(! isMail(trim(form.EMAIL.value))) { alert('Informe o e-mail!'); form.EMAIL.focus(); return false; } if (trim(form.CPF.value) == "") { alert("O Campo 'CPF' não está preenchido!"); form.CPF.select(); return false; } if (trim(form.ENDERECO.value) == "") { alert("O Campo 'Endereço' não está preenchido!"); form.ENDERECO.select(); return false; } if (trim(form.BAIRRO.value) == "") { alert("O Campo 'Bairro' não está preenchido!"); form.BAIRRO.select(); return false; } if (trim(form.CIDADE.value) == "") { alert("O Campo 'Cidade' não está preenchido!"); form.CIDADE.select(); return false; } if (trim(form.UF.value) == "Selecione") { alert("O Campo 'Estado' não está preenchido!"); form.UF.focus(); return false; } if (trim(form.CEP.value) == "") { alert("O Campo 'CEP' não está preenchido!"); form.CEP.select(); return false; } if (trim(form.FONE.value) == "") { alert("O Campo 'Telefone' não está preenchido!"); form.FONE.select(); return false; } if (trim(form.SENHA.value) == "") { alert("O Campo 'Senha' não está preenchido!"); form.SENHA.select(); return false; } if (trim(form.CSENHA.value) == "") { alert("O Campo 'Confirmar Senha' não está preenchido!"); form.CSENHA.select(); return false; } if (trim(form.SENHA.value) != trim(form.CSENHA.value)) { alert("Favor confirmar a senha corretamente!"); form.CSENHA.focus(); return false; } trocaClasse(); //window.alert('Cadastro efetuado com sucesso! Aguarde aprovação e a senha será enviada por e-mail!'); return true; } /* Fim da função de validação do formulário de cadastro na área restrita */ function seleciona(busca) { if (busca == 1){ document.getElementById("casamento").style.display = "block"; document.getElementById("bar").style.display = "none"; document.getElementById("cozinha").style.display = "none"; document.getElementById("house").style.display = "none"; document.getElementById("enxoval").style.display = "none"; document.getElementById("aniversario").style.display = "none"; document.getElementById("bebe").style.display = "none"; } if (busca == 2){ document.getElementById("casamento").style.display = "none"; document.getElementById("bar").style.display = "block"; document.getElementById("cozinha").style.display = "none"; document.getElementById("house").style.display = "none"; document.getElementById("enxoval").style.display = "none"; document.getElementById("aniversario").style.display = "none"; document.getElementById("bebe").style.display = "none"; } if (busca == 3){ document.getElementById("casamento").style.display = "none"; document.getElementById("bar").style.display = "none"; document.getElementById("cozinha").style.display = "block"; document.getElementById("house").style.display = "none"; document.getElementById("enxoval").style.display = "none"; document.getElementById("aniversario").style.display = "none"; document.getElementById("bebe").style.display = "none"; } if (busca == 4){ document.getElementById("casamento").style.display = "none"; document.getElementById("bar").style.display = "none"; document.getElementById("cozinha").style.display = "none"; document.getElementById("house").style.display = "block"; document.getElementById("enxoval").style.display = "none"; document.getElementById("aniversario").style.display = "none"; document.getElementById("bebe").style.display = "none"; } if (busca == 5){ document.getElementById("casamento").style.display = "none"; document.getElementById("bar").style.display = "none"; document.getElementById("cozinha").style.display = "none"; document.getElementById("house").style.display = "none"; document.getElementById("enxoval").style.display = "block"; document.getElementById("aniversario").style.display = "none"; document.getElementById("bebe").style.display = "none"; } if (busca == 6){ document.getElementById("casamento").style.display = "none"; document.getElementById("bar").style.display = "none"; document.getElementById("cozinha").style.display = "none"; document.getElementById("house").style.display = "none"; document.getElementById("enxoval").style.display = "none"; document.getElementById("aniversario").style.display = "block"; document.getElementById("bebe").style.display = "none"; } if (busca == 7){ document.getElementById("casamento").style.display = "none"; document.getElementById("bar").style.display = "none"; document.getElementById("cozinha").style.display = "none"; document.getElementById("house").style.display = "none"; document.getElementById("enxoval").style.display = "none"; document.getElementById("aniversario").style.display = "none"; document.getElementById("bebe").style.display = "block"; } } function TiraValue(id){ if(document.getElementById(id).value == document.getElementById(id).defaultValue){ document.getElementById(id).value = ""; } } function ColocaValue(id){ if(document.getElementById(id).value == ''){ document.getElementById(id).value = document.getElementById(id).defaultValue; } }