function markSelectedPane(C){var E;if(!(C)){var B=$Base("sitePaneSelected");if(B&&B.value!=""){C=B.value;}else{C=-1;}}if(C!=-1){var A=$Base("sitePane"+C);if(A){var G=A.href;if(G.indexOf("&timemilis=")>-1){A.href=G.substring(0,A.href.indexOf("&timemilis="))+"&timemilis="+(new Date()-1);}else{A.href=G+"&timemilis="+(new Date()-1);}}}var D=0;var F=true;while(F){E=$Base("sitePane"+D);if(E){if(D==C){}else{E.className="ItemTab";}}else{F=false;}D=D+1;}}function updateStileSelectedPane(A){var B=0;var C=true;while(C){paneTmp=$Base("sitePane"+B);if(paneTmp){if(B==A){paneTmp.className="TabSelect";}else{paneTmp.className="ItemTab";}}else{C=false;}B=B+1;}}function validaFormSicrediInternet(){var D=document.getElementById("formSicrediInternet");var F=document.getElementById("unidadeAtendimento");var E=document.getElementById("conta");completeNumberField(F,4);completeNumberField(E,6);if(F.value.length<4||Number(F.value)==0){F.value="";F.focus();alert("O campo Cooperativa deve ser preenchido.","POPUP_ALERT");if(E.value.length<6||Number(E.value)==0){E.value="";return false;}}else{if(E.value.length<6||Number(E.value)==0){if(F.value.length<4||Number(F.value)==0){F.value="";return false;}alert("O campo Conta deve ser preenchido.","POPUP_ALERT");E.value="";F.focus();return false;}}return true;}function sendLogin(){var B=document.getElementById("formSicrediInternet");url_ib="https://si-web.sicredi.com.br/frameset.jsp?g=IB.Acesso.CheckAccount.task&unidadeAtendimento="+B.unidadeAtendimento.value+"&conta="+B.conta.value;popNewWindow=window.open("about:blank","popNewWindow","width=800, height=600, statusbar=yes, location=no, top=20, left=20, resizable=yes, scrollbars=yes");popNewWindow.location=url_ib;B.unidadeAtendimento.value="";B.conta.value="";}function sendLoginNovoIB(){var B=document.getElementById("formSicrediInternet");url_ib="https://internet.sicreditotal.com.br/stiapp/";dataMillis=new Date().valueOf();params_ib="?timeMillis="+dataMillis+"&coopFill="+B.unidadeAtendimento.value+"&contaFill="+B.conta.value;popNewWindow=window.open("about:blank","popNewWindow","width=800, height=600, statusbar=yes, location=no, top=20, left=20, resizable=yes, scrollbars=yes");popNewWindow.location=url_ib+params_ib;B.unidadeAtendimento.value="";B.conta.value="";}function sendOffline(){var B=document.getElementById("formSicrediInternet");url_ib="indisponivel.html";popNewWindow=window.open("about:blank","popNewWindow","width=800, height=365, statusbar=yes, location=no, top=20, left=20, resizable=yes, scrollbars=yes");popNewWindow.location=url_ib;B.unidadeAtendimento.value="";B.conta.value="";}function verificaEnterSicredi(D){var C=D.keyCode;if(C==13){managePopup();}}function saltaCampo(G,L,H,I){if(isControlKey(I.keyCode)){return ;}var J=document.getElementById("formSicrediInternet");var K=I.keyCode;vr=J[G].value;tam=vr.length;if(tam==H){J[L].focus();}else{if(I.keyCode==13){completeNumberField(J[G],4);J[L].focus();}}}function completeNumberField(E,D){if(E.value!=""){var F=E.value.length;if(F<D){for(i=0;i<(D-F);i++){E.value="0"+E.value;}}}}function handleVerifyWhiteList(A){if(A[0]=="true"){if(A[1]=="indisponivel"){sendOffline();}else{sendLoginNovoIB();}}else{sendLogin();}}function validaLogin(){if(validaFormSicrediInternet()){var A=document.getElementById("unidadeAtendimento");var B=document.getElementById("conta");whiteList.isPermitted(A.value,B.value,handleVerifyWhiteList);return true;}return false;}function managePopup(){if(!validaFormSicrediInternet()){return ;}popNewWindow=window.open("about:blank","_blank","width=800, height=600, statusbar=yes, location=no, top=20, left=20, resizable=yes, scrollbars=yes");unidadeAtendimento=document.getElementById("unidadeAtendimento");conta=document.getElementById("conta");var A=applicationURL+"whiteListServlet";var B="?unidadeAtendimento="+unidadeAtendimento.value+"&conta="+conta.value;popNewWindow.location=A+B;unidadeAtendimento.value="";conta.value="";}function validaLoginDWR(){if(validaFormSicrediInternet()){var A=document.getElementById("unidadeAtendimento");var B=document.getElementById("conta");whiteList.isPermitted(A.value,B.value,handleVerifyWhiteList);return true;}return false;}
