/*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('frmFaleConosco'); if(trim(form.NOME.value)==""){ alert('Campo Nome vazio!'); form.NOME.focus(); return false; } if(trim(form.FONE.value)==""){ alert('Campo Telefone vazio!'); form.FONE.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*/ /*Limpa Formulário*/ function checkFormClear(){ var form = document.getElementById('frContato'); form.document.reset(); } /*Fim Limpa Formulário*/ function trocaClasse(){ if (document.getElementById('conteudo')){ document.getElementById('conteudo').className = 'internas' } } function trocaClasseMn(){ if (document.getElementById('cx_central')){ document.getElementById('cx_central').className = 'internas' } } function trocaClasseBs(){ if (document.getElementById('base')){ document.getElementById('base').className = 'internas' } } function trocaClasseLg(){ if (document.getElementById('logo')){ document.getElementById('logo').className = 'internas' } } function openSendWin(id) { window.open('/neophoto/send.php?id='+id, '', 'width=330, height=300, scrollbars=yes'); } /* Combo de paginação do neoCast */ function neoCast_ChPage(comboSelect){ var section = document.getElementById('section').value; var search = document.getElementById('castSearchInput').value; var newPage = comboSelect[comboSelect.selectedIndex].value; ajax('conteudo','neocast/list.php?section='+section+'&page='+newPage+'&castSearchInput='+search,null); } /* Fim Combo de paginação do neoCast */ /* Enviar para um amigo - neoCast */ function checkFieldsEnviarAmigo() { form = document.getElementById('frmEnviaAmigo'); if(trim(form.seuNome.value) == '') { alert('Informe o nome'); form.seuNome.focus(); return false; } if(!isMail(trim(form.seuEmail.value))) { alert('Informe o email'); form.seuEmail.focus(); return false; } if(trim(form.amigoNome.value) == '') { alert('Informe o nome'); form.amigoNome.focus(); return false; } if(!isMail(trim(form.amigoEmail.value))) { alert('Informe o email'); form.amigoEmail.focus(); return false; } return true; } /* Fim Enviar para um amigo - neoCast */ /* Form Recrutamento */ function checkFormRecrutamento() { form = document.getElementById('frRecruta'); if(trim(form.NOME.value) == '') { alert('Informe o Nome'); form.NOME.focus(); return false; } if(trim(form.EMAIL.value) == '') { alert('Informe o E-mail'); form.EMAIL.focus(); return false; } if(trim(form.END.value) == '') { alert('Informe o Endereço'); form.END.focus(); return false; } if(trim(form.BAIRRO.value) == '') { alert('Informe o Bairro'); form.BAIRRO.focus(); return false; } if(trim(form.CEP.value) == '') { alert('Informe o CEP'); form.CEP.focus(); return false; } if(trim(form.TELEFONE.value) == '') { alert('Informe o Telefone'); form.TELEFONE.focus(); return false; } if(trim(form.CELULAR.value) == '') { alert('Informe o Celular'); form.CELULAR.focus(); return false; } if(trim(form.RG.value) == '') { alert('Informe o RG'); form.RG.focus(); return false; } if(trim(form.CIC.value) == '') { alert('Informe o CIC'); form.CIC.focus(); return false; } if(trim(form.NASCIMENTO.value) == '') { alert('Informe o Nascimento'); form.NASCIMENTO.focus(); return false; } var num = form.elements.length; cont = 0; for (var i = 0; i < num; i++) { if (form.elements[i].type == 'radio') { var radio = form.elements[i]; if (radio.checked == true){ cont++; } } } if (cont < 19){ alert('Preencha todos os campos do formulário Anamnese'); return false; } if(form.EXISTE_ALGUM_PROBLEMA_QUE_JULGUE_NECESSARIO_INFORMAR[0].checked){ if(trim(form.EXISTE_ALGUM_PROBLEMA_QUE_JULGUE_SER_NECESSARIO_QUE_QUEIRA_RELATAR.value) == '') { alert('Preencha o campo EXISTE ALGUM PROBLEMA QUE JULGUE SER NECESSARIO QUE QUEIRA RELATAR'); form.EXISTE_ALGUM_PROBLEMA_QUE_JULGUE_SER_NECESSARIO_QUE_QUEIRA_RELATAR.focus(); return false; } } return true; } /* Fim Form Recrutamento */ /* Função que lista os arquivos para uma determinada categoria escolhida */ function neoDownload_ChPage(){ url = "neoDownload/listaArquivos.php?category=" + document.getElementById('category').value; ajaxSendRequest ('ND_Arquivos', url, null); } /* Fim da Função que lista os arquivos para uma determinada categoria escolhida */