﻿function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 
function returnText(thefield){
if (thefield.value == "")
thefield.value = "Usuário"
} 
function returnTextb(thefield){
if (thefield.value == "")
thefield.value = "Buscar.."
} 

function expandavatar(thefield){
var moz = !(document.all);
cam = document.getElementById('avatadark'); 
cam2 = document.getElementById('avatalight');
cam3 = document.getElementById('avataunderground');
if (thefield.value == 'selecione'){
cam.style.display = 'none'; 
cam2.style.display = 'none';
cam3.style.display = 'none'; 
} 
if (thefield.value == 'Dark'){
if(moz){
cam.style.display = 'table-row'; 
}else{
cam.style.display = 'block'; 
}
cam2.style.display = 'none'; 
cam3.style.display = 'none';
} 
if (thefield.value == 'Light'){
if(moz){
cam2.style.display = 'table-row'; 
}else{
cam2.style.display = 'block'; 
}
cam.style.display = 'none';
cam3.style.display = 'none';
}
if (thefield.value == 'Underground'){
if(moz){
cam3.style.display = 'table-row'; 
}else{
cam3.style.display = 'block'; 
}
cam.style.display = 'none';
cam2.style.display = 'none';
}
}

function expanddoar(thefield){
var moz = !(document.all);
cam = document.getElementById('itaudoa'); 
cam2 = document.getElementById('pagsegdoa'); 
cam3 = document.getElementById('dircaixa'); 
cam4 = document.getElementById('depenvelope'); 
cam5 = document.getElementById('transfcontas'); 
if (thefield.value == '[ Selecione o tipo ]'){
cam.style.display = 'none'; 
cam2.style.display = 'none'; 
cam3.style.display = 'none'; 
cam4.style.display = 'none'; 
cam5.style.display = 'none'; 
} 
if (thefield.value == 'Itaú'){
if(moz){
cam.style.display = 'table-row'; 
}else{
cam.style.display = 'block'; 
}
cam2.style.display = 'none'; 
cam3.style.display = 'none'; 
cam4.style.display = 'none'; 
cam5.style.display = 'none'; 
} 
if (thefield.value == 'PagSeguro'){
cam.style.display = 'none'; 
if(moz){
cam2.style.display = 'table-row'; 
}else{
cam2.style.display = 'block'; 
}
cam3.style.display = 'none'; 
cam4.style.display = 'none'; 
cam5.style.display = 'none'; 
}
}

function expanddoaitau(thefield){
var moz = !(document.all);
cam = document.getElementById('dircaixa'); 
cam2 = document.getElementById('depenvelope'); 
cam3 = document.getElementById('transfcontas'); 
if (thefield.value == '[ Selecione o método ]'){
cam.style.display = 'none'; 
cam2.style.display = 'none'; 
cam3.style.display = 'none'; 
} 
if (thefield.value == 'Depósito direto no caixa'){
if(moz){
cam.style.display = 'table-row'; 
}else{
cam.style.display = 'block'; 
}
cam2.style.display = 'none'; 
cam3.style.display = 'none'; 
} 
if (thefield.value == 'Depósito por envelope'){
cam.style.display = 'none'; 
if(moz){
cam2.style.display = 'table-row'; 
}else{
cam2.style.display = 'block'; 
}
cam3.style.display = 'none'; 
}
if (thefield.value == 'Transferência entre contas'){
cam.style.display = 'none'; 
cam2.style.display = 'none'; 
if(moz){
cam3.style.display = 'table-row'; 
}else{
cam3.style.display = 'block'; 
}
}
}

function mostrarankd(thefield){
ranktotal = document.getElementById('rankingsnome'); 
ranktd = document.getElementById('tiposrankdark'); 
ranktl = document.getElementById('tiposranklight'); 
bdd = document.getElementById('rankdarkdbaixo'); 
bld = document.getElementById('ranklightdbaixo'); 
rankd = document.getElementById('toppvpdark'); 
rankl = document.getElementById('toppvplight'); 
rankgd = document.getElementById('topgvgdark'); 
rankgl = document.getElementById('topgvglight'); 
ranktu = document.getElementById('tiposrankunderground'); 
ranku = document.getElementById('toppvpunderground'); 
blu = document.getElementById('rankundergrounddbaixo'); 
ranktopu = document.getElementById('toppvpunderground'); 
ranktogu = document.getElementById('topgvgunderground');
if (ranktd.style.display = 'none'){
ranktd.style.display = 'block'; 
rankd.style.display = 'block'; 
bdd.style.display = 'block'; 
ranktotal.style.background = 'url(images/bnttopd.png) no-repeat'; 
}
ranktl.style.display = 'none'; 
bld.style.display = 'none'; 
rankl.style.display = 'none'; 
rankgd.style.display = 'none'; 
rankgl.style.display = 'none'; 
ranktu.style.display = 'none'; 
ranku.style.display = 'none'; 
blu.style.display = 'none'; 
ranktopu.style.display = 'none'; 
ranktogu.style.display = 'none'; 
}

function mostrarankl(thefield){
ranktotal = document.getElementById('rankingsnome'); 
ranktd = document.getElementById('tiposrankdark'); 
ranktl = document.getElementById('tiposranklight'); 
bdd = document.getElementById('rankdarkdbaixo'); 
bld = document.getElementById('ranklightdbaixo'); 
rankd = document.getElementById('toppvpdark'); 
rankl = document.getElementById('toppvplight'); 
rankgd = document.getElementById('topgvgdark'); 
rankgl = document.getElementById('topgvglight');
ranktu = document.getElementById('tiposrankunderground'); 
ranku = document.getElementById('toppvpunderground'); 
blu = document.getElementById('rankundergrounddbaixo'); 
ranktopu = document.getElementById('toppvpunderground'); 
ranktogu = document.getElementById('topgvgunderground'); 
if (ranktl.style.display = 'none'){
ranktl.style.display = 'block'; 
rankl.style.display = 'block'; 
bld.style.display = 'block'; 
ranktotal.style.background = 'url(images/bnttolg.png) no-repeat'; 
}
ranktd.style.display = 'none'; 
bdd.style.display = 'none'; 
rankd.style.display = 'none'; 
rankgd.style.display = 'none'; 
rankgl.style.display = 'none'; 
ranktu.style.display = 'none'; 
ranku.style.display = 'none'; 
blu.style.display = 'none'; 
ranktopu.style.display = 'none'; 
ranktogu.style.display = 'none'; 
}

function mostraranku(thefield){
ranktotal = document.getElementById('rankingsnome'); 
ranktd = document.getElementById('tiposrankdark'); 
ranktl = document.getElementById('tiposranklight'); 
bdd = document.getElementById('rankdarkdbaixo'); 
bld = document.getElementById('ranklightdbaixo'); 
rankd = document.getElementById('toppvpdark'); 
rankl = document.getElementById('toppvplight'); 
rankgd = document.getElementById('topgvgdark'); 
rankgl = document.getElementById('topgvglight'); 

ranktu = document.getElementById('tiposrankunderground'); 
ranku = document.getElementById('toppvpunderground'); 
blu = document.getElementById('rankundergrounddbaixo'); 
ranktopu = document.getElementById('toppvpunderground'); 
ranktogu = document.getElementById('topgvgunderground'); 

if (ranktu.style.display = 'none'){
ranktu.style.display = 'block'; 
ranku.style.display = 'block'; 
blu.style.display = 'block'; 
ranktopu.style.display = 'block'; 
ranktotal.style.background = 'url(images/bnttoug.png) no-repeat'; 
}
ranktd.style.display = 'none'; 
bdd.style.display = 'none'; 
rankd.style.display = 'none'; 
rankgd.style.display = 'none'; 
rankgl.style.display = 'none'; 
ranktl.style.display = 'none'; 
rankl.style.display = 'none'; 
bld.style.display = 'none'; 
ranktogu.style.display = 'none'; 
}

function mostraranklp(thefield){
rankd = document.getElementById('toppvpdark'); 
rankl = document.getElementById('toppvplight'); 
rankgd = document.getElementById('topgvgdark'); 
rankgl = document.getElementById('topgvglight'); 
ranku = document.getElementById('toppvpunderground'); 
rankgu = document.getElementById('topgvgunderground'); 
if (rankl.style.display = 'none'){
rankl.style.display = 'block'; 
}
rankd.style.display = 'none'; 
rankgd.style.display = 'none'; 
rankgl.style.display = 'none'; 
ranku.style.display = 'none';
rankgu.style.display = 'none';
}

function mostrarankdp(thefield){
rankd = document.getElementById('toppvpdark'); 
rankl = document.getElementById('toppvplight'); 
rankgd = document.getElementById('topgvgdark'); 
rankgl = document.getElementById('topgvglight'); 
ranku = document.getElementById('toppvpunderground'); 
rankgu = document.getElementById('topgvgunderground'); 
if (rankd.style.display = 'none'){
rankd.style.display = 'block'; 
}
rankl.style.display = 'none'; 
rankgd.style.display = 'none'; 
rankgl.style.display = 'none'; 
ranku.style.display = 'none';
rankgu.style.display = 'none';
}

function mostraranklg(thefield){
rankd = document.getElementById('toppvpdark'); 
rankl = document.getElementById('toppvplight'); 
rankgd = document.getElementById('topgvgdark'); 
rankgl = document.getElementById('topgvglight'); 
ranku = document.getElementById('toppvpunderground'); 
rankgu = document.getElementById('topgvgunderground'); 
if (rankgl.style.display = 'none'){
rankgl.style.display = 'block'; 
}
rankd.style.display = 'none'; 
rankl.style.display = 'none'; 
rankgd.style.display = 'none'; 
ranku.style.display = 'none';
rankgu.style.display = 'none';
}

function mostrarankdg(thefield){
rankd = document.getElementById('toppvpdark'); 
rankl = document.getElementById('toppvplight'); 
rankgd = document.getElementById('topgvgdark'); 
rankgl = document.getElementById('topgvglight'); 
ranku = document.getElementById('toppvpunderground'); 
rankgu = document.getElementById('topgvgunderground'); 
if (rankgd.style.display = 'none'){
rankgd.style.display = 'block'; 
}
rankl.style.display = 'none'; 
rankd.style.display = 'none'; 
rankgl.style.display = 'none'; 
ranku.style.display = 'none';
rankgu.style.display = 'none';
}

function mostrarankup(thefield){
rankd = document.getElementById('toppvpdark'); 
rankl = document.getElementById('toppvplight'); 
rankgd = document.getElementById('topgvgdark'); 
rankgl = document.getElementById('topgvglight'); 
ranku = document.getElementById('toppvpunderground'); 
rankgu = document.getElementById('topgvgunderground'); 
if (ranku.style.display = 'none'){
ranku.style.display = 'block'; 
}
rankl.style.display = 'none'; 
rankd.style.display = 'none'; 
rankgl.style.display = 'none'; 
rankgu.style.display = 'none';
rankgd.style.display = 'none';
}


function mostrarankug(thefield){
rankd = document.getElementById('toppvpdark'); 
rankl = document.getElementById('toppvplight'); 
rankgd = document.getElementById('topgvgdark'); 
rankgl = document.getElementById('topgvglight'); 
ranku = document.getElementById('toppvpunderground'); 
rankgu = document.getElementById('topgvgunderground'); 
if (rankgu.style.display = 'none'){
rankgu.style.display = 'block'; 
}
rankl.style.display = 'none'; 
rankd.style.display = 'none'; 
rankgl.style.display = 'none'; 
ranku.style.display = 'none';
rankgd.style.display = 'none';
}

function mostracadast(objeto){
sam = document.getElementById(objeto); 
weather = sam.style.display; 

if (weather == "block")
   {
   sam.style.display = 'none'; 
   }
else
   {
   sam.style.display = 'block'; 
   }

}

function txtBoxFormat(objeto, sMask, evtKeyPress) {
var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;
if(document.all) { // Internet Explorer
nTecla = evtKeyPress.keyCode; }
else if(document.layers) { // Nestcape
nTecla = evtKeyPress.which;
}
sValue = objeto.value;
// Limpa todos os caracteres de formatação que
// já estiverem no campo.
sValue = sValue.toString().replace( "-", "" );
sValue = sValue.toString().replace( "-", "" );
sValue = sValue.toString().replace( ".", "" );
sValue = sValue.toString().replace( ".", "" );
sValue = sValue.toString().replace( "/", "" );
sValue = sValue.toString().replace( "/", "" );
sValue = sValue.toString().replace( ":", "" );
sValue = sValue.toString().replace( ":", "" );
sValue = sValue.toString().replace( "(", "" );
sValue = sValue.toString().replace( "(", "" );
sValue = sValue.toString().replace( ")", "" );
sValue = sValue.toString().replace( ")", "" );
sValue = sValue.toString().replace( " ", "" );
sValue = sValue.toString().replace( " ", "" );
fldLen = sValue.length;
mskLen = sMask.length;
i = 0;
nCount = 0;
sCod = "";
mskLen = fldLen;
while (i <= mskLen) {
bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/") || (sMask.charAt(i) == ":"))
bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " "))
if (bolMask) {
sCod += sMask.charAt(i);
mskLen++; }
else {
sCod += sValue.charAt(nCount);
nCount++;
}
i++;
}
objeto.value = sCod;
if (nTecla != 8) { // backspace
if (sMask.charAt(i-1) == "9") { // apenas números...
return ((nTecla > 47) && (nTecla < 58)); } // números de 0 a 9
else { // qualquer caracter...
return true;
} }
else {
return true;
}
}
