// alert english privacidade e ressalvas

var getParent = '';
var intGoAgain = 0;
function tryGetObject(){
	if(intGoAgain != 1){
		if(typeof(top.frames[0].frames[0]) == 'object' || typeof(top.frames[0]) == 'object'){
			if(top.frames[0].frames[0]){
				try{
					if(location.href.indexOf("pequenas")!=-1 || location.href.indexOf("medias")!=-1 || location.href.indexOf("grandes")!=-1  || location.href.indexOf("empresas")!=-1){
						top.frames[0].frames[0].document.forms['login'].elements['PROD_I'].selectedIndex = 1;
						top.frames[0].frames[0].fun_verify_status(top.frames[0].frames[0].document.forms['login'].elements['PROD_I']);
					}

					var str_location = self.location.href;
					var int_pos = 0;
					if(str_location.indexOf('pessoas') !== -1){int_pos = 1;}
					if(str_location.indexOf('cartoes') !== -1){int_pos = 1;}
					if(str_location.indexOf('vangogh') !== -1){int_pos = 2;}
					if(str_location.indexOf('pessoas/van_gogh') !== -1){int_pos = 2;}
					if(str_location.indexOf('pessoas/private_banking') !== -1){int_pos = 4;}
					if(str_location.indexOf('pequenas') !== -1 || str_location.indexOf('medias') !== -1 || str_location.indexOf('grandes') !== -1 || str_location.indexOf('empresas') !== -1){int_pos = 5;}
					if(str_location.indexOf('veja_um_clique') !== -1){int_pos = 6;}

					if(int_pos != 0){
						top.frames['portal']['top_level_nav'].document.forms['form_OutrasSecoes'].elements['slc_Secoes'].selectedIndex = int_pos;
					}else{
						top.frames['portal']['top_level_nav'].document.forms['form_OutrasSecoes'].elements['slc_Secoes'].selectedIndex = 0;
					}

					intGoAgain = 1;
					window.clearInterval(getParent);
				}catch(objErr){
					intGoAgain = 0;
				}
			}
		}
	}
}

function setInt(){
	getParent = window.setInterval('tryGetObject()',500);
}

if(top.frames.length>1){setInt();}

function alert_disclaimer(url){
	b_Resultado=confirm("This page will be available only in portuguese version.")
	if(b_Resultado == true){
			parent.location.href = url;
		}
}

// Monta a pagina dentro do frame
if(typeof bSiteEnglish != "undefined" && bSiteEnglish==1){
	if(!top.frames.length && typeof bCampanha == "undefined")
		{location='/index_internas.htm?sUrl='+document.location.href;}
	}
else{
	if(!top.frames.length && typeof bCampanha == "undefined")
		{location='/index_internas.htm?sUrl='+document.location.href;}
}
//*********************** Carrega Aplicações     *******************************//
function fc_carregaPagina(url_ie,url_ns,id_link, target){
  b_Resultado=confirm("This page will be available only in portuguese version.")
    if(b_Resultado == true){
		if(navigator.appName.indexOf("Netscape")>=0){
		    	novaJanela=window.open(url_ns+"?id_link="+id_link,'','scrollbars=yes,resizable=yes,toolbar=no,status=nos,width=600,height=500')
				novaJanela.focus();
		}
		else{
			if(target==null){
				document.location.href=url_ie+"?id_link="+id_link;
			}
			else{
				parent.parent.portal.document.location.href=url_ie+"?id_link="+id_link;
			}

		}
	}
}
//****************************Alert Popup PDF'S**************************************//
function alert_popup(target){
	parameters = "scrollbars=yes,resizable=yes,width=750,height=500"
	b_Resultado=confirm("This page will be available only in portuguese version.")
	if(b_Resultado == true){
    	if(target == "diario"){
    	        window.open('/download/informes_economicos/diario.xls','','scrollbars=yes,resizable=yes,width=750,height=500');
        }
    	if(target == "mensal"){
    	        window.open('/download/informes_economicos/semanal.pdf','','scrollbars=yes,resizable=yes,width=750,height=500');
        }
    	if(target == "acrobat"){
    	        window.open('http://www.adobe.com.br/products/acrobat/readstep.html','','toolbar=yes,location=yes,scrollbars=yes,resizable=yes,width=700,height=500');
        }
    	if(target == "document"){
    	        window.open('/download/cadastro_n_correntista/DoctosCadastramento.doc','','scrollbars=yes,resizable=yes,width=750,height=500');
        }
    	if(target == "demo_persona"){
    	       window.open('http://www.bancoreal.com.br/demonstracoes/Rib/','','resizable=yes,width=660,height=455');
        }
     }
}
//******************** Alerta que esta página só existe na versão em português********//
function alert_port(url,target){
	b_Resultado=confirm("This page will be available only in portuguese version.")
	if(b_Resultado == true)
	{
		if(target == "top" || target =="_top"){top.location.href = url;}
		if(target == "new" || target == "" || target == "_blank"){window.open(url);}
		if(target == "portal"){parent.location.href = url;}
	}
	else{ }
}

//************************* Alerta que do pop up Wap English

function alert_port_wap(){
	b_Resultado=confirm("This page will be available only in portuguese version.")
	if(b_Resultado == true){window.open('/pessoas/real_ate_voce/simulador_wap/wap.htm','','width=200,height=358');}
}

//************************* Alerta que do pop up Imagem Organograma

function image(){window.open('/quem_somos/images/organograma.htm','','toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=500,left=10,top=10');}
function organograma(){window.open('/download/demonstracao_financeira/estrutura_orga/estrut_organ.pdf','','scrollbars=yes,resizable=yes,width=750,height=500,left=10,top=10');}
function management(){window.open('/download/demonstracao_financeira/estrutura_orga/management.pdf','','scrollbars=yes,resizable=yes,width=750,height=500,left=10,top=10');}

   //************************* Zoom das Imagens do Clube de Super Vantagens

function Zoom(theURL,winName,features){window.open(theURL,winName,features);}

   //************************* Tratar Combo do Clube de Super Vantagens

function tratarcombo(form)
{
	var NumEscolha=form.item.selectedIndex
	var analiza=(form.item.options[NumEscolha].value);

	if (analiza == ""){;}
	else{
		switch(analiza)
		{
			case"bonus_1":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_001.shtm";return;
			case"bonus_2":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_002.shtm";return;
			case"bonus_3":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_003.shtm";return;
			case"bonus_4":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_004.shtm";return;
			case"bonus_5":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_005.shtm";return;
			case"bonus_6":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_006.shtm";return;
			case"bonus_7":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_007.shtm";return;
			case"bonus_8":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_008.shtm";return;
			case"bonus_9":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_009.shtm";return;
			case"bonus_10":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_010.shtm";return;
			case"bonus_11":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_011.shtm";return;
			case"bonus_12":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_012.shtm";return;
			case"bonus_13":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_premios_013.shtm";return;
			case"ebonus_1":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_novos_premios.shtm";return;
			case"ebonus_2":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_novos_premios_002.shtm";return;
			case"ebonus_3":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_novos_premios_003.shtm";return;
			case"ebonus_4":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_novos_premios_004.shtm";return;
			case"ebonus_5":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_novos_premios_005.shtm";return;
			case"mbonus_1":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_diadasmaes01.shtm";return;
			case"mbonus_2":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_diadasmaes02.shtm";return;
			case"mbonus_3":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_diadasmaes03.shtm";return;
			case"mbonus_4":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_diadasmaes04.shtm";return;
			case"mcm_bonus_1":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_mais_com_menos_01.shtm";return;
			case"mcm_bonus_2":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_mais_com_menos_02.shtm";return;
			case"mcm_bonus_3":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_mais_com_menos_03.shtm";return;
			case"mcm_bonus_4":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_mais_com_menos_04.shtm";return;
			case"on_bonus_1":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_001.shtm";return;
			case"on_bonus_2":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_002.shtm";return;
			case"on_bonus_3":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_003.shtm";return;
			case"on_bonus_4":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_004.shtm";return;
			case"on_bonus_5":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_005.shtm";return;
			case"on_bonus_6":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_006.shtm";return;
			case"on_bonus_7":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_007.shtm";return;
			case"on_bonus_8":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_008.shtm";return;
			case"on_bonus_9":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_009.shtm";return;
			case"on_bonus_10":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_010.shtm";return;
			case"on_bonus_11":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_011.shtm";return;
			case"on_bonus_12":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_012.shtm";return;
			case"on_bonus_13":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_013.shtm";return;
			case"on_bonus_14":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_014.shtm";return;
			case"on_bonus_15":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_015.shtm";return;
			case"on_bonus_16":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_016.shtm";return;
			case"on_bonus_17":window.location.href="/cartoes/clube_super_vantagens/catalogo/tpl_catalogo_online_017.shtm";return;
			case"categ_bonus_1":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_acessorios.shtm";return;
			case"categ_bonus_2":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_artigos_esportivos.shtm";return;
			case"categ_bonus_3":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_casa_decoracao.shtm";return;
			case"categ_bonus_4":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_beleza_saude.shtm";return;
			case"categ_bonus_5":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_cd_dvd.shtm";return;
			case"categ_bonus_6":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_chocolates.shtm";return;
			case"categ_bonus_7":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_eletrodomesticos.shtm";return;
			case"categ_bonus_8":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_eletroeletronicos.shtm";return;
			case"categ_bonus_9":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_flores.shtm";return;
			case"categ_bonus_10":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_informacao_cultura.shtm";return;
			case"categ_bonus_11":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_relogios.shtm";return;
			case"categ_bonus_12":window.location.href="/cartoes/clube_super_vantagens/catalogo/categorias/tpl_catalogo_utensilios_domesticos.shtm";return;
		}
	}
}

function seja_cliente_carregaPagina(url_geral){
  b_Resultado=confirm("This page will be available only in portuguese version.")
    if(b_Resultado == true){
    	novaJanela=window.open(url_geral,'','scrollbars=yes,resizable=yes,toolbar=no,status=no,width=790,height=436');
		novaJanela.focus();
    }
}

//************************************************* Abra sua conta ******************************************
function OpenYourAccount(){
	seja_cliente_carregaPagina('/campanha/seja_cliente/hotsite/frm_index.htm');
}

//****************************LINK TESTE DA SYMANTEC**************************************//

function Jump()
{
var sscWindow= window.open('http://security.symantec.com/sscv6/home.asp?productid=partner&langid=br&venid=partner&close_parent=false', 'symantec', 'scrollbars=yes,width=772,height=536');
        if (window.focus)
        {
                sscWindow.focus()
        }
        void(0);
}

//**************************Funcao para Van Gogh da Lista Inteligente*****************************//
function openDesc(id,total){

for(var i = 1; i <= total; i++){

	if (id != i){
		document.getElementById("descOp"+i).style.display="block";
		document.getElementById("desc"+i).style.display="none";
	}else{
		document.getElementById("descOp"+i).style.display="none";
		document.getElementById("desc"+i).style.display="block";
	}
}
}

function clDesc(id,total){

for(var i = 1; i <= total; i++){
	document.getElementById("descOp"+i).style.display="block";
	document.getElementById("desc"+i).style.display="none";
}

}

//**************************Funcao para Portal da Lista Inteligente*****************************//
function openDescPortal(id,total){

for(var i = 1; i <= total; i++){

	if (id != i){
		document.getElementById("descOp"+i).style.display="block";
		//document.getElementById("desc"+i).style.display="none";
	}else{
		//document.getElementById("descOp"+i).style.display="none";
		document.getElementById("desc"+i).style.display="block";
	}
}
}

function clDescPortal(id,total){

for(var i = 1; i <= total; i++){
	//document.getElementById("descOp"+i).style.display="block";
	document.getElementById("desc"+i).style.display="none";
}

}


//**************************Funcao para Portal da Lista Abre e Fecha*****************************//
function openLista(id,total){

for(var i=1;i<=total;i++){

	if (id== i){
		document.getElementById("desc"+i).style.display="block";
	}else{
		document.getElementById("desc"+i).style.display="none";
	}
}
}

function clLista(id,total){

for(var i=1;i<=total;i++){
	document.getElementById("desc"+i).style.display="none";
}

}


//**************************Oportunidade e carreira Pop Up de cadastro*****************************//

function fichaDeInscricao(){
	window.open("http://zeus.e-hunter.com.br/abn/candidatoexterno.asp", "abnexterno", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,menubar=no,width=780,height=530,left=2,top=2");
}


//**************************title sustentabilidade*****************************//

if(self.location.href.indexOf('/sustentabilidade/') != -1){
top.document.title = top.document.title + ' - Sustentabilidade';
}


//**************************Funcao para Perguntas e Respostas*****************************//

function fun_get_element(element_id){
	var obj_get_element = (document.all) ? document.all[element_id] :

	document.getElementById(element_id);
	return obj_get_element;
}

function fun_open_close(int_id){
	int_id = int_id || 0;
	var str_default_id = 'oc_desc_' + int_id;

	if(fun_get_element(str_default_id).style.display == 'block'){
		fun_get_element(str_default_id).style.display = 'none';
	}else{
		fun_get_element(str_default_id).style.display = 'block';
	}
}
//OBS: Utilizar a classe .oc_closed{display:none;} para as respostas começarem fechadas//