Rev 182 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 179 | espaco | 1 | function setCookie(c_name,value,expiredays) |
| 2 | {var exdate=new Date() |
||
| 3 | exdate.setDate(exdate.getDate()+expiredays) |
||
| 4 | document.cookie=c_name+"="+escape(value)+((expiredays==null)?"":";expires="+exdate.toGMTString())+";path=/aapf/";} |
||
| 5 | function getCookie(c_name) |
||
| 6 | {if(document.cookie.length>0) |
||
| 7 | {c_start=document.cookie.indexOf(c_name+"=") |
||
| 8 | if(c_start!=-1) |
||
| 9 | {c_start=c_start+c_name.length+1 |
||
| 10 | c_end=document.cookie.indexOf(";",c_start) |
||
| 11 | if(c_end==-1)c_end=document.cookie.length |
||
| 12 | return unescape(document.cookie.substring(c_start,c_end))}} |
||
| 13 | return""} |
||
| 14 | function iniciaAcessoRapido(){setCookie("idSubMenu","4",1);setCookie("idSubMenuTrans","1",1);} |
||
| 15 | function getMensagemErro() |
||
| 16 | {return mensagemErro;} |
||
| 17 | function redirecionamentoInteligente(){url=document.getElementById('bannerLinkId').href;if(url.indexOf("https")>-1){location.href=url;}else{window.open(url,'Portal');}} |
||
| 18 | var submeteuFormulario=0;function controleDuploClique(){if(submeteuFormulario=="1"){return false;} |
||
| 19 | submeteuFormulario="1";return true;} |
||
| 20 | function janelaAjuda(url) |
||
| 21 | {janela=window.open(url,'Ajuda','height=500,width=600,status=yes,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes');if(window.focus){janela.focus();}} |
||
| 22 | function mostraEsconde(layer){if(document.getElementById(layer).style.display!="none"){document.getElementById(layer).style.display="none";}else{document.getElementById(layer).style.display="";}} |
||
| 23 | function escondeLayer(layer){document.getElementById(layer).style.display="none";} |
||
| 24 | function mostraLayer(layer){document.getElementById(layer).style.display="";} |
||
| 25 | var janela;function popup(url,target,features){newwindow=window.open(url,target,features);if(window.focus){newwindow.focus();} |
||
| 26 | return false;} |
||
| 27 | function popupAlertaRedirecionamento(url,target,features){newwindow=window.open(url,target,features);if(window.focus){newwindow.focus();}} |
||
| 28 | function formataCEP(campo){campo.value=filtraCampo(campo);vr=campo.value;tam=vr.length;if(tam<=3) |
||
| 29 | campo.value=vr;if(tam>3) |
||
| 30 | campo.value=vr.substr(0,tam-3)+'-'+vr.substr(tam-3,tam);} |
||
| 31 | function limpa(){var elements=document.forms.aapf.elements;for(i=0;i<elements.length;i++){if(elements[i].type=='text'||elements[i].type=='text-area'||elements[i].type=='select-one'||elements[i].type=='radio'||elements[i].type=='checkbox'||elements[i].type=='password'||elements[i].type=='textarea'||elements[i].type=='tel'||elements[i].type=='number'){elements[i].value='';}} |
||
| 32 | if(document.tclJava) |
||
| 33 | {document.tclJava.limpa();}} |
||
| 34 | function limpaTodosMenos(nome1,nome2,nome3){var elements=document.forms.aapf.elements;for(i=0;i<elements.length;i++){if(elements[i].name!=nome1&&elements[i].name!=nome2&&elements[i].name!=nome3){if(elements[i].type=='text'||elements[i].type=='text-area'||elements[i].type=='select-one'||elements[i].type=='radio'||elements[i].type=='checkbox'||elements[i].type=='password'||elements[i].type=='textarea'||elements[i].type=='tel'){elements[i].value='';}}} |
||
| 35 | if(document.tclJava) |
||
| 36 | {document.tclJava.limpa();}} |
||
| 37 | function limpaEspecifico(text,textarea,selectone,radio,checkbox,password,submit){var elements=document.forms.aapf.elements;for(i=0;i<elements.length;i++){if(text=='true'){if(elements[i].type=='text'){elements[i].value='';}} |
||
| 38 | if(textarea=='true'){if(elements[i].type=='text-area'){elements[i].value='';}} |
||
| 39 | if(selectone=='true'){if(elements[i].type=='select-one'){elements[i].value='';}} |
||
| 40 | if(radio=='true'){if(elements[i].type=='radio'){elements[i].value='';}} |
||
| 41 | if(checkbox=='true'){if(elements[i].type=='checkbox'){elements[i].value='';}} |
||
| 42 | if(password=='true'){if(elements[i].type=='password'){elements[i].value='';}}}} |
||
| 43 | function limpaEspecificoPoupanca(text,textarea,selectone,radio,checkbox,password,submit){var elements=document.forms.aapf.elements;for(i=0;i<elements.length;i++){if(text=='true'){if(elements[i].type=='text'){if(elements[i].name!='dataPagamento') |
||
| 44 | {elements[i].value='';}}} |
||
| 45 | if(textarea=='true'){if(elements[i].type=='text-area'){elements[i].value='';}} |
||
| 46 | if(selectone=='true'){if(elements[i].type=='select-one'){elements[i].value='';}} |
||
| 47 | if(radio=='true'){if(elements[i].type=='radio'){elements[i].value='';}} |
||
| 48 | if(checkbox=='true'){if(elements[i].type=='checkbox'){elements[i].checked=false;}} |
||
| 49 | if(password=='true'){if(elements[i].type=='password'){elements[i].value='';}}}} |
||
| 50 | function limpaEspecificoVariacao(text,textarea,selectone,radio,checkbox,password,submit){var elements=document.forms.aapf.elements;for(i=0;i<elements.length;i++){if(text=='true'){if(elements[i].type=='text'){if(elements[i].name!='dataPagamento'&&elements[i].name!='variacao') |
||
| 51 | {elements[i].value='';}}} |
||
| 52 | if(textarea=='true'){if(elements[i].type=='text-area'){elements[i].value='';}} |
||
| 53 | if(selectone=='true'){if(elements[i].type=='select-one'){elements[i].value='';}} |
||
| 54 | if(radio=='true'){if(elements[i].type=='radio'){elements[i].value='';}} |
||
| 55 | if(checkbox=='true'){if(elements[i].type=='checkbox'){elements[i].checked=false;}} |
||
| 56 | if(password=='true'){if(elements[i].type=='password'){elements[i].value='';}}}} |
||
| 57 | function formataData(campo){campo.value=filtraCampo(campo);vr=campo.value;tam=vr.length;if(tam>2&&tam<5) |
||
| 58 | campo.value=vr.substr(0,tam-2)+'/'+vr.substr(tam-2,tam);if(tam>=5&&tam<=10) |
||
| 59 | campo.value=vr.substr(0,2)+'/'+vr.substr(2,2)+'/'+vr.substr(4,4);} |
||
| 60 | function formataDataAnoMes(campo){campo.value=filtraCampo(campo);vr=campo.value;tam=vr.length; |
||
| 61 | if(tam>4)campo.value=vr.substr(0,4)+'/'+vr.substr(4,tam);} |
||
| 62 | function formataHora(campo,teclapres){var tecla=teclapres.keyCode;campo.value=filtraCampo(campo);vr=campo.value;vr=vr.replace(".","");vr=vr.replace(":","");vr=vr.replace(":","");tam=vr.length+1;if(tecla!=9&&tecla!=8){if(tam>2&&tam<5) |
||
| 63 | campo.value=vr.substr(0,tam-2)+':'+vr.substr(tam-2,tam);}} |
||
| 64 | function formataValor(campo){campo.value=filtraCampoValor(campo);vr=campo.value;tam=vr.length;if(tam<=2){campo.value=vr;} |
||
| 65 | if((tam>2)&&(tam<=5)){campo.value=vr.substr(0,tam-2)+','+vr.substr(tam-2,tam);} |
||
| 66 | if((tam>=6)&&(tam<=8)){campo.value=vr.substr(0,tam-5)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);} |
||
| 67 | if((tam>=9)&&(tam<=11)){campo.value=vr.substr(0,tam-8)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);} |
||
| 68 | if((tam>=12)&&(tam<=14)){campo.value=vr.substr(0,tam-11)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);} |
||
| 69 | if((tam>=15)&&(tam<=18)){campo.value=vr.substr(0,tam-14)+'.'+vr.substr(tam-14,3)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);}} |
||
| 70 | function formataValorDecimal(campo){campo.value=formataNumerico(campo);vr=tiraZeros(campo.value);tam=vr.length;campo.value="0,0"+vr; |
||
| 71 | if(tam==2){campo.value="0,"+vr;} |
||
| 72 | if((tam>2)&&(tam<=5)){campo.value=vr.substr(0,tam-2)+','+vr.substr(tam-2,tam);} |
||
| 73 | if((tam>=6)&&(tam<=8)){campo.value=vr.substr(0,tam-5)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);} |
||
| 74 | if((tam>=9)&&(tam<=11)){campo.value=vr.substr(0,tam-8)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);} |
||
| 75 | if((tam>=12)&&(tam<=14)){campo.value=vr.substr(0,tam-11)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);} |
||
| 76 | if((tam>=15)&&(tam<=18)){campo.value=vr.substr(0,tam-14)+'.'+vr.substr(tam-14,3)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);}} |
||
| 77 | |||
| 78 | function formataValorPercentual(campo){campo.value=formataNumerico(campo);vr=tiraZeros(campo.value);tam=vr.length;campo.value="0.0"+vr; |
||
| 79 | if(tam==2){campo.value="0."+vr;} |
||
| 80 | if((tam>2)&&(tam<=5)){campo.value=vr.substr(0,tam-2)+'.'+vr.substr(tam-2,tam);} |
||
| 81 | if((tam>=6)&&(tam<=8)){campo.value=vr.substr(0,tam-5)+'.'+vr.substr(tam-5,3)+'.'+vr.substr(tam-2,tam);} |
||
| 82 | if((tam>=9)&&(tam<=11)){campo.value=vr.substr(0,tam-8)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+'.'+vr.substr(tam-2,tam);} |
||
| 83 | if((tam>=12)&&(tam<=14)){campo.value=vr.substr(0,tam-11)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+'.'+vr.substr(tam-2,tam);} |
||
| 84 | if((tam>=15)&&(tam<=18)){campo.value=vr.substr(0,tam-14)+'.'+vr.substr(tam-14,3)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+'.'+vr.substr(tam-2,tam);}} |
||
| 85 | |||
| 86 | function tiraZeros(valor){var tam=valor.length;var cont=0;var comzero=new String;for(var i=0;i<tam;i++){if(valor.substring(i,i+1)==0){comzero=comzero;if(cont==1){comzero=comzero+valor.substring(i,i+1);}}else{comzero=comzero+valor.substring(i,i+1);cont=1;}} |
||
| 87 | return(comzero=="")?"0":comzero;} |
||
| 88 | function formataValorExibicao(campo){campo.value=filtraCampo(campo);vr=campo.value;tam=vr.length;if(tam==1){campo.value='0,0'+vr;} |
||
| 89 | if(tam==2){campo.value='0,'+vr;} |
||
| 90 | if((tam>2)&&(tam<=5)){campo.value=vr.substr(0,tam-2)+','+vr.substr(tam-2,tam);} |
||
| 91 | if((tam>=6)&&(tam<=8)){campo.value=vr.substr(0,tam-5)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);} |
||
| 92 | if((tam>=9)&&(tam<=11)){campo.value=vr.substr(0,tam-8)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);} |
||
| 93 | if((tam>=12)&&(tam<=14)){campo.value=vr.substr(0,tam-11)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);} |
||
| 94 | if((tam>=15)&&(tam<=18)){campo.value=vr.substr(0,tam-14)+'.'+vr.substr(tam-14,3)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);}} |
||
| 95 | function formataNumerico(campo){campo.value=filtraCampo(campo);vr=campo.value;tam=vr.length;} |
||
| 96 | function filtraCampo(campo){var s="";var cp="";vr=campo.value;tam=vr.length;for(i=0;i<tam;i++){if(vr.substring(i,i+1)!="/"&&vr.substring(i,i+1)!="-"&&vr.substring(i,i+1)!="."&&vr.substring(i,i+1)!=","){s=s+vr.substring(i,i+1);}} |
||
| 97 | campo.value=s;return cp=campo.value} |
||
| 98 | function filtraCampoValor(campo){var s="";var cp="";vr=campo.value;tam=vr.length;for(i=0;i<tam;i++){if(vr.substring(i,i+1)>="0"&&vr.substring(i,i+1)<="9"){s=s+vr.substring(i,i+1);}} |
||
| 99 | campo.value=s;return cp=campo.value} |
||
| 100 | function setaTextoAjuda(txt){if(document.getElementById('textoAjuda'))document.getElementById('textoAjuda').innerHTML=txt+' ';} |
||
| 101 | function getTeclaPressionada(evt) |
||
| 102 | {if(typeof(evt)=='undefined') |
||
| 103 | evt=window.event;return(evt.keyCode?evt.keyCode:(evt.which?evt.which:evt.charCode));} |
||
| 104 | function isTeclaEspecial(key) |
||
| 105 | {return key<32||(key>=35&&key<=36)||(key>=37&&key<=40)||key==46||(key>=63230&&key<=63240);} |
||
| 106 | function isTeclaRelevante(key) |
||
| 107 | {return(key==8)||(key==46)||(key==88)||(key>=48&&key<=57)||(key>=96&&key<=105);} |
||
| 108 | function isCaracterRelevante(key) |
||
| 109 | {return(key==88)||(key==120)||(key>=48&&key<=57);} |
||
| 110 | function isCopiaCola(ctrlKey,key) |
||
| 111 | {return ctrlKey&&(key==118||key==86||key==99||key==67);} |
||
| 112 | function filtraTeclas(evt) |
||
| 113 | {var key=getTeclaPressionada(evt);if(isTeclaEspecial(key)||isTeclaRelevante(key)||isCopiaCola(evt.ctrlKey,key)) |
||
| 114 | return true;StopEvent(evt);return false;} |
||
| 115 | function filtraCaracteres(evt) |
||
| 116 | {var key=getTeclaPressionada(evt);if(isTeclaEspecial(key)||isCaracterRelevante(key)||isCopiaCola(evt.ctrlKey,key)) |
||
| 117 | return true;StopEvent(evt);return false;} |
||
| 118 | function isTeclaNumerica(key){return((key>47&&key<58)||(key>95&&key<106));} |
||
| 119 | function isTeclaNumericaIPad(key){return((key>47&&key<58));} |
||
| 120 | function asciiToNumber(code){var retorno="";switch(code) |
||
| 121 | {case 48:retorno="0";break;case 49:retorno="1";break;case 50:retorno="2";break;case 51:retorno="3";break;case 52:retorno="4";break;case 53:retorno="5";break;case 54:retorno="6";break;case 55:retorno="7";break;case 56:retorno="8";break;case 57:retorno="9";break;case 96:retorno="0";break;case 97:retorno="1";break;case 98:retorno="2";break;case 99:retorno="3";break;case 100:retorno="4";break;case 101:retorno="5";break;case 102:retorno="6";break;case 103:retorno="7";break;case 104:retorno="8";break;case 105:retorno="9";break;} |
||
| 122 | return retorno;} |
||
| 123 | function removerSubString(str,posicaoInicial,posicaoFinal){if(posicaoInicial==posicaoFinal){if(posicaoInicial==1){return str.substring(1);}else if(posicaoInicial==str.length){return str.substring(0,posicaoInicial-1);}else{return str.substring(0,posicaoInicial-1)+str.substring(posicaoInicial);}}else{if((posicaoFinal-posicaoInicial)==str.length){return("");}else{return(str.substring(0,posicaoInicial)+str.substring(posicaoFinal));}}} |
||
| 124 | function setCaretTo(obj,poIni,posFim){if(obj.setSelectionRange){obj.focus();obj.setSelectionRange(poIni,posFim);}else if(obj.createTextRange){var range=obj.createTextRange();range.collapse(true);range.moveEnd('character',posFim);range.moveStart('character',poIni);range.select();}} |
||
| 125 | function getSelectionStart(o){if(o.createTextRange){var r=document.selection.createRange().duplicate() |
||
| 126 | r.moveEnd('character',o.value.length) |
||
| 127 | if(r.text=='')return o.value.length |
||
| 128 | return o.value.lastIndexOf(r.text)}else return o.selectionStart} |
||
| 129 | function getSelectionEnd(o){if(o.createTextRange){var r=document.selection.createRange().duplicate() |
||
| 130 | r.moveStart('character',-o.value.length) |
||
| 131 | return r.text.length}else return o.selectionEnd} |
||
| 132 | function filtraPassa(field,evt,idNome){var key=getTeclaPressionada(evt);var idVar=document.getElementById(idNome);var posIni=getSelectionStart(field);var posFim=getSelectionEnd(field);if(idVar==null){var div=document.getElementById("retrancas");div.innerHTML="<input type='hidden' name='"+idNome+"' id='"+idNome+"' value='' maxlenght='8' />";idVar=document.getElementById(idNome);} |
||
| 133 | if(key==13||key==9){return true;}else if(isTeclaEspecial(key)){if((key>=35&&key<=40)||key==16){return true;} |
||
| 134 | if(key==8){idVar.value=removerSubString(idVar.value,posIni,posFim);return true;}else if(key==46){if(posIni==posFim){idVar.value=removerSubString(idVar.value,posIni+1,posIni+1);}else{idVar.value=removerSubString(idVar.value,posIni,posFim);} |
||
| 135 | return true;} |
||
| 136 | StopEvent(evt);return false;}else if((!isTeclaNumerica(key))||((field.value.length==8)&&(posIni==posFim))){StopEvent(evt);return false;}else{var randomnumber=Math.floor(Math.random()*10);var digito=asciiToNumber(key);if(posIni==posFim){idVar.value=idVar.value.substring(0,posIni)+digito+idVar.value.substring(posIni,idVar.value.length);field.value=field.value.substring(0,posIni)+randomnumber+field.value.substring(posIni,field.value.length);}else{var valorfield1=idVar.value;var valorfield2=field.value;idVar.value=removerSubString(idVar.value,posIni,posFim);field.value=removerSubString(field.value,posIni,posFim);idVar.value=valorfield1.substring(0,posIni)+digito+valorfield1.substring(posFim);field.value=valorfield2.substring(0,posIni)+randomnumber+valorfield2.substring(posFim);} |
||
| 137 | setCaretTo(field,posIni+1,posIni+1);StopEvent(evt);return false;}} |
||
| 138 | function filtraTecla(field,evt){var key=getTeclaPressionada(evt);if(!isTeclaNumerica(key)){StopEvent(evt);return false;}} |
||
| 139 | function filtraPassaIpad(field,evt,idNome){var key=getTeclaPressionada(evt);var idVar=document.getElementById(idNome);var posIni=getSelectionStart(field);var posFim=getSelectionEnd(field);if(idVar==null){var div=document.getElementById("retrancas");div.innerHTML="<input type='hidden' name='"+idNome+"' id='"+idNome+"' value='' maxlenght='8' />";idVar=document.getElementById(idNome);} |
||
| 140 | if(key==8){idVar.value=removerSubString(idVar.value,posIni,posFim);return true;}else if(key==13||key==9){return true;}else if(isTeclaEspecial(key)){StopEvent(evt);return false;}else if((!isTeclaNumericaIPad(key))||((field.value.length==8)&&(posIni==posFim))){StopEvent(evt);return false;}else{var randomnumber="*";var digito=asciiToNumber(key);if(posIni==posFim){idVar.value=idVar.value.substring(0,posIni)+digito+idVar.value.substring(posIni,idVar.value.length);field.value=field.value.substring(0,posIni)+randomnumber+field.value.substring(posIni,field.value.length);}else{var valorfield1=idVar.value;var valorfield2=field.value;idVar.value=removerSubString(idVar.value,posIni,posFim);field.value=removerSubString(field.value,posIni,posFim);idVar.value=valorfield1.substring(0,posIni)+digito+valorfield1.substring(posFim);field.value=valorfield2.substring(0,posIni)+randomnumber+valorfield2.substring(posFim);} |
||
| 141 | setCaretTo(field,posIni+1,posIni+1);StopEvent(evt);return false;}} |
||
| 142 | function filtraPassaIpad6(field,evt,idNome){var key=getTeclaPressionada(evt);var idVar=document.getElementById(idNome);var posIni=getSelectionStart(field);var posFim=getSelectionEnd(field);if(idVar==null){var div=document.getElementById("retrancas");div.innerHTML="<input type='hidden' name='"+idNome+"' id='"+idNome+"' value='' maxlenght='6' />";idVar=document.getElementById(idNome);} |
||
| 143 | if(key==13||key==9){return true;}else if(isTeclaEspecial(key)){if((key>=35&&key<=40)||key==16){return true;} |
||
| 144 | if(key==8){idVar.value=removerSubString(idVar.value,posIni,posFim);return true;}else if(key==46){if(posIni==posFim){idVar.value=removerSubString(idVar.value,posIni+1,posIni+1);}else{idVar.value=removerSubString(idVar.value,posIni,posFim);} |
||
| 145 | return true;} |
||
| 146 | StopEvent(evt);return false;}else if((!isTeclaNumerica(key))||((field.value.length==6)&&(posIni==posFim))){StopEvent(evt);return false;}else{var randomnumber="*";var digito=asciiToNumber(key);if(posIni==posFim){idVar.value=idVar.value.substring(0,posIni)+digito+idVar.value.substring(posIni,idVar.value.length);field.value=field.value.substring(0,posIni)+randomnumber+field.value.substring(posIni,field.value.length);}else{var valorfield1=idVar.value;var valorfield2=field.value;idVar.value=removerSubString(idVar.value,posIni,posFim);field.value=removerSubString(field.value,posIni,posFim);idVar.value=valorfield1.substring(0,posIni)+digito+valorfield1.substring(posFim);field.value=valorfield2.substring(0,posIni)+randomnumber+valorfield2.substring(posFim);} |
||
| 147 | setCaretTo(field,posIni+1,posIni+1);StopEvent(evt);return false;}} |
||
| 148 | function StopEvent(evt) |
||
| 149 | {if(document.all)evt.returnValue=false;else if(evt.preventDefault)evt.preventDefault();} |
||
| 150 | function formataMascara(format,field) |
||
| 151 | {var result="";var maskIdx=format.length-1;var error=false;var valor=field.value;var posFinal=false;if(field.setSelectionRange) |
||
| 152 | {if(field.selectionStart==valor.length) |
||
| 153 | posFinal=true;} |
||
| 154 | valor=valor.replace(/[^0123456789Xx]/g,'') |
||
| 155 | for(var valIdx=valor.length-1;valIdx>=0&&maskIdx>=0;--maskIdx) |
||
| 156 | {var chr=valor.charAt(valIdx);var chrMask=format.charAt(maskIdx);switch(chrMask) |
||
| 157 | {case'#':if(!(/\d/.test(chr))) |
||
| 158 | error=true;result=chr+result;--valIdx;break;case'@':result=chr+result;--valIdx;break;default:result=chrMask+result;}} |
||
| 159 | field.value=result;field.style.color=error?'red':'';if(posFinal) |
||
| 160 | {field.selectionStart=result.length;field.selectionEnd=result.length;} |
||
| 161 | return result;} |
||
| 162 | function saltaCampo(campo,tamanhoMaximo,indice,evt){var vr=campo.value;var tam=vr.length;var elements=document.forms.aapf.elements;if(tam>=tamanhoMaximo&&typeof(elements[indice])!='undefined'){for(i=0;i<elements.length;i++){if(elements[i].tabIndex==indice+1){elements[i].focus();}}}} |
||
| 163 | function trocaBotaoAction(botao) |
||
| 164 | {if(document.applets['tclAssinador']) |
||
| 165 | {pos=document.forms.aapf.action.indexOf("?");acao=document.forms.aapf.action;if(pos!=-1) |
||
| 166 | {acao=acao.substring(0,pos);} |
||
| 167 | document.forms.aapf.action=acao+"?"+botao+".x=1";}} |
||
| 168 | var confirmaAssinador=0;var linkJS="";function getSenha(){if(document.getElementById('tclAssinadorContent')&&document.getElementById('tclAssinadorContent').style.display=='none') |
||
| 169 | {if(showApplet());return false;} |
||
| 170 | if(document.applets['tclJava']){var senha=document.applets['tclJava'].getSenha();document.forms.aapf.elements['senhaConta'].value=senha;} |
||
| 171 | else if(document.applets['tclAssinador']) |
||
| 172 | {if(confirmaAssinador==1) |
||
| 173 | {confirmaAssinador=0;if(document.applets['tclAssinador'].ok()) |
||
| 174 | {loadData();return true;} |
||
| 175 | else |
||
| 176 | {document.applets['tclAssinador'].focus();return false;}} |
||
| 177 | else |
||
| 178 | {return document.applets['tclAssinador'].cancel();}} |
||
| 179 | else if(document.getElementById('senhaConta_')) |
||
| 180 | {document.getElementById('senhaConta').value=document.getElementById('senhaConta_').value;} |
||
| 181 | return true;} |
||
| 182 | function getSenhaGBAS(campo,idCh,idDg,idDg2){document.getElementById(campo).value=document.applets['GbPluginObj'].Encripta(document.getElementById(campo).value,idCh);} |
||
| 183 | function getSenha2(campo,idCh,idDg,idDg2){if(document.getElementById(campo)){GbPluginObj.Digest(idDg);GbPluginObj.Digest2(idDg2);document.getElementById(campo).value=GbPluginObj.Function8(document.getElementById(campo).value,idCh);} |
||
| 184 | return true;} |
||
| 185 | function getSenhaIP(campo,idCh,idDg,idDg2){return true;} |
||
| 186 | function trocaBotaoAction(botao) |
||
| 187 | {if(document.applets['tclAssinador']) |
||
| 188 | {pos=document.forms.aapf.action.indexOf("?");acao=document.forms.aapf.action;if(pos!=-1) |
||
| 189 | {acao=acao.substring(0,pos);} |
||
| 190 | document.forms.aapf.action=acao+"?"+botao+".x=1";}} |
||
| 191 | function appletTerminated(ok) |
||
| 192 | {if(ok) |
||
| 193 | loadData();if(linkJS=="") |
||
| 194 | document.forms.aapf.submit();else if(linkJS=="retorna"){linkJS="";window.history.back(1);} |
||
| 195 | else{var linkJSTemp=linkJS;linkJS="";window.navigate(linkJSTemp);}} |
||
| 196 | function formataMesAno(campo){campo.value=filtraCampo(campo);vr=campo.value;tam=vr.length;if(tam>2&&tam<5) |
||
| 197 | campo.value=vr.substr(0,tam-2)+'/'+vr.substr(tam-2,tam);if(tam>=5&&tam<=10) |
||
| 198 | campo.value=vr.substr(0,2)+'/'+vr.substr(2,4);} |
||
| 199 | function formataCgc(campo){campo.value=filtraCampo(campo);vr=campo.value;tam=vr.length;if(tam<=2){campo.value=vr;} |
||
| 200 | if((tam>2)&&(tam<=6)){campo.value=vr.substr(0,tam-2)+'-'+vr.substr(tam-2,tam);} |
||
| 201 | if((tam>=7)&&(tam<=9)){campo.value=vr.substr(0,tam-6)+'/'+vr.substr(tam-6,4)+'-'+vr.substr(tam-2,tam);} |
||
| 202 | if((tam>=10)&&(tam<=12)){campo.value=vr.substr(0,tam-9)+'.'+vr.substr(tam-9,3)+'/'+vr.substr(tam-6,4)+'-'+vr.substr(tam-2,tam);} |
||
| 203 | if((tam>=13)&&(tam<=14)){campo.value=vr.substr(0,tam-12)+'.'+vr.substr(tam-12,3)+'.'+vr.substr(tam-9,3)+'/'+vr.substr(tam-6,4)+'-'+vr.substr(tam-2,tam);} |
||
| 204 | if((tam>=15)&&(tam<=17)){campo.value=vr.substr(0,tam-14)+'.'+vr.substr(tam-14,3)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+'-'+vr.substr(tam-2,tam);}} |
||
| 205 | function formataCPF(campo){campo.value=filtraCampo(campo);vr=campo.value;tam=vr.length;if(tam<=2){campo.value=vr;} |
||
| 206 | if(tam>2&&tam<=5){campo.value=vr.substr(0,tam-2)+'-'+vr.substr(tam-2,tam);} |
||
| 207 | if(tam>=6&&tam<=8){campo.value=vr.substr(0,tam-5)+'.'+vr.substr(tam-5,3)+'-'+vr.substr(tam-2,tam);} |
||
| 208 | if(tam>=9&&tam<=11){campo.value=vr.substr(0,tam-8)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+'-'+vr.substr(tam-2,tam);}} |
||
| 209 | function formataPercentual(campo){campo.value=filtraCampo(campo);vr=campo.value;tam=vr.length;if(tam<=3){campo.value=vr;} |
||
| 210 | if((tam>3)&&(tam<=6)){campo.value=vr.substr(0,tam-3)+','+vr.substr(tam-3,tam);}} |
||
| 211 | function formataTelefone(campo){campo.value=filtraCampo(campo);vr=campo.value;tam=vr.length;if(tam<=4) |
||
| 212 | campo.value=vr;if(tam>4) |
||
| 213 | campo.value=vr.substr(0,tam-4)+'-'+vr.substr(tam-4,tam);} |
||
| 214 | function contacampo(campo,tamtxt){document.forms.aapf[tamtxt].value=1540-document.forms.aapf[campo].value.length;} |
||
| 215 | function limita(campo){var tamanho=document.forms.aapf[campo].value.length;var tex=document.forms.aapf[campo].value;if(tamanho>=1539){document.forms.aapf[campo].value=tex.substring(0,1539);} |
||
| 216 | return true;} |
||
| 217 | function mudaFoco(campofoco) |
||
| 218 | {focaCampo(campofoco);} |
||
| 219 | function focaCampo(campofoco){if(campofoco=='') |
||
| 220 | campofoco='botaoConfirma.x';var num=parseInt(campofoco);if(num||num==0) |
||
| 221 | {if(document.forms.aapf[num]) |
||
| 222 | {try |
||
| 223 | {document.forms.aapf[num].focus();}catch(err){}}} |
||
| 224 | else |
||
| 225 | {if((campofoco=="senhaConta"||campofoco=="senhaAtual")&&document.applets["tclJava"]){try |
||
| 226 | {document.applets["tclJava"].setFocus();}catch(err){}}else if(document.forms.aapf[campofoco]) |
||
| 227 | {var campo=document.forms.aapf[campofoco];if(campo.length) |
||
| 228 | {for(i=0;i<campo.length;i++){if(campo[i].type=='submit'){try |
||
| 229 | {campo[i].focus();}catch(err){} |
||
| 230 | break;}}} |
||
| 231 | else |
||
| 232 | {try |
||
| 233 | {campo.focus();}catch(err){}}}}} |
||
| 234 | function formataCartaoCredito(campo,teclapres){var tammax=16;var tecla=teclapres.keyCode;vr=document.forms.aapf[campo].value;if(tecla==8||(tecla>=48&&tecla<=57)||(tecla>=96&&tecla<=105)){vr=vr.replace("/","");vr=vr.replace("/","");vr=vr.replace(",","");vr=vr.replace(".","");vr=vr.replace(".","");vr=vr.replace(".","");vr=vr.replace(".","");vr=vr.replace("-","");vr=vr.replace("-","");vr=vr.replace("-","");vr=vr.replace("-","");vr=vr.replace("-","");tam=vr.length;if(tam<tammax&&tecla!=8){tam=vr.length+1;} |
||
| 235 | if(tecla==8){tam=tam-1;} |
||
| 236 | if(tam>1){if(vr.substr(0,1)!="3"){if(tam<5){document.forms.aapf[campo].value=vr;}else if((tam>4)&&(tam<9)){document.forms.aapf[campo].value=vr.substr(0,4)+'.'+vr.substr(4,tam-4);}else if((tam>8)&&(tam<13)){document.forms.aapf[campo].value=vr.substr(0,4)+'.'+vr.substr(4,4)+'.'+vr.substr(8,tam-4);}else if(tam>12){document.forms.aapf[campo].value=vr.substr(0,4)+'.'+vr.substr(4,4)+'.'+vr.substr(8,4)+'.'+vr.substr(12,tam-4);}}else{if(tam<5){document.forms.aapf[campo].value=vr;}else if((tam>4)&&(tam<10)){document.forms.aapf[campo].value=vr.substr(0,4)+'.'+vr.substr(4,tam-4);}else if(tam>9){document.forms.aapf[campo].value=vr.substr(0,4)+'.'+vr.substr(4,5)+'.'+vr.substr(9,tam-4);}}}}} |
||
| 237 | var http_request=null;function getConexaoHttp() |
||
| 238 | {if(http_request==null) |
||
| 239 | {if(window.XMLHttpRequest) |
||
| 240 | {http_request=new XMLHttpRequest();} |
||
| 241 | else if(window.ActiveXObject) |
||
| 242 | {try |
||
| 243 | {http_request=new ActiveXObject("Msxml2.XMLHTTP");} |
||
| 244 | catch(e) |
||
| 245 | {try |
||
| 246 | {http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}} |
||
| 247 | return http_request;} |
||
| 248 | function mostraActive(caminhoApplet,versaoApplet,contraste,numCod,local,idTeclado,idDiv,legenda1,legenda2) |
||
| 249 | {var oDivTcl=document.getElementById(idDiv);var codigo='<object alt="Senha do auto-atendimento" tabindex="70" codebase="'+caminhoApplet+'/teclado/BBTecladoV'+versaoApplet+'.cab#version=1,0,0,3" CLASSID="CLSID:6F03F00A-71B3-4B59-A934-25686DC63B42" name="'+idTeclado+'" id="'+idTeclado+'" width="316" height="80" NOEXTERNALDATA="true"> ';codigo+='<param name="id" value="'+idTeclado+'"> ';codigo+='<param name="local" value="cartao"> ';codigo+='<param name="campoAnterior" value=""> ';codigo+='<param name="campoPosterior" value="98"> ';codigo+='<param name="colorLabel" value="#000084"> ';codigo+='<param name="colorField" value="#FFFFFA"> ';codigo+='<param name="colorBorder" value="#BBBBBB"> ';codigo+='<param name="colorBackground" value="#FFFFFF"> ';if(local=='cartao') |
||
| 250 | {codigo+='<param name="tipoLegenda" value="cartao"> ';} |
||
| 251 | else if(local=='definido') |
||
| 252 | {codigo+='<param name="tipoLegenda" value="definido"> ';codigo+='<param name="legenda1" value="'+legenda1+'"> ';codigo+='<param name="legenda2" value="'+legenda2+'"> ';} |
||
| 253 | codigo+='<param name="colorEmb" value="azul"> ';codigo+='<param name="valorContr" value="'+contraste+'"> ';codigo+='<param name="numCod" value="'+numCod+'"> ';codigo+='</object>';oDivTcl.innerHTML=codigo;return true;} |
||
| 254 | function mostraErro() |
||
| 255 | {var oDivTcl=document.getElementById('tclTecladoContent');oDivTcl.innerHTML='<br>Ocorreu um erro ao carregar o Teclado Virtual.<br>Pressione F5 ou <a href="/aapf/login.jsp?forcaApplet=sim" >acesse o Teclado<br>Virtual em Java</a><br><br>';return true;} |
||
| 256 | function setAppletArea(oDivTcl) |
||
| 257 | {try{oDivTcl.style.width=316;oDivTcl.style.height=80;oDivTcl.style.backgroundColor="#f7f7f7";oDivTcl.innerHTML=getMensagemErro();oDivTcl.style.display="block";}catch(e2){}} |
||
| 258 | function montaObjetoApplet(caminhoApplet,versaoApplet,contraste,numCod,local,idTeclado,idDiv,legenda1,legenda2,showCamposLogin){var oDivTcl=document.getElementById(idDiv);var codigo='<applet alt="Senha do auto-atendimento" tabindex="70" code="br/com/bb/aapf/bbteclado/CampoTeclado.class" cabbase="/aapf/ncresp/teclado/BBTeclado'+versaoApplet+'.cab" archive="/aapf/ncresp/teclado/BBTeclado'+versaoApplet+'.jar" codebase="/aapf/ncresp/teclado/" name="'+idTeclado+'" id="'+idTeclado+'" width="316" height="80" namespace="global" mayscript> ';codigo+='<param name="id" value="'+idTeclado+'"> ';codigo+='<param name="local" value="'+local+'"> ';codigo+='<param name="campoAnterior" value=""> ';codigo+='<param name="campoPosterior" value="98"> ';codigo+='<param name="colorLabel" value="0x000084"> ';codigo+='<param name="colorField" value="0xFFFFFA"> ';codigo+='<param name="colorBorder" value="0xBBBBBB"> ';codigo+='<param name="colorBackground" value="#FFFFFF"> ';if(local=="cartao") |
||
| 259 | {codigo+='<param name="tipoLegenda" value="cartao"> ';} |
||
| 260 | else if(local=="definido") |
||
| 261 | {codigo+='<param name="tipoLegenda" value="definido"> ';codigo+='<param name="legenda1" value="'+legenda1+'"> ';codigo+='<param name="legenda2" value="'+legenda2+'"> ';} |
||
| 262 | if(showCamposLogin=="true") |
||
| 263 | {codigo+='<param name="showCamposLogin" value="true"> ';} |
||
| 264 | codigo+='<param name="colorEmb" value="azul"> ';codigo+='<param name="valorContr" value="'+contraste+'"> ';codigo+='<param name="numCod" value="'+numCod+'"> ';codigo+='</applet>';mensagemErro=codigo;try{if(window.navigator.javaEnabled()&&oDivTcl){var oAppletTcl=document.createElement("applet");oAppletTcl.code="br/com/bb/aapf/bbteclado/CampoTeclado.class";oAppletTcl.codeBase=caminhoApplet+"/teclado/";oAppletTcl.cabBase=caminhoApplet+"/teclado/BBTeclado"+versaoApplet+".cab";oAppletTcl.archive=caminhoApplet+"/teclado/BBTeclado"+versaoApplet+".jar";oAppletTcl.name=idTeclado;oAppletTcl.tabIndex="70";oAppletTcl.title="Senha do auto-atendimento";oAppletTcl.alt="Senha do auto-atendimento";oAppletTcl.left=0;oAppletTcl.top=0;oAppletTcl.width=316;oAppletTcl.height=80;oAppletTcl.id=idTeclado;oAppletTcl.appendChild(makeParam("MAYSCRIPT","true"));oAppletTcl.appendChild(makeParam("id",idTeclado));oAppletTcl.appendChild(makeParam("local",local));oAppletTcl.appendChild(makeParam("campoAnterior",""));oAppletTcl.appendChild(makeParam("campoPosterior","98"));oAppletTcl.appendChild(makeParam("colorLabel","0x000084"));oAppletTcl.appendChild(makeParam("colorField","0xFFFFFA"));oAppletTcl.appendChild(makeParam("colorBorder","0xBBBBBB"));oAppletTcl.appendChild(makeParam("colorBackground","#FFFFFF"));if(local=="cartao") |
||
| 265 | {oAppletTcl.appendChild(makeParam("tipoLegenda","cartao"));} |
||
| 266 | else if(local=="definido") |
||
| 267 | {oAppletTcl.appendChild(makeParam("tipoLegenda","definido"));oAppletTcl.appendChild(makeParam("legenda1",legenda1));oAppletTcl.appendChild(makeParam("legenda2",legenda2));} |
||
| 268 | if(showCamposLogin=="true") |
||
| 269 | {oAppletTcl.appendChild(makeParam("showCamposLogin","true"));} |
||
| 270 | oAppletTcl.appendChild(makeParam("colorEmb","azul"));oAppletTcl.appendChild(makeParam("valorContr",contraste));oAppletTcl.appendChild(makeParam("numCod",numCod));oDivTcl.appendChild(oAppletTcl);}else{window.defaultStatus="Erro: Java nao suportado ou nao habilitado!";window.status="Erro: Java nao suportado ou nao habilitado!";setAppletArea(oDivTcl);}}catch(e){window.defaultStatus="Erro ao criar Applet:"+e.description;window.status="Erro ao criar Applet:"+e.description;setAppletArea(oDivTcl);} |
||
| 271 | return true;} |
||
| 272 | function makeParam(name,value) |
||
| 273 | {var p=document.createElement("param");p.name=name;p.value=value;return p;} |
||
| 274 | function mostraApplet(caminhoApplet,versaoApplet,contraste,numCod,local,idTeclado,idDiv,legenda1,legenda2,showCamposLogin) |
||
| 275 | {var codigo='<applet alt="Senha do auto-atendimento" tabindex="70" code="br/com/bb/aapf/bbteclado/CampoTeclado.class" cabbase="/aapf/ncresp/teclado/BBTeclado'+versaoApplet+'.cab" archive="/aapf/ncresp/teclado/BBTeclado'+versaoApplet+'.jar" codebase="/aapf/ncresp/teclado/" name="'+idTeclado+'" id="'+idTeclado+'" width="316" height="80" namespace="global" mayscript> ';codigo+='<param name="id" value="'+idTeclado+'"> ';codigo+='<param name="local" value="'+local+'"> ';codigo+='<param name="campoAnterior" value=""> ';codigo+='<param name="campoPosterior" value="98"> ';codigo+='<param name="colorLabel" value="0x000084"> ';codigo+='<param name="colorField" value="0xFFFFFA"> ';codigo+='<param name="colorBorder" value="0xBBBBBB"> ';codigo+='<param name="colorBackground" value="#FFFFFF"> ';if(local=="cartao") |
||
| 276 | {codigo+='<param name="tipoLegenda" value="cartao"> ';} |
||
| 277 | else if(local=="definido") |
||
| 278 | {codigo+='<param name="tipoLegenda" value="definido"> ';codigo+='<param name="legenda1" value="'+legenda1+'"> ';codigo+='<param name="legenda2" value="'+legenda2+'"> ';} |
||
| 279 | if(showCamposLogin=="true") |
||
| 280 | {codigo+='<param name="showCamposLogin" value="true"> ';} |
||
| 281 | codigo+='<param name="colorEmb" value="azul"> ';codigo+='<param name="valorContr" value="'+contraste+'"> ';codigo+='<param name="numCod" value="'+numCod+'"> ';codigo+='</applet>';oDivTcl.innerHTML=codigo;return true;} |
||
| 282 | function mostraAssinador(width,caminhoApplet,nomeBotaoSubmit,idCartao,parametroD,versao) |
||
| 283 | {var oDivTcl=document.getElementById("tclTecladoContent");var codigo='<applet name="tclAssinador" id="tclAssinador" code="br.com.bb.cdg.assinador.applet.SignApplet" codebase="'+caminhoApplet+'/certificacao/" archive="'+caminhoApplet+'/certificacao/slogin'+versao+'.jar" width="'+width+'" height="60" mayscript="mayscript" alt="Assinador do auto-atendimento"> ';codigo+='<param name="botao" value="'+nomeBotaoSubmit+'"> ';if(idCartao!="null") |
||
| 284 | codigo+='<param name="c" value="'+idCartao+'"> ';codigo+=parametroD+' ';codigo+='Seu assinador do auto-atendimento n�o foi habilitado.<br> ';codigo+='<a href="/aapf/ajuda/faqCertificacao.jsp">Clique aqui para saber mais...</a><br><br> ';codigo+='</applet>';oDivTcl.innerHTML=codigo;return true;} |
||
| 285 | function mostraAjuda1(objeto){document.getElementById(objeto).style.visibility="visible";} |
||
| 286 | function escondeAjuda1(objeto){document.getElementById(objeto).style.visibility="hidden";} |
||
| 287 | function mostraDiv(objeto){document.getElementById(objeto).style.visibility="visible";} |
||
| 288 | function escondeDiv(objeto){document.getElementById(objeto).style.visibility="hidden";} |
||
| 289 | function quebraPagina(){var ns4=(document.layers)?true:false;var moz=(window.navigator.appCodeName);var ns6=(document.getElementById)?true:false;var ie4=(document.all)?true:false;var ie5=false;if(ie4){if((navigator.userAgent.indexOf('MSIE 5')>0)||(navigator.userAgent.indexOf('MSIE 6')>0)){ie5=true;} |
||
| 290 | if(ns6){ns6=false;}} |
||
| 291 | if(ie4) |
||
| 292 | document.write("<p class='quebra'></p>");else if(ns4) |
||
| 293 | document.write("");else if(moz=="Mozilla") |
||
| 294 | document.write("<a class='quebra'> </a>");else |
||
| 295 | document.write("Esse navegador n�o suporta impress�o com quebra de p�ginas");} |
||
| 296 | function abrirDiv(idDiv){divStyle_=document.getElementById(idDiv).style;btaStyle_=document.getElementById(idDiv+'_a').style;btfStyle_=document.getElementById(idDiv+'_f').style;divStyle_.display='';btaStyle_.display='none';btfStyle_.display='';return false;} |
||
| 297 | function fecharDiv(idDiv){divStyle_=document.getElementById(idDiv).style;btaStyle_=document.getElementById(idDiv+'_a').style;btfStyle_=document.getElementById(idDiv+'_f').style;divStyle_.display='none';btaStyle_.display='';btfStyle_.display='none';return false;} |
||
| 298 | function insDigito(digito) |
||
| 299 | {if(document.getElementById('senhaConta_').value.length<8) |
||
| 300 | document.getElementById('senhaConta_').value+=digito;} |
||
| 301 | function delDigito() |
||
| 302 | {var str=document.getElementById('senhaConta_').value;document.getElementById('senhaConta_').value=str.substring(0,str.length-1);} |
||
| 303 | function setAlpha(target,acaoContraste){var alpha="";var vlrCookie=getCookie("aapf.teclado.contraste");var contraste=3;if(vlrCookie!=null&&vlrCookie!="") |
||
| 304 | contraste=parseInt(vlrCookie);else |
||
| 305 | contraste=parseInt(document.getElementById('valorContr').value);if(contraste>5) |
||
| 306 | contraste=5;if(acaoContraste!=null&&acaoContraste!="") |
||
| 307 | {if(acaoContraste=="mais") |
||
| 308 | {if(contraste<5) |
||
| 309 | contraste=parseInt(contraste)+1;} |
||
| 310 | else if(acaoContraste=="menos") |
||
| 311 | {if(contraste!=0&&contraste>1) |
||
| 312 | contraste=parseInt(contraste)-1;}} |
||
| 313 | if(contraste==1) |
||
| 314 | alpha=10;else if(contraste==2) |
||
| 315 | alpha=25;else if(contraste==3) |
||
| 316 | alpha=40;else if(contraste==4) |
||
| 317 | alpha=65;else if(contraste==5) |
||
| 318 | alpha=100;target=document.getElementById(target);target.style.filter="alpha(opacity="+alpha+")";target.style.opacity=alpha/100;setCookie("aapf.teclado.contraste",contraste,1);document.getElementById('valorContr').value=contraste;} |
||
| 319 | function focaCampoVazioLogin(){try{if(document.getElementsByName("dependenciaOrigem")[0].value==""){focaCampo('dependenciaOrigem');return;} |
||
| 320 | else if(document.getElementsByName("numeroContratoOrigem")[0].value==""){focaCampo('numeroContratoOrigem');return;} |
||
| 321 | else if(document.getElementsByName("senhaConta")[0].value==""){focaCampo('senhaConta');return;}}catch(err){try{if(document.getElementsByName("cpf")[0].value==""){focaCampo('cpf');return;} |
||
| 322 | else if(document.getElementsByName("senhaConta")[0].value==""){focaCampo('senhaConta');return;}}catch(err){}}} |
||
| 323 | function marcaCheckbox(valor,qtdeMax) |
||
| 324 | {var inputs=document.getElementsByTagName('input');var contChecked=0;for(var x=0;x<inputs.length;x++){if(inputs[x].type=="checkbox"&&inputs[x].value==valor){inputs[x].checked=statusInicial==true?false:true;document.getElementById(valor).style.backgroundColor=inputs[x].checked==true?"#bebebe":"";statusInicial=inputs[x].checked;} |
||
| 325 | if(inputs[x].checked==true) |
||
| 326 | contChecked+=1;if(contChecked>qtdeMax){inputs[x].checked=false;document.getElementById(valor).style.backgroundColor="";}}} |
||
| 327 | function marcaRadio(valor) |
||
| 328 | {var inputs=document.getElementsByTagName('input');var contador=inputs.length;for(var z=0;z<contador;z++){if(inputs[z].type=="radio"&&inputs[z].value!=""){document.getElementById(inputs[z].value).style.backgroundColor="";}} |
||
| 329 | for(var x=0;x<contador;x++){if(inputs[x].type=="radio"&&inputs[x].value==valor){inputs[x].checked=true;document.getElementById(inputs[x].value).style.backgroundColor="#bebebe";}}} |
||
| 330 | function mudaCor(valor,acao) |
||
| 331 | {var inputs=document.getElementsByTagName('input');for(var x=0;x<inputs.length;x++){if(inputs[x].type=="checkbox"&&inputs[x].value==valor){statusInicial=inputs[x].checked;if(inputs[x].checked==false){if(acao=="mudacor") |
||
| 332 | document.getElementById(valor).style.backgroundColor="#bebebe";else if(acao=="remove") |
||
| 333 | document.getElementById(valor).style.backgroundColor="";}}}} |
||
| 334 | function mudaCorRadio(valor,acao) |
||
| 335 | {var inputs=document.getElementsByTagName('input');for(var x=0;x<inputs.length;x++){if(inputs[x].type=="radio"&&inputs[x].value==valor){if(inputs[x].checked==false){if(acao=="mudacor") |
||
| 336 | document.getElementById(valor).style.backgroundColor="#bebebe";else if(acao=="remove") |
||
| 337 | document.getElementById(valor).style.backgroundColor="";}}}} |
||
| 338 | function desmarcaTodos(nome) |
||
| 339 | {var inputs=document.getElementsByTagName('input');for(var x=0;x<inputs.length;x++){if(inputs[x].type=="checkbox"&&inputs[x].name==nome){inputs[x].checked=false;document.getElementById(inputs[x].value).style.backgroundColor="";}}} |
||
| 340 | function formataNumerico(campo){var result="";var vr=filtraCampo(campo);var tam=vr.length;var validChars="0123456789";for(var n=0;n<tam;n++){if(validChars.indexOf(vr.substring(n,n+1))!=-1) |
||
| 341 | result+=vr.substring(n,n+1);} |
||
| 342 | campo.value=result;return result;} |
||
| 343 | function formataDado(campo,tammax,pos,teclapres){var keyCode;if(teclapres.srcElement){keyCode=teclapres.keyCode;}else if(teclapres.target){keyCode=teclapres.which;} |
||
| 344 | if(keyCode==0||keyCode==8){return true;} |
||
| 345 | if((keyCode<48||keyCode>57)&&keyCode!=88&&(keyCode!=120)){return false;} |
||
| 346 | var tecla=keyCode;vr=campo.value;vr=vr.replace("-","");vr=vr.replace("/","");tam=vr.length;if(tam<tammax&&tecla!=8){tam=vr.length+1;} |
||
| 347 | if(tecla==8){tam=tam-1;} |
||
| 348 | if(tecla==8||tecla==88||tecla>=48&&tecla<=57||tecla>=96&&tecla<=105||tecla==120){if(tam<=2){campo.value=vr;} |
||
| 349 | if(tam>pos&&tam<=tammax){campo.value=vr.substr(0,tam-pos)+"-"+vr.substr(tam-pos,tam);}}} |
||
| 350 | function formataDado2(campo,tammax,pos,teclapres){var keyCode;if(teclapres.srcElement){keyCode=teclapres.keyCode;}else if(teclapres.target){keyCode=teclapres.which;} |
||
| 351 | if((keyCode<48||keyCode>57)&&keyCode!=8&&keyCode!=88&&(keyCode!=120)){return false;} |
||
| 352 | var tecla=keyCode;vr=campo.value;vr=vr.replace("-","");vr=vr.replace("/","");tam=vr.length;if(tam<tammax&&tecla!=8){tam=vr.length+1;} |
||
| 353 | if(tecla==8){tam=tam-1;} |
||
| 354 | if(tecla==8||tecla==88||tecla>=48&&tecla<=57||tecla>=96&&tecla<=105||tecla==120){if(tam<=2){campo.value=vr;} |
||
| 355 | if(tam>pos&&tam<=tammax){campo.value=vr.substr(0,tam-pos)+"-"+vr.substr(tam-pos,tam);campo.focus();}}} |
||
| 356 | function LimparMoeda(valor,validos){var result="";var aux;for(var i=0;i<valor.length;i++){aux=validos.indexOf(valor.substring(i,i+1));if(aux>=0){result+=aux;}} |
||
| 357 | return result;} |
||
| 358 | function FormataValor2(campo,tammax,teclapres,decimal){var tecla=teclapres.keyCode;vr=LimparMoeda(campo.value,"0123456789");tam=vr.length;dec=decimal |
||
| 359 | if(tam<tammax&&tecla!=8){tam=vr.length+1;} |
||
| 360 | if(tecla==8) |
||
| 361 | {tam=tam-1;} |
||
| 362 | if(tecla==8||tecla>=48&&tecla<=57||tecla>=96&&tecla<=105) |
||
| 363 | {if(tam<=dec) |
||
| 364 | {campo.value=vr;} |
||
| 365 | if((tam>dec)&&(tam<=5)){campo.value=vr.substr(0,tam-2)+","+vr.substr(tam-dec,tam);} |
||
| 366 | if((tam>=6)&&(tam<=8)){campo.value=vr.substr(0,tam-5)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-dec,tam);} |
||
| 367 | if((tam>=9)&&(tam<=11)){campo.value=vr.substr(0,tam-8)+"."+vr.substr(tam-8,3)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-dec,tam);} |
||
| 368 | if((tam>=12)&&(tam<=14)){campo.value=vr.substr(0,tam-11)+"."+vr.substr(tam-11,3)+"."+vr.substr(tam-8,3)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-dec,tam);} |
||
| 369 | if((tam>=15)&&(tam<=17)){campo.value=vr.substr(0,tam-14)+"."+vr.substr(tam-14,3)+"."+vr.substr(tam-11,3)+"."+vr.substr(tam-8,3)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-2,tam);}}} |
||
| 370 | function FormataData2(campo,teclapres){var tecla=teclapres.keyCode;vr=campo.value;vr=vr.replace("/","");vr=vr.replace("/","");tam=vr.length;if(tam<8&&tecla!=8){tam=vr.length+1;} |
||
| 371 | if(tecla==8){tam=tam-1;} |
||
| 372 | if(tecla==8||tecla>=48&&tecla<=57||tecla>=96&&tecla<=105){if(tam>=2&&tam<5){campo.value=vr.substr(0,tam-2)+'/'+vr.substr(tam-2,tam);} |
||
| 373 | if(tam>=5&&tam<=10){campo.value=vr.substr(0,2)+'/'+vr.substr(2,2)+'/'+vr.substr(4,4);}}} |
||
| 374 | function mostraFilhos(flagMostra,codDiv){if(flagMostra==1){document.getElementById("itensFilhos_"+codDiv).style.display='block';}else{document.getElementById("itensFilhos_"+codDiv).style.display='none';}} |
||
| 375 | function formataDado2(campo,tammax,pos,teclapres){var keyCode;if(teclapres.srcElement){keyCode=teclapres.keyCode;}else if(teclapres.target){keyCode=teclapres.which;} |
||
| 376 | if((keyCode<48||keyCode>57)&&keyCode!=8&&keyCode!=88&&(keyCode!=120)){return false;} |
||
| 377 | var tecla=keyCode;vr=campo.value;vr=vr.replace("-","");vr=vr.replace("/","");tam=vr.length;if(tam<tammax&&tecla!=8){tam=vr.length+1;} |
||
| 378 | if(tecla==8){tam=tam-1;} |
||
| 379 | if(tecla==8||tecla==88||tecla>=48&&tecla<=57||tecla>=96&&tecla<=105||tecla==120){if(tam<=2){campo.value=vr;} |
||
| 380 | if(tam>pos&&tam<=tammax){campo.value=vr.substr(0,tam-pos)+"-"+vr.substr(tam-pos,tam);campo.focus();}}} |
||
| 381 | function LimparMoeda(valor,validos){var result="";var aux;for(var i=0;i<valor.length;i++){aux=validos.indexOf(valor.substring(i,i+1));if(aux>=0){result+=aux;}} |
||
| 382 | return result;} |
||
| 383 | function FormataValor2(campo,tammax,teclapres,decimal){var tecla=teclapres.keyCode;vr=LimparMoeda(campo.value,"0123456789");tam=vr.length;dec=decimal |
||
| 384 | if(tam<tammax&&tecla!=8){tam=vr.length+1;} |
||
| 385 | if(tecla==8) |
||
| 386 | {tam=tam-1;} |
||
| 387 | if(tecla==8||tecla>=48&&tecla<=57||tecla>=96&&tecla<=105) |
||
| 388 | {if(tam<=dec) |
||
| 389 | {campo.value=vr;} |
||
| 390 | if((tam>dec)&&(tam<=5)){campo.value=vr.substr(0,tam-2)+","+vr.substr(tam-dec,tam);} |
||
| 391 | if((tam>=6)&&(tam<=8)){campo.value=vr.substr(0,tam-5)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-dec,tam);} |
||
| 392 | if((tam>=9)&&(tam<=11)){campo.value=vr.substr(0,tam-8)+"."+vr.substr(tam-8,3)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-dec,tam);} |
||
| 393 | if((tam>=12)&&(tam<=14)){campo.value=vr.substr(0,tam-11)+"."+vr.substr(tam-11,3)+"."+vr.substr(tam-8,3)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-dec,tam);} |
||
| 394 | if((tam>=15)&&(tam<=17)){campo.value=vr.substr(0,tam-14)+"."+vr.substr(tam-14,3)+"."+vr.substr(tam-11,3)+"."+vr.substr(tam-8,3)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-2,tam);}}} |
||
| 395 | function FormataData2(campo,teclapres){var tecla=teclapres.keyCode;vr=campo.value;vr=vr.replace("/","");vr=vr.replace("/","");tam=vr.length;if(tam<8&&tecla!=8){tam=vr.length+1;} |
||
| 396 | if(tecla==8){tam=tam-1;} |
||
| 397 | if(tecla==8||tecla>=48&&tecla<=57||tecla>=96&&tecla<=105){if(tam>=2&&tam<5){campo.value=vr.substr(0,tam-2)+'/'+vr.substr(tam-2,tam);} |
||
| 398 | if(tam>=5&&tam<=10){campo.value=vr.substr(0,2)+'/'+vr.substr(2,2)+'/'+vr.substr(4,4);}}} |
||
| 399 | function mostrarPasseioVirutal(){document.getElementById("conteudoBoasVindas").style.display='none';document.getElementById("passeioVirtual").style.display='';} |
||
| 400 | function voltarTelaPasseioVirutal(){document.getElementById("passeioVirtual").style.display='none';document.getElementById("conteudoBoasVindas").style.display='';} |