/*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*/ /*Pesquisa do neoCast*/ function neoCast_SearchByKeyCode(KeyCode){ var section = document.getElementById('section').value; if (KeyCode == 13 && section > 0) { //event.keyCode = null; ajaxSendRequest('conteudo','neocast/list.php?castSearchInput='+document.getElementById('castSearchInput').value+'§ion='+section,null); } } /*Fim Pesquisa do neoCast*/ /*Combo de paginação do neoCast*/ function neoCast_ChPage(comboSelect){ var section = document.getElementById('section').value; var newPage = comboSelect[comboSelect.selectedIndex].value; ajaxSendRequest('conteudo','neocast/list.php?section='+section+'&page='+newPage,null); } /*Fim Combo de paginação do neoCast*/ /*Combo de paginação do neoCast para a busca*/ function neoCast_ChPageBusca(comboSelect){ var newPage = comboSelect[comboSelect.selectedIndex].value; var search = document.getElementById('search').value; url = "index.php?neoAjax=css/busca&search="+search+"&page="+newPage; document.location.href = url; } /*Fim Combo de paginação do neoCast*/ /*Combo de paginação do neoCast para a busca*/ function neoCast_Busca(){ var search = document.getElementById('txtBuscar').value; url = "index.php?neoAjax=css/busca&search="+search+"&page=0"; document.location.href = url; } /*Fim Combo de paginação do neoCast*/ /*Combo de paginação do neoCast para a busca*/ function neoCast_BuscaByKeyCode(keyCode){ if (keyCode == 13) { var search = document.getElementById('txtBuscar').value; url = "index.php?neoAjax=css/busca&search="+search+"&page=0"; document.location.href = url; return false; } } /*Fim Combo de paginação do neoCast*/ /*Validação do formulário de contato*/ function checkFormContato(){ //form = document.frFale; form = document.getElementById('frFale'); if(trim(form.NOME.value) == '') { alert('Informe o nome'); form.NOME.focus(); return false; } if(!isMail(trim(form.EMAIL.value))) { alert('Informe o email'); form.EMAIL.focus(); return false; } if(trim(form.FONE.value) == '') { alert('Informe o DDD e o Telefone'); form.NOME.focus(); return false; } if(trim(form.CIDADE.value) == '') { alert('Informe a cidade'); form.NOME.focus(); return false; } if(trim(form.MENSAGEM.value) == '') { alert('Informe a mensagem'); form.NOME.focus(); return false; } if (document.getElementById("ESCOLHA").value == 3) { form.action = 'trabalharConosco.php'; } else { form.action = 'neoMailer/action.php'; } form.submit(); return true; } /*Fim Validação do formulário de contato*/ /*Monta o formulário de contato de acordo com o tipo escolhido*/ function selecionaFormContato() { if (document.getElementById("ESCOLHA").value == 3) { document.getElementById("NOME_EMPRESA").style.display = "none"; document.getElementById("LNOME_EMPRESA").style.display = "none"; document.getElementById("RAMO_ATIVIDADE").style.display = "none"; document.getElementById("LRAMO_ATIVIDADE").style.display = "none"; document.getElementById("CURRICULO").style.display = "block"; document.getElementById("LCURRICULO").style.display = "block"; } else { document.getElementById("NOME_EMPRESA").style.display = "block"; document.getElementById("LNOME_EMPRESA").style.display = "block"; document.getElementById("RAMO_ATIVIDADE").style.display = "block"; document.getElementById("LRAMO_ATIVIDADE").style.display = "block"; document.getElementById("CURRICULO").style.display = "none"; document.getElementById("LCURRICULO").style.display = "none"; } } /*Fim Monta o formulário de contato de acordo com o tipo escolhido*/ /*Cadastra-se newsLetter*/ function openSubscriberWindow() { var obj = document.getElementById('newsletter'); var regex = new RegExp('^([\.a-zA-Z0-9_-]+)@([\.a-zA-Z0-9_-]){1,}[\.]{1,1}[a-zA-Z]{2,3}$'); if(!regex.test(obj.value)) { alert('Endereço de email inválido!'); return false; } //showModalDialog('/neocast/subscriber.php?view=$view&subscriberMail='+obj.value, '', 'dialogWidth:350px; dialogHeight:350px; center:yes; help:no; resizable:no; status: no; scroll:no'); window.open('/neocast/subscriber.php?view=$view&subscriberMail='+obj.value, '', 'width=500, height=400, scrollbars=yes, resizable:no, scroll:no, location:no'); obj.value = ''; } /*Fim Cadastra-se newsLetter*/ /*Abre popUp*/ function popUp (x, y) { var t = window.open ('' , 'window', 'width=' + x + ',height=' + y + ',scrollbars=yes'); t.focus(); } /*Fim Abre popUp*/ function abreM(url,janela,scroll,W,H,T,L){ if (W==0){ W = eval(screen.width)-30; } if (H==0){ H = eval(screen.height)-90; } if (T==0){ T = Math.round((eval(screen.height)-H)/2); } if (L==0){ L = Math.round((eval(screen.width)-W)/2); } if (wnd=window.open(url,janela,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable=yes,copyhistory=no,width="+W+",height="+H+",top="+T+",left="+L)){ return wnd; }else{ return false; } } function checaSelecionado() { if (document.edit_os.ID_STATUS.value == -1) alert('Selecione uma opção.'); else { //document.edit_os.action = "edit_os.action.php"; var w = abreM('','janelaOperacoes','yes',650,400,0,0); if (w){ document.edit_os.action="edit_os.action.php"; document.edit_os.target="janelaOperacoes"; document.edit_os.submit(); w.focus(); } return; } } function checkFormOnIndex(){ var d = document.frAcesso var option = d.options[d.options.selectedIndex].value var user = d.user.value var pass = d.pass.value if(user!=''&& pass!='' || user!='Usuário' && pass!='Senha'){ if(option=='AR'){ url = "neoOS/login.php?nologin="+user+"&nosenha="+pass //url = "neoOS/login.php" //document.frAcesso.action = url; //document.frAcesso.nologin = user; //document.frAcesso.nosenha = pass; //document.frAcesso.submit(); //alert('submit'); window.open(url,"window","width=1024,height=1000,titlebar=no") return true } } else{ if(!user){ alert('Campo usuário em branco!') return false } if(!pass){ alert('Campo usuário senha em branco!') return false } } }