var EsqSenWin; var doAll = (document.all!=null) var browserVer = parseInt(navigator.appVersion) >= 3 var tabAtual = ""; var ListElements = new Array(); ListElements[0] = "Organizacional"; ListElements[1] = "Email"; ListElements[2] = "Documento"; ListElements[3] = "Certificacao"; if(browserVer){ img1=new Image(); img1.src="./imagens/soe_cab_organizacional.gif"; img2=new Image(); img2.src="imagens/soe_cab_email.gif"; img3=new Image(); img3.src="./imagens/soe_cab_documento.gif"; img4=new Image(); img4.src="./imagens/soe_cab_certificacao.gif"; } if (self.parent.frames.length != 0) self.parent.location = document.location; if (top.frames.length != 0) top.location = self.document.location; function hideAllElement(x) { for ( i =0; i < ListElements.length; i++){ if(doAll) document.all[ListElements[i]].style.visibility = "hidden"; else document.getElementById(ListElements[i]).style.visibility = "hidden"; } if(doAll) document.all[x].style.visibility = "visible"; else document.getElementById(x).style.visibility = "visible"; } function trocaIMG(x,y,t) { tabAtual = t; document.getElementById('imgtop').src=y.src hideAllElement(x); } function selecionaCampo(campo) { campo.focus(); campo.select(); } function ajuda() { AjudaWin = window.open("../soe/ajuda.html","AjudaWin","width=500,height=450,scrollbars=yes"); AjudaWin.focus(); } function limpa(){ document.formPrinc.reset(); document.form1.reset(); document.form2.reset(); document.form3.reset(); document.form4.reset(); } function pesquisa(tab){ ok = false; if (tab == "1") ok = validaOrganizacional(); else if (tab == "2") ok = validaEmail(); else if (tab == "3") ok = validaDocumento(); else if (tab == "4") { validaCert(); chamadaApplet(); return true; } if (ok) document.formPrinc.submit(); } function validaOrganizacional() { var sMat = ""; if (document.form1.organizacao.value == "") { alert("Informe a organização."); selecionaCampo(document.form1.organizacao); return false; } if (document.form1.matricula.value == "") { alert("Informe a matrícula."); selecionaCampo(document.form1.matricula); return false; } else{ if (isNaN(document.form1.matricula.value)){ alert("A matrícula deve ser numérica."); selecionaCampo(document.form1.matricula); return false; } else { sMat = document.form1.matricula.value; if(sMat.indexOf(".")>0){ alert("A matrícula deve ser numérica, não deve ter ponto (.)"); selecionaCampo(document.form1.matricula); return false; } } } if (document.form1.senha.value == "") { alert("Informe a senha."); selecionaCampo(document.form1.senha); return false; } document.formPrinc.organizacao.value=document.form1.organizacao.value; document.formPrinc.matricula.value=document.form1.matricula.value; document.formPrinc.senha.value=document.form1.senha.value; document.formPrinc.tipoautenticacao.value = "1"; gravaCookie('Login','1'); return true; } function validaEmail() { if (document.form2.email.value == "") { alert("Informe o e-mail."); selecionaCampo(document.form2.email); return false; } if (document.form2.senhaEmail.value == "") { alert("Informe a senha."); document.form2.senhaEmail.focus(); return false; } document.formPrinc.email.value=document.form2.email.value; document.formPrinc.senhaemail.value=document.form2.senhaEmail.value; document.formPrinc.tipoautenticacao.value = "2"; gravaCookie('Login','2'); return true; } function validaDocumento() { if (document.form3.documento.value == "") { alert("Informe o documento."); document.form3.documento.focus(); return false; } else { if (validaCaracterEspecial(document.form3.documento.value,false)!=true){ alert("O documento deve ser alfanumérico."); document.form3.documento.focus(); return false; } } if (document.form3.tipoDocumento.value == "") { alert("Informe o tipo do documento."); document.form3.tipoDocumento.focus(); return false; } else { if(document.form3.tipoDocumento.value == "CPF"){ if (validaCPF(document.form3.documento.value) != true) { alert("CPF inválido."); document.form3.documento.focus(); return false; } } } if (document.form3.senhaDocumento.value == "") { alert("Informe a senha."); document.form3.senhaDocumento.focus(); return false; } document.formPrinc.documento.value=document.form3.documento.value; document.formPrinc.tipodocumento.value=document.form3.tipoDocumento.value; document.formPrinc.organizacaoDoc.value=document.form3.organizacaoDoc.value; document.formPrinc.senhadocumento.value=document.form3.senhaDocumento.value; document.formPrinc.tipoautenticacao.value = "3"; gravaCookie('Login','3'); return true; } function validaCert() { document.formPrinc.organizacaoDoc.value=document.form4.organizacaoDocC.value; document.formPrinc.tipoautenticacao.value = "4"; gravaCookie('Login','4'); return true; } function valida() { if (document.form1.organizacao.value == "" && document.form2.email.value == "" && document.form3.documento.value == "") { alert("Informe a sua identificação."); return false; } return true; } function gravaCookie(cookieName, value) { var today = new Date() var expires = new Date() // valid for 1 year expires.setTime(today.getTime() + 24*365*3600000) document.cookie = cookieName + "=" + value + "; " + " expires=" + expires.toGMTString() + " path=/"; } function pegaCookie(cookieName){ var arg = cookieName+"="; var alen = arg.length; var clen = document.cookie.length; var i=0; while(i90) || (meuChar>57 && meuChar<65)){ if(meuChar==32){ if(espaco==false){ flag = false; } } else{ flag = false; } } } return flag; } function validaCPF (CPF) { if (CPF.length < 11) { aux = "0000000000" + CPF; pos = aux.length - 11; CPF = aux.substr(pos,11); } if (CPF.length != 11 || CPF == "00000000000" || CPF == "11111111111" || CPF == "22222222222" || CPF == "33333333333" || CPF == "44444444444" || CPF == "55555555555" || CPF == "66666666666" || CPF == "77777777777" || CPF == "88888888888" || CPF == "99999999999") return false; soma = 0; for (i=0; i < 9; i ++) soma += parseInt(CPF.charAt(i)) * (10 - i); resto = 11 - (soma % 11); if (resto == 10 || resto == 11) resto = 0; if (resto != parseInt(CPF.charAt(9))) return false; soma = 0; for (i = 0; i < 10; i ++) soma += parseInt(CPF.charAt(i)) * (11 - i); resto = 11 - (soma % 11); if (resto == 10 || resto == 11) resto = 0; if (resto != parseInt(CPF.charAt(10))) return false; return true; } function MM_findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); } if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i