// JavaScript Document
//Define o Array de URLs válidas
var URL = parent.self.location.href;
var c = new Array();
c[0]="www.bradescocustodia.com.br";
c[1]="bdn01";
c[2]="bradescocustodia.com.br";
c[3]="custodiabradesco.com.br";
 
var localizado = 0;
for (f = 0; f <= 3; f++) { 
	if (URL.indexOf(c[f]) > 1) {
	 localizado = 1;
	}
}

if (localizado == 0) {
 top.self.location.href = 'http://www.bradescocustodia.com.br';
} 

/* Retorna data e a hora do sistema */
function ObjDataHora()
{
	var agora = new Date();
	this.dia = agora.getDate();
	this.mes = agora.getMonth();
	this.ano = agora.getFullYear();
	this.hor = agora.getHours();
	this.min = agora.getMinutes();
	this.sem = agora.getDay();
	this.pad = function(s, n) {
		s = '0000' + s;
		return (s.substring(s.length - n, s.length));
	
	}
	this.NomeSem = function() {
		var aDia = new Array( 'Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'S&aacute;bado' );
		return aDia[this.sem];
	}
	this.NomeMes = function() {
		var aMes = new Array( 'Janeiro', 'Fevereiro', 'Mar&ccedil;o', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro' );
		return aMes[this.mes];
	}
	this.MostraData = function() {
		document.write(this.NomeSem() + ', ' + this.dia + ' de ' + this.NomeMes() + ' de ' + this.pad(this.ano, 4));
	}
	this.MostraHorario = function() {
		document.write(this.pad(this.hor, 2) + ':' + this.pad(this.min, 2));
	}
	return this;
}
var oDataHora = new ObjDataHora;


/* Função de axibição do Menu */

function exibe(id){
	var doc = document.getElementById(id);
	var op = document.getElementById("opM_"+id);
	op.style.fontWeight = "bold";
	op.style.color = "#F00000";
	doc.style.display = "block";
}

function esconde(id){
	var doc = document.getElementById(id);
	var op = document.getElementById("opM_"+id);
	op.style.fontWeight = "normal";
	op.style.color = "#000000";
	doc.style.display = "none";
}

function hideselect(){
    var selec = document.getElementsByTagName('SELECT');
    for(var no=0;no<selec.length;no++){
    	selec[no].style.visibility = "hidden";
    }
}

function showselect(){
    var selec = document.getElementsByTagName('SELECT');
    for(var no=0;no<selec.length;no++){
    	selec[no].style.visibility = "";
    }
}

/* Diminui e aumenta o texto */

//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr','p','a','li','strong');

//Specify spectrum of different font sizes:
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var startSz = 1;

function ts( trgt,inc ) {
if (!document.getElementById) return
var d = document,cEl = null,sz = startSz,i,j,cTags;

sz += inc;
if ( sz < 0 ) sz = 0;
if ( sz > 3 ) sz = 3;
startSz = sz;

if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

cEl.style.fontSize = szs[ sz ];

for ( i = 0; i < tgs.length; i++ ) {
cTags = cEl.getElementsByTagName( tgs[ i ] );
for ( j = 0; j < cTags.length; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
}
}

/* Troca imagens */

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/* Função da layer de cima entre os topos (usado em menus) */

function defVisib(id,op){
	document.getElementById(id).style.display=op;
}

function ExibeOcultaComoUsar(op){
	if(op=="none"){
		timeC=setTimeout("defVisib('boxComoUsar','"+op+"')",200);
	}
	else{
		if(typeof(timeC)!='undefined'){
			clearTimeout(timeC);
		}
		defVisib('boxComoUsar',op);
	}
}

function ExibeOcultaAcessar(op){
	if(op=="none"){
		timeD=setTimeout("defVisib('boxAcessar','"+op+"')",200);
	}
	else{
		if(typeof(timeD)!='undefined'){
			clearTimeout(timeD);
		}
		defVisib('boxAcessar',op);
	}
}

function toggleDiv(element){
      if(document.getElementById(element).style.display = 'none')
      {
        document.getElementById(element).style.display = 'block';
      }
      else if(document.getElementById(element).style.display = 'block')
      {
        document.getElementById(element).style.display = 'none';
      }
}
function acesso()
{
	window.open('/Web_Pages/Popup/Default.aspx','acessar','toolbar=no,status=yes,resizable=yes,location=no,scrollbars=auto, width=537, height=495');
}
