
function geral(){this.pegarObj=function(idObjeto){if(!idObjeto.tagName){return document.getElementById(idObjeto);}
else{return idObjeto;}}
this.ltrim=function(textoInicial){if(!textoInicial){return"";}
else{while((textoInicial.length>0)&&(textoInicial.charAt(0)==" ")){textoInicial=textoInicial.substr(1);}
return textoInicial;}}
this.rtrim=function(textoInicial){if(!textoInicial){return"";}
else{while((textoInicial.length>0)&&(textoInicial.charAt(textoInicial.length-1)==" ")){textoInicial=textoInicial.substr(0,textoInicial.length-1);}
return textoInicial;}}
this.trim=function(textoInicial){if(!textoInicial){return"";}
else{return this.rtrim(this.ltrim(textoInicial));}}
this.ucfirst=function(textoInicial){var f=textoInicial.charAt(0).toUpperCase();return f+textoInicial.substr(1,textoInicial.length-1);}
this.strpos=function(haystack,needle,offset){if(offset==undefined){offset=0;}
var i=haystack.indexOf(needle,offset);return i>=0?i:false;}
this.strripos=function(haystack,needle){haystack=this.converterLowercase(haystack);needle=this.converterLowercase(needle);var i=haystack.lastIndexOf(needle);return i>=0?i:false;}
this.converterLowercase=function(textoInicial){var caracteresEspeciais=new Array();caracteresEspeciais[caracteresEspeciais.length]=new Array("á","Á");caracteresEspeciais[caracteresEspeciais.length]=new Array("à","À");caracteresEspeciais[caracteresEspeciais.length]=new Array("ã","Ã");caracteresEspeciais[caracteresEspeciais.length]=new Array("â","Â");caracteresEspeciais[caracteresEspeciais.length]=new Array("ä","Ä");caracteresEspeciais[caracteresEspeciais.length]=new Array("é","É");caracteresEspeciais[caracteresEspeciais.length]=new Array("è","È");caracteresEspeciais[caracteresEspeciais.length]=new Array("ê","Ê");caracteresEspeciais[caracteresEspeciais.length]=new Array("ë","Ë");caracteresEspeciais[caracteresEspeciais.length]=new Array("í","Í");caracteresEspeciais[caracteresEspeciais.length]=new Array("ì","Ì");caracteresEspeciais[caracteresEspeciais.length]=new Array("î","Î");caracteresEspeciais[caracteresEspeciais.length]=new Array("ï","Ï");caracteresEspeciais[caracteresEspeciais.length]=new Array("ó","Ó");caracteresEspeciais[caracteresEspeciais.length]=new Array("ò","Ò");caracteresEspeciais[caracteresEspeciais.length]=new Array("õ","Õ");caracteresEspeciais[caracteresEspeciais.length]=new Array("ô","Ô");caracteresEspeciais[caracteresEspeciais.length]=new Array("ö","Ö");caracteresEspeciais[caracteresEspeciais.length]=new Array("ú","Ú");caracteresEspeciais[caracteresEspeciais.length]=new Array("ù","Ù");caracteresEspeciais[caracteresEspeciais.length]=new Array("û","Û");caracteresEspeciais[caracteresEspeciais.length]=new Array("ü","Ü");caracteresEspeciais[caracteresEspeciais.length]=new Array("ç","Ç");caracteresEspeciais[caracteresEspeciais.length]=new Array("ñ","Ñ");textoInicial=textoInicial.toLowerCase();for(var i=0;i<caracteresEspeciais.length;i++){textoInicial.replace(caracteresEspeciais[i][1],caracteresEspeciais[i][0]);}
return textoInicial;}
this.converterUppercase=function(textoInicial){var caracteresEspeciais=new Array();caracteresEspeciais[caracteresEspeciais.length]=new Array("Á","á");caracteresEspeciais[caracteresEspeciais.length]=new Array("À","à");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ã","ã");caracteresEspeciais[caracteresEspeciais.length]=new Array("Â","â");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ä","ä");caracteresEspeciais[caracteresEspeciais.length]=new Array("É","é");caracteresEspeciais[caracteresEspeciais.length]=new Array("È","è");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ê","ê");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ë","ë");caracteresEspeciais[caracteresEspeciais.length]=new Array("Í","í");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ì","ì");caracteresEspeciais[caracteresEspeciais.length]=new Array("Î","î");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ï","ï");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ó","ó");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ò","ò");caracteresEspeciais[caracteresEspeciais.length]=new Array("Õ","õ");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ô","ô");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ö","ö");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ú","ú");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ù","ù");caracteresEspeciais[caracteresEspeciais.length]=new Array("Û","û");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ü","ü");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ç","ç");caracteresEspeciais[caracteresEspeciais.length]=new Array("Ñ","ñ");textoInicial=textoInicial.toUpperCase();for(var i=0;i<caracteresEspeciais.length;i++){textoInicial.replace(caracteresEspeciais[i][1],caracteresEspeciais[i][0]);}
return textoInicial;}
this.ucwords=function(textoInicial){return textoInicial.replace(/^(.)|\s(.)/g,function($1){return $1.toUpperCase();});}
this.str_replace=function(search,replace,subject,count){var i=0,j=0,temp='',repl='',sl=0,fl=0,f=[].concat(search),r=[].concat(replace),s=subject,ra=r instanceof Array,sa=s instanceof Array;s=[].concat(s);if(count){this.window[count]=0;}
for(i=0,sl=s.length;i<sl;i++){if(s[i]===''){continue;}
for(j=0,fl=f.length;j<fl;j++){temp=s[i]+'';repl=ra?(r[j]!==undefined?r[j]:''):r[0];s[i]=(temp).split(f[j]).join(repl);if(count&&s[i]!==temp){this.window[count]+=(temp.length-s[i].length)/f[j].length;}}}
return sa?s:s[0];}
this.retiraAcentos=function(texto){array1=new Array("á","à","â","ã","ä","é","è","ê","ë","í","ì","î","ï","ó","ò","ô","õ","ö","ú","ù","û","ü","ç","Á","À","Â","Ã","Ä","É","È","Ê","Ë","Í","Ì","Î","Ï","Ó","Ò","Ô","Õ","Ö","Ú","Ù","Û","Ü","Ç");array2=new Array("a","a","a","a","a","e","e","e","e","i","i","i","i","o","o","o","o","o","u","u","u","u","c","A","A","A","A","A","E","E","E","E","I","I","I","I","O","O","O","O","O","U","U","U","U","C");for(var i=0;i<array1.length;i++){texto=texto.replace(array1[i],array2[i]);}
return texto;}
this.verificarEmail=function(email){if(this.trim(email)!=""){var expressaoEmail= /^[\w-]+(\.[\w-]+)*@(([\w-]{2,63}\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/; return expressaoEmail.test(email);}
else{return false;}}
this.verificarUsuario=function(usuario){if(this.trim(usuario)!=""){var expressaoUsuario=new RegExp("^([a-z]+[a-z0-9]*_*[a-z0-9]+)$");return expressaoUsuario.test(usuario);}
else{return false;}}
this.versaoBrowser=function(){var parametrosDeteccaoBrowser=new Array();parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={stringIdentificacao:navigator.userAgent,stringReferencia:"OmniWeb",stringReferenciaVersao:"OmniWeb/",identificacao:"OmniWeb"};parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={stringIdentificacao:navigator.vendor,stringReferencia:"Apple",identificacao:"Safari"};parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={propriedadeUnica:window.opera,identificacao:"Opera"};parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={stringIdentificacao:navigator.vendor,stringReferencia:"iCab",identificacao:"iCab"};parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={stringIdentificacao:navigator.vendor,stringReferencia:"KDE",identificacao:"Konqueror"};parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={stringIdentificacao:navigator.userAgent,stringReferencia:"Firefox",identificacao:"Firefox"};parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={stringIdentificacao:navigator.vendor,stringReferencia:"Camino",identificacao:"Camino"};parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={stringIdentificacao:navigator.userAgent,stringReferencia:"Netscape",identificacao:"Netscape"};parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={stringIdentificacao:navigator.userAgent,stringReferencia:"MSIE",stringReferenciaVersao:"MSIE",identificacao:"Internet Explorer"};parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={stringIdentificacao:navigator.userAgent,stringReferencia:"Gecko",stringReferenciaVersao:"rv",identificacao:"Mozilla"};parametrosDeteccaoBrowser[parametrosDeteccaoBrowser.length]={stringIdentificacao:navigator.userAgent,stringReferencia:"Mozilla",stringReferenciaVersao:"Mozilla",identificacao:"Netscape"};var parametrosDeteccaoSistemaOperacional=new Array();parametrosDeteccaoSistemaOperacional[parametrosDeteccaoSistemaOperacional.length]={stringIdentificacao:navigator.platform,stringReferencia:"Win",identificacao:"Windows"};parametrosDeteccaoSistemaOperacional[parametrosDeteccaoSistemaOperacional.length]={stringIdentificacao:navigator.platform,stringReferencia:"Mac",identificacao:"Mac OS"};parametrosDeteccaoSistemaOperacional[parametrosDeteccaoSistemaOperacional.length]={stringIdentificacao:navigator.platform,stringReferencia:"Linux",identificacao:"GNU/Linux"};var procuraString=function(dados){for(var i=0;i<dados.length;i++){dados[i].stringReferenciaVersao=dados[i].stringReferenciaVersao||dados[i].identificacao;if(dados[i].propriedadeUnica){return dados[i];}
else{if((dados[i].stringIdentificacao)&&(dados[i].stringIdentificacao.indexOf(dados[i].stringReferencia)!=-1)){return dados[i];}}}}
var procuraVersao=function(stringReferenciaVersao,stringIdentificacao){var indice=stringIdentificacao.indexOf(stringReferenciaVersao);if(indice!=-1){return parseFloat(stringIdentificacao.substring(indice+stringReferenciaVersao.length+1));}}
var navegador=procuraString(parametrosDeteccaoBrowser)||"";var versaoNavegador=procuraVersao(navegador.stringReferenciaVersao,navigator.userAgent)||procuraVersao(navegador.stringReferenciaVersao,navigator.appVersion)||0;var sistemaOperacional=procuraString(parametrosDeteccaoSistemaOperacional)||"";return[navegador.identificacao,versaoNavegador,sistemaOperacional.identificacao];}
this.formatarValor=function(valor){if(arguments.length>1){var variacaoDecimal=arguments[1];}
else{var variacaoDecimal=2;}
if(valor<0){var negativo=true;}
var valorString=valor.toString();if(negativo){valorString=valorString.substr(1);}
var complemento="";for(var i=0;i<variacaoDecimal+1;i++){complemento+="0";}
if(valorString.length<variacaoDecimal+1){valorString=complemento+valorString;valorString=valorString.substr(valorString.length-(variacaoDecimal+1),variacaoDecimal+1);}
var parteInteira=valorString.substr(0,valorString.length-variacaoDecimal);var parteInteiraFormatada="";var qtdeSeparadores=0;for(var i=parteInteira.length-1;i>=0;i--){if((parteInteiraFormatada.length>0)&&(((parteInteiraFormatada.length-qtdeSeparadores)%3==0))){parteInteiraFormatada="."+parteInteiraFormatada;qtdeSeparadores++;}
parteInteiraFormatada=parteInteira.charAt(i)+parteInteiraFormatada;}
valorString=parteInteiraFormatada+","+valorString.substr(valorString.length-variacaoDecimal,variacaoDecimal);if(negativo){valorString='-'+valorString;}
return valorString;}
this.inteiro=function(valor){if(valor==""){return"0";}
if(!valor.length){var valor=valor.toString();}
var inverterSeparador=false;if(arguments.length>1){var casasDecimais=arguments[1];if(arguments.length>2){var inverterSeparador=arguments[2];}}
else{var casasDecimais=0;}
var caracteresDecimais="";for(var i=0;i<casasDecimais;i++){caracteresDecimais+="0";}
valor=this.trim(valor);if(inverterSeparador){var separador1=",";var separador2=".";}
else{var separador1=".";var separador2=",";}
var partes=new Array();partes=valor.split(separador1);valor=partes.join("");var partes=new Array();partes=valor.split(separador2);partes[1]=(partes[1])?partes[1].concat(caracteresDecimais).substr(0,casasDecimais):caracteresDecimais;var valorStr=partes.join("");var i=0;while((valorStr.length>1)&&(valorStr.charAt(i)=="0")){valorStr=valorStr.substr(1);}
return parseInt(valorStr);}
this.inArray=function(textoProcura,arrayElementos){var retorno=false;if(arrayElementos.length){for(var i=0;i<arrayElementos.length;i++){if(arrayElementos[i]==textoProcura){var retorno=i;break;}}}
return retorno;}
this.verificarCPF=function(cpf){var digitoVerificador=new Array();var cpfInvalido=new Array("00000000000","11111111111","22222222222","33333333333","44444444444","55555555555","66666666666","77777777777","88888888888","99999999999");if(!cpf.length){return false;}
var numerosCPF=cpf.match(/\d/g);if(numerosCPF.length){var cpf=numerosCPF.join("");}
else{return false;}
if((cpf.length!=11)||(this.inArray(cpf,cpfInvalido)!==false)){return false;}
var soma=0;for(var i=0;i<cpf.length-2;i++){soma+=cpf.charAt(i)*(10-i);}
digitoVerificador[0]=11-(soma%11);if((digitoVerificador[0]==10)||(digitoVerificador[0]==11)){digitoVerificador[0]=0;}
var soma=0;for(var i=0;i<cpf.length-1;i++){soma+=cpf.charAt(i)*(11-i);}
digitoVerificador[1]=11-(soma%11);if((digitoVerificador[1]==10)||(digitoVerificador[1]==11)){digitoVerificador[1]=0;}
if((digitoVerificador[0]==cpf.charAt(cpf.length-2))&&(digitoVerificador[1]==cpf.charAt(cpf.length-1))){return true;}
else{return false;}}
this.fatorial=function(numero){if(numero<2){return 1;}
return numero*this.fatorial(numero-1);}
this.combinacoes=function(numeros,qtdeAgrupamento){var retorno=new Array();var indiceAtual=new Array();var qtdeCombinacoes=Math.floor(this.fatorial(numeros.length)/(this.fatorial(numeros.length-qtdeAgrupamento)*this.fatorial(qtdeAgrupamento)));var maiorIndiceColuna=0;for(var i=0;i<qtdeAgrupamento;i++){indiceAtual[i]=i;}
retorno[retorno.length]=new Array();for(var j=0;j<qtdeAgrupamento;j++){retorno[retorno.length-1][j]=numeros[indiceAtual[j]];}
for(var i=0;i<qtdeCombinacoes-1;i++){for(var j=qtdeAgrupamento-1;j>=0;j--){maiorIndiceColuna=numeros.length-qtdeAgrupamento+j;if(indiceAtual[j]<maiorIndiceColuna){indiceAtual[j]++;for(var k=j+1;k<qtdeAgrupamento;k++){indiceAtual[k]=indiceAtual[j]+k-j;}
break;}}
retorno[retorno.length]=new Array();for(var j=0;j<qtdeAgrupamento;j++){retorno[retorno.length-1][j]=numeros[indiceAtual[j]];}}
return retorno;}
this.verificarData=function(dataReferencia){if(!dataReferencia){var dataReferencia="01/01/1900";}
if(arguments.length>2){var diaReferencia=this.inteiro(arguments[0]);var mesReferencia=this.inteiro(arguments[1]);var anoReferencia=this.inteiro(arguments[2]);}
else{var partes=dataReferencia.split("/");var diaReferencia=this.inteiro(partes[0]);var mesReferencia=this.inteiro(partes[1]);var anoReferencia=this.inteiro(partes[2]);}
var novaData=new Date();novaData.setFullYear(anoReferencia);novaData.setMonth(mesReferencia-1,diaReferencia);novaData.setDate(diaReferencia);if((novaData.getDate()!=diaReferencia)||(novaData.getMonth()!=(mesReferencia-1))||(novaData.getFullYear()!=anoReferencia)){return false;}
else{return true;}}
this.verificarHorario=function(horarioReferencia){horarioReferencia=this.trim(horarioReferencia);if((horarioReferencia.length<5)||((horarioReferencia.length>5&&horarioReferencia.length<8)||horarioReferencia.length>8)){return false;}
if(horarioReferencia.length==5){horarioReferencia+=":00";}
if(horarioReferencia.substr(2,1)!=":"||horarioReferencia.substr(5,1)!=":"){return false;}
if(arguments.length>2){var horaReferencia=this.inteiro(arguments[0]);var minutoReferencia=this.inteiro(arguments[1]);var segundoReferencia=this.inteiro(arguments[2]);}
else{var partes=horarioReferencia.split(":");var horaReferencia=this.inteiro(partes[0]);var minutoReferencia=this.inteiro(partes[1]);var segundoReferencia=this.inteiro(partes[2]);if(isNaN(partes[0])||isNaN(partes[1])||isNaN(partes[2])){return false;}}
var novoHorario=new Date();novoHorario.setHours(horaReferencia);novoHorario.setMinutes(minutoReferencia);if((novoHorario.getHours()!=horaReferencia)||(novoHorario.getMinutes()!=minutoReferencia)||(segundoReferencia>60||segundoReferencia<0)){return false;}
else{return true;}}
this.campoData=function(obj){if(!obj.tagName){obj=this.pegarObj(obj);}
if(!obj){return false;}
obj.maxLength=10;obj.onblur2=(obj.onblur)?obj.onblur:function(e){return false;};obj.onblur=function(e){this.onblur2(e);if(this.value!=""){var novaData=new Date();var diaAtual=novaData.getDate();var mesAtual=novaData.getMonth()+1;var anoAtual=novaData.getFullYear();var partes=this.value.split("/");partes[0]=(partes[0])?partes[0]:diaAtual;partes[1]=(partes[1])?partes[1]:mesAtual;partes[2]=(partes[2])?partes[2]:anoAtual;partes[0]="0".concat(partes[0]);partes[1]="0".concat(partes[1]);partes[0]=partes[0].charAt(partes[0].length-2).concat(partes[0].charAt(partes[0].length-1));partes[1]=partes[1].charAt(partes[1].length-2).concat(partes[1].charAt(partes[1].length-1));if(partes[2].length==2){if((inteiro(partes[2])>=90)&&(inteiro(partes[2])<=99)){partes[2]=(inteiro(anoAtual.toString().substr(0,2))-1)+""+partes[2];}
else{partes[2]=inteiro(anoAtual.toString().substr(0,2))+""+partes[2];}}
this.value=partes[0]+"/"+partes[1]+"/"+partes[2];}}
obj.onchange2=(obj.onchange)?obj.onchange:function(e){return false;};obj.onchange=function(e){this.onchange2(e);var novoValor="";for(var i=0;i<this.value.length;i++){if((this.value.charCodeAt(i)>46)&&(this.value.charCodeAt(i)<58)){novoValor+=this.value.charAt(i);}}
if(this.value!=novoValor){this.value=novoValor;}}
obj.onkeydown2=(obj.onkeydown)?obj.onkeydown:function(e){return false;};obj.onkeydown=function(e){this.onkeydown2(e);if(!e){e=window.event;var tecla=e.keyCode;}
else{var tecla=e.which;}
var teclaCtrl=e.ctrlKey;var teclaShift=e.shiftKey;var partes=this.value.split("/");if((teclaShift==false)&&((tecla>47)&&(tecla<58)||(tecla>95)&&(tecla<106))){if(((this.value.length==2)||(this.value.length==5))&&(partes.length<3)&&(this.value.charAt(0)!="/")&&(this.value.charAt(this.value.length-1)!="/")){this.value+="/";}
return true;}
else{if((tecla==8)||(tecla==9)||(tecla==46)||(tecla==35)||(tecla==36)||(tecla==37)||(tecla==39)||((teclaCtrl==true)&&(tecla==67))||((teclaCtrl==true)&&(tecla==86))){return true;}
else{return false;}}}}
this.campoHora=function(obj){if(!obj.tagName){obj=this.pegarObj(obj);}
if(!obj){return false;}
obj.onkeydownCampoHora=(obj.onkeydown)?obj.onkeydown:function(e){return false;};obj.onkeydown=function(e){this.onkeydownCampoHora(e);if(!e){e=window.event;var tecla=e.keyCode;}
else{var tecla=e.which;}
var teclaCtrl=e.ctrlKey;var teclaShift=e.shiftKey;var partes=this.value.split(":");if((teclaShift==false)&&((tecla>47)&&(tecla<58)||(tecla>95)&&(tecla<106))){return true;}
else{if((tecla==8)||(tecla==9)||(tecla==46)||(tecla==35)||(tecla==36)||(tecla==37)||(tecla==39)||((teclaCtrl==true)&&(tecla==67))||((teclaCtrl==true)&&(tecla==86))||((teclaShift==true)&&((tecla==59)||(tecla==191)))){return true;}
else{return false;}}}}
this.campoNumero=function(obj){if(!obj.tagName){obj=this.pegarObj(obj);}
if(!obj){return false;}
obj.onkeydownCampoNumero=(obj.onkeydown)?obj.onkeydown:function(e){return false;};obj.onkeydown=function(e){this.onkeydownCampoNumero(e);if(!e){e=window.event;var tecla=e.keyCode;}
else{var tecla=e.which;}
var teclaCtrl=e.ctrlKey;var teclaShift=e.shiftKey;var partes=this.value.split("/");if((teclaShift==false)&&((tecla>47)&&(tecla<58)||(tecla>95)&&(tecla<106))){return true;}
else{if((tecla==8)||(tecla==9)||(tecla==46)||(tecla==35)||(tecla==36)||(tecla==37)||(tecla==39)||(tecla==188)||(tecla==110)||((teclaCtrl==true)&&(tecla==67))||((teclaCtrl==true)&&(tecla==86))){return true;}
else{return false;}}}}
this.campoNumeroInteiro=function(obj){if(!obj.tagName){obj=this.pegarObj(obj);}
if(!obj){return false;}
obj.onkeydownCampoNumeroInteiro=(obj.onkeydown)?obj.onkeydown:function(e){return true;};obj.onkeydown=function(e){this.onkeydownCampoNumeroInteiro(e);if(!e){e=window.event;var tecla=e.keyCode;}
else{var tecla=e.which;}
var teclaCtrl=e.ctrlKey;var teclaShift=e.shiftKey;var partes=this.value.split("/");if((teclaShift==false)&&((tecla>47)&&(tecla<58)||(tecla>95)&&(tecla<106))){return true;}
else{if((tecla==8)||(tecla==9)||(tecla==46)||(tecla==35)||(tecla==36)||(tecla==37)||(tecla==39)||((teclaCtrl==true)&&(tecla==67))||((teclaCtrl==true)&&(tecla==86))){return true;}
else{return false;}}}}
this.processaAtalhoEnter=function(e){if(!e){e=window.event;var obj=e.srcElement;var tecla=e.keyCode;var teclaShift=e.shiftKey;}
else{var obj=e.target;var tecla=e.which;var teclaShift=e.shiftKey;}
if((tecla==13)&&(teclaShift!=true)){eval("obj.objDestino."+obj.operacao);return false;}
return true;}
this.atalhoEnter=function(objOrigem,objDestino,operacao){objOrigem.objDestino=new Object();objOrigem.objDestino=objDestino;objOrigem.operacao=operacao;objOrigem.onkeydown=this.processaAtalhoEnter;}
this.tratarRecipienteDados=function(){if(arguments.length>0){var idRecipiente=arguments[0];}
else{var idRecipiente="recipienteDados";}
var retorno=new Array();var conteudo=this.pegarObj(idRecipiente).innerHTML;var linhas=conteudo.split("|");if(linhas.length>0){for(var i=0;i<linhas.length;i++){if(this.trim(linhas[i])!=""){var partes=linhas[i].split("#");retorno[retorno.length]=new Array();for(var j=0;j<partes.length;j++){retorno[retorno.length-1][retorno[retorno.length-1].length]=partes[j];}}}}
this.pegarObj(idRecipiente).innerHTML="";return retorno;}

this.benchMarking = function(segundosPHP, tempoInicial){

var tempoCalculado = "";
//-- calculo-tempo-javascript: final
var tempoFinal = new Date().getTime();
var tempoExecucao = (tempoFinal - tempoInicial);
var qtdeSegundos = Math.floor(tempoExecucao / 1000);

var segundos = (parseInt(segundosPHP,10) + parseInt(qtdeSegundos));
var hora = Math.floor(segundos / (60 * 60));
var minuto = Math.floor((segundos - (hora * 60 * 60)) / 60);
var segundo = Math.floor(segundos - (hora * 60 * 60) - (minuto * 60));

hora = (hora < 10 ? "0" + hora : hora);
minuto = (minuto < 10 ? "0" + minuto : minuto);
segundo = (segundo < 10 ? "0" + segundo : segundo);

tempoCalculado = hora+":"+minuto+":"+segundo;
return tempoCalculado;
}


this.limitaCaracter=function(obj,max){var str=obj.value;if(str.length>max){obj.value=this.trim(str.substring(0,max));}}
this.focarObj=function(idObj){var obj=this.pegarObj(idObj);obj.focus();}
this.download=function(link){location.href=link;}}
