var popupArguments = null;
function openPopupUpload(contextoLayout, inputUpload, urlUpload) {
var popupUrl = contextoLayout + '_html/pop_upload.html';
popupArguments = new Array(2);
popupArguments[0] = inputUpload;
popupArguments[1] = urlUpload;
var popWidth = 343;
var popHeight = 169;
var popLeft = parseInt((screen.availWidth - popWidth) / 2);
var popTop = parseInt((screen.availHeight - popHeight) / 2);
var popupFeatures = 'width='+popWidth
+ ',height='
+ popHeight
+ ',left='
+ popLeft
+ ',top='
+ popTop
+ ',location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,hotkeys=0';
popupUpload = window.open(popupUrl, null, popupFeatures, true);
}
function getPopupArguments() {
return (popupArguments) ? popupArguments : new Array();
}
var modalArgumentsTermoUso;
function openModalTermoUso(contextoLayout, nomeBanco) {
var modalUrl = contextoLayout + '_html/pop_termo.html?banco='+ nomeBanco;
modalArgumentsTermoUso = new Array(1);
modalArgumentsTermoUso[0] = nomeBanco;
if (window.showModalDialog){
var modalFeatures = 'dialogWidth: 415px; dialogHeight: 460px; center:yes; resizable:no; status:no;';
window.showModalDialog(modalUrl, modalArgumentsTermoUso, modalFeatures);
}else{
xposition=0; yposition=0;
if (parseInt(navigator.appVersion) >= 4){
xposition = (screen.width - 415) / 2;
yposition = (screen.height - 460) / 2;
}
var modalFeatures =  "width=415, height=460, menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,hotkeys=0," +
"screenx=" + xposition + "," + "screeny=" + yposition ;
window.open(modalUrl, '', modalFeatures);
}
}
var modalArgumentsPoliticaPrivacidade;
function openModalPoliticaPrivacidade(contextoLayout, nomeBanco) {
var modalUrl = contextoLayout + '_html/pop_politica.html?banco='+ nomeBanco;
modalArgumentsPoliticaPrivacidade = new Array(1);
modalArgumentsPoliticaPrivacidade[0] = nomeBanco;
if (window.showModalDialog){
var modalFeatures = 'dialogWidth: 415px; dialogHeight: 460px; center:yes; resizable:no; status:no;';
window.showModalDialog(modalUrl, modalArgumentsPoliticaPrivacidade, modalFeatures);
}else{
xposition=0; yposition=0;
if (parseInt(navigator.appVersion) >= 4){
xposition = (screen.width - 415) / 2;
yposition = (screen.height - 460) / 2;
}
var modalFeatures =  "width=415, height=460, menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,hotkeys=0," +
"screenx=" + xposition + "," + "screeny=" + yposition ;
window.open(modalUrl, '', modalFeatures);
}
}
var modalArgumentsSeguranca;
function openModalSeguranca(contextoLayout, nomeBanco) {
var modalUrl = contextoLayout + '_html/pop_seguranca.html?banco='+ nomeBanco;
modalArgumentsSeguranca = new Array(1);
modalArgumentsSeguranca[0] = nomeBanco;
if (window.showModalDialog){
var modalFeatures = 'dialogWidth: 415px; dialogHeight: 460px; center:yes; resizable:no; status:no;';
window.showModalDialog(modalUrl, modalArgumentsSeguranca, modalFeatures);
}else{
xposition=0; yposition=0;
if (parseInt(navigator.appVersion) >= 4){
xposition = (screen.width - 415) / 2;
yposition = (screen.height - 460) / 2;
}
var modalFeatures =  "width=415, height=460, menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,hotkeys=0," +
"screenx=" + xposition + "," + "screeny=" + yposition ;
window.open(modalUrl, '', modalFeatures);
}
}
var modalArgumentsSobre;
function openModalSobre(contextoLayout, versaoModulos, versaoBases) {
var modalUrl = contextoLayout + '_html/pop_sobre.html';
modalArgumentsSobre = new Array(2);
modalArgumentsSobre[0] = versaoModulos;
modalArgumentsSobre[1] = versaoBases;
if (window.showModalDialog){
var modalFeatures = 'dialogWidth: 415px; dialogHeight: 460px; center:yes; resizable:no; status:no;';
window.showModalDialog(modalUrl, modalArgumentsSobre, modalFeatures);
}else{
xposition=0; yposition=0;
if (parseInt(navigator.appVersion) >= 4){
xposition = (screen.width - 415) / 2;
yposition = (screen.height - 460) / 2;
}
var modalFeatures =  "width=415, height=460, menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,hotkeys=0," +
"screenx=" + xposition + "," + "screeny=" + yposition ;
window.open(modalUrl, '', modalFeatures);
}
}
function openModalConfirmacao(contextoLayout, mensagem, inputField) {
var modalUrl = contextoLayout + '_html/pop_confirmacao.html';
var modalArguments = new Array(2);
modalArguments[0] = mensagem;
modalArguments[1] = inputField;
var modalFeatures = 'dialogWidth: 300px; dialogHeight: 150px; center:yes; resizable:no; status:no;';
window.showModalDialog(modalUrl, modalArguments, modalFeatures);
}
var timer=null;
var functionName=null;
function openModalSessao(contextoLayout, tempo, funcao) {
timer = tempo;
functionName = funcao;
modalUrl = contextoLayout + '_html/pop_sessao.html';
if (window.showModalDialog){
var modalArguments = new Array(1);
modalArguments[0] = timer;
var modalFeatures = 'dialogWidth: 250px; dialogHeight: 190px; center:yes; resizable:no; status:no;';
var value = window.showModalDialog(modalUrl, modalArguments, modalFeatures);
eval(functionName + "(" + value + ")");
}else{
xposition=0; yposition=0;
if (parseInt(navigator.appVersion) >= 4){
xposition = (screen.width - 250) / 2;
yposition = (screen.height - 190) / 2;
}
var modalFeatures =  "width=250, height=190, menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,hotkeys=0," +
"screenx=" + xposition + "," + "screeny=" + yposition ;
newWin  = window.open(modalUrl, '', modalFeatures);
}
}
function criptografaSenhaTB(senha) {
var soma = 0;
var tamanho, indice, ascii = 0, caractereSenha, matrizSenha;
matrizSenha = senha.toUpperCase();
tamanho = matrizSenha.length;
for (indice = 0; indice < tamanho; indice++ ) {
caractereSenha = matrizSenha.charAt(indice);
if (caractereSenha == char2ansi(' ')) {
ascii = 91;
} else if (char2ansi(caractereSenha) >= char2ansi('#') && char2ansi(caractereSenha) <= char2ansi('Z')) {
ascii = char2ansi(caractereSenha) + 34;
} else {
ascii = char2ansi(caractereSenha) + 64;
}
soma += (ascii * (indice + 1) * (indice + 1));
}
return soma;
}
function dec2hex(n) {
var lo = n % 16;
return dec2hexS.charAt((n-lo)/16) + dec2hexS.charAt(lo);
}
dec2hexS = "0123456789ABCDEF";
function char2ansi(c) {
if( !c ) return 0;
return char2ansiS.indexOf( c )+1;
}
for( char2ansiS="", i=1 ; i<=255 ; i++ )
char2ansiS += unescape("%"+dec2hex(i));
window.onerror=null;
function janela_centralizada(url,nome_pagina,largura,altura,center,loc,scroll) {
xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
xposition = (screen.width - largura) / 2;
yposition = (screen.height - altura) / 2;
}
args = "width=" + largura + ","
+ "height=" + altura + ","
+ "location="+ loc +","
+ "menubar=0,"
+ "resizable=1,"
+ "scrollbars=" + scroll +","
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + ","
+ "screeny=" + yposition + ","
+ "left=" + xposition + ","
+ "top=" + yposition;
var win = open (url,nome_pagina,args,loc);
win.focus();
return win;
}
function abreJanela(url, nome_pagina) {
args = "width=450," +
"height=400," +
"location=0," +
"menubar=0," +
"resizable=1," +
"scrollbars=1," +
"status=0," +
"titlebar=0," +
"toolbar=0," +
"hotkeys=0," +
"screenx=0," +
"screeny=0," +
"left=0," +
"top=0";
var win = open (parseUrl(url), nome_pagina, args);
win.focus();
return window.open(parseUrl(url), nome_pagina, args);
}
function abrePopJanela(url, nome_pagina) {
args = "width=450," +
"height=400," +
"location=0," +
"menubar=0," +
"resizable=0," +
"scrollbars=1," +
"status=0," +
"titlebar=0," +
"toolbar=0," +
"hotkeys=0," +
"screenx=0," +
"screeny=0," +
"left=0," +
"top=0";
var win = open (url, nome_pagina, args);
win.focus();
return window.open(url, nome_pagina, args);
}
function showActionLegend(picOver){
document.legendaAction.src = picOver.src;
return true;
}
function menorQue(parm1, parm2) {
return parm1 < parm2;
}
function parseUrl(url) {
var rePipe = /\|/gi;
var reAmp = /\&/gi;
var newURL = url.replace(reAmp, "%26");
return newURL.replace(rePipe, "&");
}
function setaCor(campoCodigoCor, campoCor){
if (campoCodigoCor != null && campoCodigoCor.value == ""){
campoCor.style.background = '#FFFFFF';
}
}
function isNulo(valor) {
return (valor == null) ? true : false;
}
function isVazio(valor) {
return (valor != null && valor == '') ? true : false;
}
function isZerado(valor) {
return (valor != null && valor == 0) ? true : false;
}
function isValorado(valor) {
return (valor != null && valor != '') ? true : false;
}
