
var sRotaAcessoPersonnalite = "http://www.personnaliteinvestnet.com.br/personnaliteinvestnet/";
var sRotaAcessoPrevidencia = "http://www.prevline.com.br/personnalitevidaeprevidencia/";
var sRotaAcessoItau = "http://www.itauinvestnet.com.br/itauinvestnet/";
var sRotaItauSeguro = "https://ww14.itau.com.br/itauinvestnet/seguro/";
var sRotaPersonnaliteSeguro = "https://ww14.itau.com.br/personnaliteinvestnet/seguro/";
var sPersonnalite = "personnaliteinvestnet/";
var sPersonnalitePrev = "personnalitevidaeprevidencia/";
var sItauPersonnalite = "itaupersonnalite/";

var sMontaFrame = "http://www.itaupersonnalite.com.br/montaFrame";
var sMaquina = "m18";

if (window.document.location.host=="ww33.itau")
{
    sRotaAcessoPersonnalite = "http://ww33.itau/personnaliteinvestnet_novo/";
    sRotaAcessoPrevidencia = "http://ww33.itau/personnalitevidaeprevidencia/";
	sRotaAcessoItau = "http://ww33.itau/itauinvestnet/";
	sRotaItauSeguro = "https://ww33.itau/itauinvestnet/seguro/";
	sRotaPersonnaliteSeguro = "https://ww33.itau/personnaliteinvestnet_novo/seguro/";
	sPersonnalite = "personnaliteinvestnet_novo/";
	sPersonnalitePrev = "personnalitevidaeprevidencia/";
	sItauPersonnalite = "itaupersonnalite_novo/";
	
	sMontaFrame = "http://sdwx018des.itau/itaupersonnalite/montaFrame";
	sMaquina = "m33";
}

function MM_openBrWindow(theURL,winName,features) //v2.0
{ 
	window.open(theURL,winName,features);
}

function monta_frame(url, submenu)
{
	MM_openBrWindow(sMontaFrame + "?url=" + url + "&submenu=" +submenu + "&maq=" + sMaquina, '_top');
}

function investimentos()
{
	monta_frame(sPersonnalite + "hp.aspx", 30);
}

function fundos()
{
	monta_frame(sPersonnalite + "fundos/hp.aspx", 31);
}

function atendimento_investidor()
{
	monta_frame(sPersonnalite + "fundos/assessoria/assessoria.aspx", 31);
}

function atendimento_prev() 
{
    MM_openBrWindow(sRotaAcessoPrevidencia + "individual/atendimento.htm", '_self');
}

function consultoria_inv() {
    MM_openBrWindow(sRotaPersonnaliteSeguro + "consultoria/agenda_consult_telefone.aspx", '_blank', 'location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=0,left=0,width=600,height=500');
}

function consultoria_online() {
    MM_openBrWindow(sRotaAcessoPersonnalite + "fundos/consultoria/pop_consultoria.htm", '_blank');
}

function orientacao_cliente() {
    MM_openBrWindow(sRotaAcessoPersonnalite + "fundos/consultoria/pop_orientacao_cliente.htm", '_blank');
}
function investfone() {
    MM_openBrWindow(sRotaAcessoPersonnalite + "fundos/consultoria/pop_investfone.htm", '_blank');
}

function panorama() {
    monta_frame(sPersonnalite + "fundos/painel/panorama/conjuntura.aspx?site=per", 31);
}

function home()
{
	MM_openBrWindow('http://www.itaupersonnalite.com.br', '_top');
}

function abreTelaPopUp(url)
{
    window.open('https://ww46.itau.com.br/itaupersonnalite/alerta/pop_saida.jsp?lk=' + url, 'saida', 'toolbar=no,location=no,Directory=no,Status=no,menubar=no,scrollbar=no,resizable=no,width=550, height=350,top=0,left=0');
	/*pop.lk.value = url;
	pop.target = "saida";
	pop.action = "https://ww46.itau.com.br/itaupersonnalite/alerta/pop_saida.jsp";
	window.open('', 'saida', 'width=550, height=350');
	pop.submit();*/
}

function seguranca() 
{
	MM_openBrWindow("http://www.itau.com.br/seguranca/politica_privacidade.htm");
}

function newsnet() 
{
	MM_openBrWindow('http://www.itaupersonnalite.com.br/news/index_p_news.htm', '_self');
}

function descubra_perfil()
{
	MM_openBrWindow(sRotaItauSeguro + 'perfil/conteudo.aspx?op=2&site=3', 'conteudo');
}

function tipos_perfil()
{
	MM_openBrWindow(sRotaItauSeguro + 'perfil/tipos_perfil.aspx?site=3', 'conteudo');
}

function tire_duvidas(codAssunto)
{
    //MM_openBrWindow(sMontaFrame + '?url=' + sItauPersonnalite + 'faleconosco/perguntas_faq.aspx?codAssunto=' + codAssunto + '&submenu=101&maq=m19', '_top');
    //MM_openBrWindow(sMontaFrame + '?url=' + sItauPersonnalite + 'faleconosco/perguntas_faq.aspx?codAssunto=' + codAssunto + '&submenu=100&maq=m19', '_top');

    MM_openBrWindow(sMontaFrame + '?url=' + 'atendimento2/personnalite/faleconosco.aspx' + '&submenu=101&maq=m16', '_top');
	
	if (window.document.location.host=="ww33.itau")
    {
        //MM_openBrWindow(sMontaFrame + '?url=' + sItauPersonnalite + 'faleconosco/perguntas_faq.aspx?codAssunto=' + codAssunto + '&submenu=101&maq=m33', '_top');
        //MM_openBrWindow(sMontaFrame + '?url=' + sItauPersonnalite + 'faleconosco/perguntas_faq.aspx?codAssunto=' + codAssunto + '&submenu=100&maq=m33', '_top');
        MM_openBrWindow(sMontaFrame + '?url=' + 'atendimento2/personnalite/faleconosco.aspx' + '&submenu=101&maq=m16', '_top');
    }
}

function fale_conosco()
{
	MM_openBrWindow(sMontaFrame + '?url=' + sItauPersonnalite + 'faleconosco/faleconosco.aspx&submenu=100&maq=m19', '_top');
}

function montaIframeNoticias(sessao)
{
	if(sessao == null) sessao = 1;
    if (window.document.location.host=="ww33.itau")
    {
        document.write("<iframe name='noticias' src='http://ww33.itau/noticias_cotacoes/painel/portal_per.asp?sessao=" + sessao + "' frameBorder='0' width='240' height='210' scrolling='no'></iframe>")
    }
    else
    {
        document.write("<iframe name='noticias' src='http://ww18.itau.com.br/noticias_cotacoes/painel/portal_per.asp?sessao=" + sessao + "' frameBorder='0' width='240' height='210' scrolling='no'></iframe>")
    }
}

function montaIframeConversor()
{
    if (window.document.location.host=="ww33.itau")
    {
        document.write("<iframe name='noticias' src='http://ww33.itau/itauinvestnet/conversor_pesquisa.aspx?site=3' frameBorder='0' width='240' height='155' scrolling='no'></iframe>")
    }
    else
    {
        document.write("<iframe name='noticias' src='http://www.itauinvestnet.com.br/itauinvestnet/conversor_pesquisa.aspx?site=3' frameBorder='0' width='240' height='155' scrolling='no'></iframe>")
    }
}

function montaIframeAgencias()
{
    if (window.document.location.host=="ww33.itau")
    {
        document.write("<iframe name='agencias' src='http://sdwx017des.itau/personnalite/redeatendimento/localiza.html' frameBorder='0' width='225' scrolling='no'  height='65'></iframe>")
    }
    else
    {
        document.write("<iframe name='agencias' src='https://ww46.itau.com.br/itaupersonnalite/redeatendimento/localiza.html' frameBorder='0' width='225'   scrolling='no'  height='65'></iframe>")
    }
}

function abreConteudoCombo(valor)
{
	var op;
	
	if(valor != "")
	{	
		op = parseInt(valor);
		
		switch(op)
		{
			//Panorama do Mercado
			case 11 :	//monta_frame(sPersonnalite + 'fundos/painel/panorama/conjuntura.aspx?site=per', 31);
						window.open('http://www.itaupersonnalite.com.br/montaFrame?url=personnaliteinvestnet/fundos/painel/panorama/conjuntura.aspx?site=per&submenu=31&maq=m18','_top');
						break;
			//Opinião do Gestor
			case 12 :	monta_frame(sPersonnalite + 'fundos/painel/opiniao/conteudo.aspx?op=12', 31);
						break;
			//Itautrade Opina
			case 13 :	MM_openBrWindow('acoes/go_trade.aspx?op=15', '_blank');
						break;
			//Economia Nacional
			case 14 :	MM_openBrWindow(sRotaAcessoItau + 'fundos/boletins/Bol_AtividadeEconomica.pdf', '_blank');
						break;
			//Economia Internacional
			case 15 :	MM_openBrWindow(sRotaAcessoItau + 'fundos/boletins/Bol_Internacional.pdf', '_blank');
						break;

			//Fundos - Simule uma aplicação
			case 21 :	monta_frame(sPersonnalite + 'fundos/simule_aplicacao/simule_aplicacao.aspx?site=3', 31);
						break;
			//Fundos - Trace suas metas
			case 22 :	monta_frame(sPersonnalite + 'fundos/trace_metas/tracemetas01.aspx', 31);
						break;
			//Fundos - Simule alíquotas de IR
			case 23 :	monta_frame(sPersonnalite + 'fundos/simule_ir/simule_ir.aspx?site=3', 31);
						break;
			//CDB - Simule aplicações
			case 24 :	monta_frame(sPersonnalite + 'simulador_cddi_cdb/simulador_cddi_cdb.aspx?seg=3%26site=CDB', 32);
						break;
			//CD DI - Simule aplicações
			case 25 :	monta_frame(sPersonnalite + 'simulador_cddi_cdb/simulador_cddi_cdb.aspx?seg=3%26site=CD', 32);
						break;
			//Poupança - Simule aplicações
			case 26 :	monta_frame(sPersonnalite + 'poupanca/simule/simulador_poup.aspx?site=poup', 35);
						break;

			//Fundos - Tabela de Rentabilidades
			case 31 :	MM_openBrWindow(sRotaAcessoPersonnalite + 'fundos/tabela_rentabilidade/fr_tabela.aspx', '_blank', 'location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=0,left=0,width=800,height=500');
						break;
			//Fundos - Rentabilidades e Cotas
			case 32 :	monta_frame(sPersonnalite + 'fundos/rentabilidades_cotas/rentabilidades_cotas.aspx?site=3', 31);
						break;
			//Poupança - Consulte as rentabilidades
			case 33 :	monta_frame(sPersonnalite + 'poupanca/simule/consulte_poup.aspx', 35);
						break;			
		}
	}
}
	
function buscaPalavra(palavra)
{
	if (palavra != "")
	{
		palavra = encodeURI(palavra);
		window.open(sRotaAcessoPersonnalite  + "glossario/busca_palavra.aspx?palavra=" + palavra, "", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=400");
	}
	else
	{
		alert("Digite uma palavra")
	}
}

function verifica_impressao()
{
	var path = new String;
	
	path = window.top.location.href;
	
	if(path.indexOf('pop') == -1)
	{
		document.getElementById('impressao').style.display = 'none';
		window.print();
	}
}

function foco(strcodigofundo)
{
	if (window.top.frames.opener)
	{
		if (window.top.opener.top.frames.length==0)
		{
			//window.open(sRotaAcessoPersonnalite +  "fundos/conheca_fundos/fundos_bankline.aspx?op=1&cfdo=" + strcodigofundo, "_blank", "");
			MM_openBrWindow(sMontaFrame + "?url=" + sPersonnalite +  "fundos/conheca_fundos/fundos.aspx?op=1%26cfdo=" + strcodigofundo + "&submenu=31&maq=" + sMaquina, '_blank');
		}
		else
		{
			MM_openBrWindow(sRotaAcessoPersonnalite +  "fundos/conheca_fundos/fundos.aspx?op=1&cfdo=" + strcodigofundo, "conteudo");
			parent.blur();
		}
	}
	else
	{
		MM_openBrWindow(sMontaFrame + "?url=" + sPersonnalite +  "fundos/conheca_fundos/fundos.aspx?op=1%26cfdo=" + strcodigofundo + "&submenu=31&maq=" + sMaquina, '_blank');
	}
}

function catalogo_fundos(valor) {
    window.open(sRotaAcessoPersonnalite + '/oferta.aspx?dest_valor_inicial=' + valor, '_self');
}



