var AnioCopyright = 2005;

var countName = 0;

function masInfo(helppageURL){
    window.open(helppageURL, 'citibank', 'top=100,left=100,width=370,height=400,scrollbars=yes,resizable=no');
}

function ChangeLocation(frm, name){
    eval('top.location = frm.'+name+'.options[frm.'+name+'.selectedIndex].value');
}

//Para detectar clics repetitivos
var inProgress = false;

function ChangeLocationLockUrl(targetUrl) {
	if ( !inProgress ) {	//Check for repetitive clicks
		inProgress = true;	//Flag for repetitive clicks
		window.location.replace(targetUrl);
		setTimeout("clearLock()", clickLockTimeout);
		return true;
	} else {
		alert(wait);
		return false;
	}
}

function clearLock(){
	inProgress = false;
}

function ContentSpecial(frm){
    window.open(frm.file.options[frm.file.selectedIndex].value);
}

    link = "https://www.latam.citibank.com/esales/";

    function OpenWin(pais,prod, idio)
    {
        if (document.all)
        {
            var w = 800 - 10;
            var h = 600 - 57;
        }
        else if (document.layers)
        {
            var w = 800 - 10;
            var h = 600 - 57;
        }
        else
        {
            //asume netscape 6
            var w = 800 - 5;
            var h = 600 - 53;
        }

        winprops = "height=" + h + ",width=" + w + ",top=0,left=0,scrollbars=no,resizable=no,toolbar=no,status=yes,menubar=no";
        ///AGREGADO PARA PROBAR
        ///winprops ="";
        if (idio != null)
            win = window.open(link+"global/index.jsp?pais="+ pais +"&prod=" + prod + "&idioma=" + idio, "", winprops)
        else
            win = window.open(link+"global/index.jsp?pais="+ pais +"&prod=" + prod, "", winprops)
        }


//============//
//Para el menú de navegación

function check(menu){
        //FIX!!!! Fix this function once navigationMap issue has been resolved
        return(false);

        if(String(navigationMap.toLowerCase()).indexOf(menu) != -1){
        return(true);
        }

        return(false);

}

//==================================
//Funcion genérica para abrir ventanas

	function OpenPop(url,w,h,t,l,param,name)
	{
	//param - Valores para personalizar la ventana.
	var loc = url // URL a mostrar.
	pais = 'brasil'; // País origen.
	var ancho = w; // Ancho de la ventana.
	var alto = h; // Alto de la ventana.
	var NameW = name; //Nombre de la ventana.
	var arriba = t; //Define el lugar de posisión de la ventana en alto.
	var costado = l; //Define el lugar de posisión de la ventana en ancho.

	var left = Number(screen.width);
	var top = Number(screen.height);

	switch(t){

		case "top":top = 0;break;
		case "center":top = top/2 - (h/2);break;
		case "bottom":top = (top - h) - 90;break;
		default:if(!t){top = 0;}
			 	else{top = arriba;}
				break;
	}

	switch(l){

		case "left":left = 0;break;
		case "center":left = left/2 - (w/2);break;
		case "right":left = (left - w) - 30;break;
		default:if(!l){left = 0;}
		        else{left = costado;}
		        break;
	}

	if(!NameW){NameN = pais+"Pop";}
	if (!param){param = "scrollbars=auto,resizable=yes";}


	if(String(loc).indexOf("http://")==-1 && String(loc).indexOf("https://")==-1){
		if (String(location.href).indexOf('WORKAREA')!=-1 || String(location.href).indexOf('STAGING')!=-1){loc = '/'+loc;}
		else {loc = '/'+pais+'/'+loc;}
	}

	eval("window.open(loc,'"+NameW+"','width="+ancho+",height="+alto+",top="+top+",left="+left+","+param+"')");

	}

//==================================


//============//
//Para el menú de persona fisica, empresa, institucional
var menuobj = null;
var submenu=new Array()
submenu[0]='<font size="1" face="Verdana"><a style="text-decoration: none;" href="https://www.latam.citibank.com/brasil/labrgl/portugue/accounts/index.htm" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Conta Corrente e Servi&ccedil;os</a> | <a style="text-decoration: none;" href="https://www.latam.citibank.com/brasil/portlets/login/dadomain.jsp?ID=20761005" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Cart&otilde;es de Cr&eacute;dito</a> | <a style="text-decoration: none;" href="https://www.latam.citibank.com/brasil/portlets/login/dadomain.jsp?ID=20761004" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Investimentos</a> | <a style="text-decoration: none;" href="https://www.latam.citibank.com/brasil/portlets/login/dadomain.jsp?ID=20761003" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Seguros</a> | <a style="text-decoration: none;" href="https://www.latam.citibank.com/brasil/labrgl/portugue/accounts/internet/index.htm" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Servi&ccedil;os na Internet</a> | <a style="text-decoration: none;" href="https://www.latam.citibank.com/brasil/labr/portugue/faq/index.htm" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Perguntas Frequentes</a></font>';
submenu[1]='<font size="1" face="Verdana"><a style="text-decoration: none;" href="https://home.citidirect-br.citibank.com/corporate/brco/portugue/index.htm" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Corporate & Investment Banking</a> | <a style="text-decoration: none;" href="https://www.latam.citibank.com/brasil/homepage/portugue/cdcbol.htm" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Citibanking On Line Web</a> | <a style="text-decoration: none;" href="http://www.citidirect.com/" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">CitiDirect Online Banking</a> | <a style="text-decoration: none;" href="http://www.latam.citibank.com/corporate/citiconnect/port/" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Canal de Pagamentos Online</a></font>';
submenu[2]='<font size="1" face="Verdana"><a style="text-decoration: none;" href="https://home.citidirect-br.citibank.com/corporate/brco/portugue/pdfs/quemsomosp.pdf" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Citigroup no Brasil</a> | <a style="text-decoration: none;" href="JavaScript:OpenPop(\'https://home.citidirect-br.citibank.com/smartportal/producao/Layout_gen/SP_pageproducer.jsp?desc_sessions=Pinstitucional_DFinan\',\'783\',\'500\',\'0\',\'0\',\'resizable=yes\',\'NossoBalanco\');" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Nossos Balan&ccedil;os</a> | <a style="text-decoration: none;" href="https://www.latam.citibank.com/brasil/homepage/portugue/expo.htm" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Espa&ccedil;o Cultural</a> | <a style="text-decoration: none;" href="https://www.latam.citibank.com/brasil/labr/portugue/insidecb/general/index.htm" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Banco de Talentos</a> | <a style="text-decoration: none;" href="https://ssl43.terraempresas.com.br/aeq10/citibank/inicial.asp" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Mercados</a> | <a style="text-decoration: none;" href="http://www.citibank.com/privatebank/" ONMOUSEOVER="this.style.color=\'#01AEEE\';" ONMOUSEOUT="this.style.color=\'#003399\';" class="linkNavigation3">Private Bank</a></font>';

function contains_ns6(a, b) {
    while (b.parentNode)
        if ((b = b.parentNode) == a)
            return true;
    return false;
}

function resetit(e){
if (document.all && !menuobj.contains(e.toElement))
    delayhide = setTimeout("showit(-1)",delay_hide);
else if (document.getElementById && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))
    delayhide = setTimeout("showit(-1)",delay_hide);
}

function clear_delayhide(){
    if (window.delayhide)
        clearTimeout(delayhide)
}

function showit(which) {
    clear_delayhide();
    thecontent = (which == -1) ? "" : submenu[which];
    if (menuobj != undefined) {
        if (document.getElementById || document.all)
            menuobj.innerHTML = thecontent;
        else if (document.layers){
            menuobj.document.write(thecontent);
            menuobj.document.close();
        }
    }
}
var p_0 = new Image (); p_0.src = "img/p_0.gif";
var p_1 = new Image (); p_1.src = "img/p_1.gif";
var p_2 = new Image (); p_2.src = "img/p_2.gif";
var e_0 = new Image (); e_0.src = "img/e_0.gif";
var e_1 = new Image (); e_1.src = "img/e_1.gif";
var e_2 = new Image (); e_2.src = "img/e_2.gif";
var i_0 = new Image (); i_0.src = "img/i_0.gif";
var i_1 = new Image (); i_1.src = "img/i_1.gif";
var i_2 = new Image (); i_2.src = "img/i_2.gif";

var imgDocID=null;var imgObjName=null;
var imgDocId_b=null;var imgObjName_b=null;
var imgDocId_c=null;var imgObjName_c=null;

function rollOn(a, b, c, d, e, f) {

	imgDocID=a;imgObjName=b;imgDocID_b=c;imgObjName_b=d;imgDocID_c=e;imgObjName_c=f;
	document.images[imgDocID].src = eval(imgObjName + ".src");
	document.images[imgDocID_b].src = eval(imgObjName_b + ".src");
	document.images[imgDocID_c].src = eval(imgObjName_c + ".src");

}

