//var menuarray0 = new Array();
//menuarray0[0] = new makeMenuArray("Citi&#174; Gold / AAdvantage&#174; Card", "", "", "", "", "");
//menuarray0[1] = new makeMenuArray("Learn more", "/puertorico/cards/en/cardserv/worldcard/gold.htm", "", "", "", 0);
//menuarray0[2] = new makeMenuArray("Apply", "https://www.accountonline.com/ACQ/Apply?app=UNSOL&sc=6M3WE256&m=8CPR8E6MK0W&langId=EN&siteId=PR&B=A", "", "", "", 0);
//menuarray0[3] = new makeMenuArray("Citi&#174; Dividend Platinum Select&#174; Card", "/puertorico/cards/en/cardserv/divplat/index.htm", "", "", "", 2);
//menuarray0[4] = new makeMenuArray("Citi&#174; Gold / AAdvantage&#174; Cards", "", "", "", "", 2);
//menuarray0[5] = new makeMenuArray("Apply for a Card", "/puertorico/cards/en/chooser/index.htm", "", "", "", "");

var menuarray0 = new Array();
menuarray0[0] = new makeMenuArray("Sign-on", "https://www.citibank.com/puertorico/cards/en/index.jsp", "", "", "", "");
menuarray0[1] = new makeMenuArray("Registration", "https://www.accountonline.com/Register?siteId=PR&langId=EN", "", "", "", "");
menuarray0[2] = new makeMenuArray("About Online Services", "/puertorico/cards/en/tour/index.htm", "" , "", "", "");

var menuarray1 = new Array();
menuarray1[0] = new makeMenuArray("Phone Numbers", "/puertorico/cards/en/chooser/contact/card_ph.htm", "", "", "", "");
menuarray1[1] = new makeMenuArray("Mailing Addresses", "/puertorico/cards/en/chooser/contact/mail.htm", "", "", "", "");
menuarray1[2] = new makeMenuArray("Worry-Free Protection", "http://citi.bridgetrack.com/usc/_redir.htm?BTData=C021278796B617759574F4AB7A1A0ACAC9F9D9E82F1FDF8F3F4C2C42C2B9&BT_PC=1", "", "", "", "");
menuarray1[3] = new makeMenuArray("Security & You", "http://citi.bridgetrack.com/usc/_redir.htm?BTData=C021278796B617759574F45B7A1A0ACAC9E9D9E82F1FAF8F3F4CAA3EA2B9&BT_PC=1", "", "", "", "");
menuarray1[4] = new makeMenuArray("Safe Shopping", "/puertorico/cards/en/cardserv/shopping/index.htm", "", "", "", "");
menuarray1[5] = new makeMenuArray("Can't see the whole page?", "https://www.citibank.com/puertorico/cards/en/width.htm", "1", "554", "562", "");
menuarray1[6] = new makeMenuArray("Email Profile", "https://www.accountonline.com/EmailRegister?siteId=PR&langId=EN", "", "", "", "");
menuarray1[7] = new makeMenuArray("Site Map", "/puertorico/cards/en/sitemap.htm", "", "", "", "");

var lastmenu = -1;
var lastmenuitem = -1;
var menuTimer = null;
var menuTimer1 = null;
var hidedivs = null;

//if (navigator.platform == MacPPC || navigator.appVersion.indexOf("Macintosh") != -1)
if (navigator.appVersion.indexOf("Macintosh") != -1 || navigator.userAgent.indexOf("Netscape") != -1) vertpos = 98;
else vertpos = 100;
var xpos = new Array(4);
xpos[0] = 191;
xpos[1] = 377;
xpos[2] = 563;
xpos[3] = 5;

//vertpos = 146;
//var xpos = new Array(4);
//xpos[0] = 198;
//xpos[1] = 384;
//xpos[2] = 570;
//xpos[3] = 12;

var subdivs = new Array();


var imgname = new Array();
//imgname[0] = "/puertorico/cards/en/nav/menu/card_menu.gif";
imgname[0] = "/puertorico/cards/en/nav/menu/cmc_menu.gif";
imgname[1] = "/puertorico/cards/en/nav/menu/help_menu.gif";


var optimgname = "";
var optmenu = false;
var optmenuarray = new Array();


var styletag = "";
var clipheight = new Array();
var clipsubwidth = new Array();
var clipsubheight = new Array();
var menutops = new Array();
var menuarrays = new Array();
var menuarraysback = new Array();
var menuarraysfront = new Array();
var menusubarrays = new Array();
var menusubarraysback = new Array();
var menusubarraysfront = new Array();

var isIEMac = false;

if ( !document.layers )
{
	if ( ( navigator.appName != "Netscape" ) && ( navigator.platform != "Win32" ) )
	{
		isIEMac = true;
	}
}



// The following variables are all default values.
// They may be overwritten by the pages that call this script.
// Modifying the following variables will affect every page that calls this script, except in cases where they're overwritten by the page.
var menuforeground = '#000000';
var menubackground = '/puertorico/cards/en/nav/menu/3399cc.gif';
var menuhighlight = '/puertorico/cards/en/nav/menu/99ccff.gif';

var submenuforeground = '#000000';
var submenubackground = '/puertorico/cards/en/nav/menu/99ccff.gif';
var submenuhighlight = '/puertorico/cards/en/nav/menu/3399cc.gif';



function makeMenuArray(txt, url, linktype, height, width, par)
{
	if ( txt != "" )
	{
		this.txt = txt;
	}
	else
	{
		this.txt = "";
	}

	if ( url != "" )
	{
		this.url = url;
	}
	else
	{
		this.url = "";
	}

	if ( linktype != "" || linktype == "0" )
	{
		this.linktype = linktype;
	}
	else
	{
		this.linktype = 0;
	}

	if ( height != "" )
	{
		this.height = height;
	}
	else
	{
		this.height = "";
	}

	if ( width != "" )
	{
		this.width = width;
	}
	else
	{
		this.width = "";
	}

	if ( par != "" || par == "0" )
	{
		this.par = par;
	}
	else
	{
		this.par = -1;
	}
}


function cb_getElement(elemID)
{
	if ( document.layers )
	{
		return eval('document.layers["' + elemID + '"]');
	}
	else
	{
		if ( document.all )
		{
			return eval('document.all.' + elemID + '');
		}
		else
		{
			return document.getElementById(elemID);
		}
	}
}


function cb_getElementStyle(elemID)
{
	if ( document.layers )
	{
		return eval('document.layers["' + elemID + '"]');
	}
	else
	{
		if ( document.all )
		{
			return eval('document.all.' + elemID + '.style');
		}
		else
		{
			return document.getElementById(elemID).style;
		}
	}
}


function cb_getImage(elemID, imgID)
{
	if ( document.layers )
	{
		return eval('document.layers["' + elemID + '"].document.images["' + imgID + '"]');
	}
	else
	{
		return eval('document.images["' + imgID + '"]');
	}
}


function showmenu(num)
{
	if ( lastmenu != -1 )
	{
		eval('cb_getElementStyle("menu' + lastmenu + '").visibility = "hidden";');
		if ( !isIEMac )
		{
			eval('cb_getElementStyle("menu' + lastmenu + 'back").visibility = "hidden";');
			eval('cb_getElementStyle("menu' + lastmenu + 'front").visibility = "hidden";');
		}
		clearTimeout(menuTimer);
		hidesubmenu(lastmenu, lastmenuitem);
		lastmenuitem = -1;
	}
	lastmenu = num;

	if ( hidedivs != null )
	{
		for ( l = 0; l < hidedivs.length; l++ )
		{
			if ( eval('cb_getElement("' + hidedivs[l] + '")') )
			{
				eval('cb_getElementStyle("' + hidedivs[l] + '").visibility = "hidden";');
			}
		}
	}

	eval('cb_getElementStyle("menu' + num + '").visibility = "visible";');
	if ( !isIEMac )
	{
		eval('cb_getElementStyle("menu' + num + 'back").visibility = "visible";');
		eval('cb_getElementStyle("menu' + num + 'front").visibility = "visible";');
	}
}


function hidemenu(num)
{
	if ( hidedivs != null )
	{
		for ( l = 0; l < hidedivs.length; l++ )
		{
			if ( eval('cb_getElement("' + hidedivs[l] + '")') )
			{
				eval('cb_getElementStyle("' + hidedivs[l] + '").visibility = "visible";');
			}
		}
	}

	eval('cb_getElementStyle("menu' + num + '").visibility = "hidden";');
	if ( !isIEMac )
	{
		eval('cb_getElementStyle("menu' + num + 'back").visibility = "hidden";');
		eval('cb_getElementStyle("menu' + num + 'front").visibility = "hidden";');
	}
	hidesubmenu(lastmenu, lastmenuitem);
	lastmenuitem = -1;
}


function showsubmenu(i, j)
{
	if ( lastmenuitem != -1 )
	{
		eval('cb_getElementStyle("menu' + i + 'sub' + lastmenuitem + 'sub").visibility = "hidden";');
		if ( !isIEMac )
		{
			eval('cb_getElementStyle("menu' + i + 'sub' + lastmenuitem + 'subback").visibility = "hidden";');
			eval('cb_getElementStyle("menu' + i + 'sub' + lastmenuitem + 'subfront").visibility = "hidden";');
		}
		clearTimeout(menuTimer1);
		changeBG(i, lastmenuitem, menubackground);
	}
	lastmenuitem = j;
	eval('cb_getElementStyle("menu' + i + 'sub' + j + 'sub").visibility = "visible";');
	if ( !isIEMac )
	{
		eval('cb_getElementStyle("menu' + i + 'sub' + j + 'subback").visibility = "visible";');
		eval('cb_getElementStyle("menu' + i + 'sub' + j + 'subfront").visibility = "visible";');
	}
}


function hidesubmenu(i, j)
{
	if ( lastmenuitem != -1 )
	{
		changeBG(i, lastmenuitem, menubackground);
		eval('cb_getElementStyle("menu' + i + 'sub' + j + 'sub").visibility = "hidden";');
		if ( !isIEMac )
		{
			eval('cb_getElementStyle("menu' + i + 'sub' + j + 'subback").visibility = "hidden";');
			eval('cb_getElementStyle("menu' + i + 'sub' + j + 'subfront").visibility = "hidden";');
		}
		clearTimeout(menuTimer1);
	}
}


function menuitemover(i, j, haschildren)
{
	if ( j != lastmenuitem )
	{
		hidesubmenu(i, lastmenuitem);
	}
	else
	{
		clearTimeout(menuTimer1);
	}
	clearTimeout(menuTimer);
	changeBG(i, j, menuhighlight);
	if ( haschildren == true )
	{
		showsubmenu(i, j);
	}
}


function menuitemout(i, j, haschildren)
{
	menuTimer = eval("setTimeout('hidemenu(" + i + ")', 250);");

	if ( haschildren == true )
	{
		menuTimer1 = eval("setTimeout('hidesubmenu(" + i + ", " + j + ")', 250);");
		lastmenuitem = j;
	}
	else
	{
		changeBG(i, j, menubackground);
		lastmenuitem = -1;
	}
}


function changeBG(i, j, c)
{
	if ( j != -1 )
	{
		if ( !isIEMac )
		{
			eval('cb_getImage("menu' + i + 'back", "menu' + i + 'back' + j + '").src = "' + c + '";');
		}
	}
}

function popupURL(i, j)
{
	if ( eval('menuarray' + i + '[' + j + '].linktype') == 1 )
	{
		windowatts = 'toolbar=yes,scrollbars=yes,menubar=yes,location=yes,resizable=yes,status=yes';
		if ( eval('menuarray' + i + '[' + j + '].height') != '' )
		{
			windowatts += ',height=' + eval('menuarray' + i + '[' + j + '].height');
		}
		if ( eval('menuarray' + i + '[' + j + '].width') != '' )
		{
			windowatts += ',width=' + eval('menuarray' + i + '[' + j + '].width');
		}
		win = window.open(eval('menuarray' + i + '[' + j + '].url'), 'popup' + i + j, windowatts);
	}
	else
	{
		windowatts = 'toolbar=no,scrollbars=no,menubar=no,location=no,resizable=no,status=no';
		if ( eval('menuarray' + i + '[' + j + '].height') != '' )
		{
			windowatts += ',height=' + eval('menuarray' + i + '[' + j + '].height');
		}
		if ( eval('menuarray' + i + '[' + j + '].width') != '' )
		{
			windowatts += ',width=' + eval('menuarray' + i + '[' + j + '].width');
		}
		win = window.open(eval('menuarray' + i + '[' + j + '].url'), 'popup' + i + j, windowatts);
	}
}


function changesubBG(i, j, p, c)
{
	if ( j != -1 )
	{
		if ( !isIEMac )
		{
			eval('cb_getImage("menu' + i + 'sub' + p + 'subback", "menuback' + i + 'sub' + j + 'sub").src = "' + c + '";');
		}
	}
}


function writemenus()
{
	if ( !isIEMac )
	{
		document.write('<style>\n');
		if ( document.layers )
		{
			if ( navigator.platform == 'Win32' )
			{
				document.write('A.menu {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menu:link {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menu:active {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menu:visited {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  n');
				document.write('A.menuSub {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menuSub:link {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menuSub:active {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menuSub:visited {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
			}
			else
			{
				document.write('A.menu {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menu:link {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menu:active {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menu:visited {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  n');
				document.write('A.menuSub {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menuSub:link {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menuSub:active {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
				document.write('A.menuSub:visited {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }\n');
			}
		}
		else
		{
			document.write('A.menu {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }');
			document.write('A.menu:link {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }');
			document.write('A.menu:active {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }');
			document.write('A.menu:visited {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }');
			document.write('A.menuSub {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }');
			document.write('A.menuSub:link {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }');
			document.write('A.menuSub:active {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }');
			document.write('A.menuSub:visited {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }');
		}

		document.write('</style>');

		if ( ( optmenu == true ) && ( optmenuarray.length != 0 ) && ( optimgname != "" ) )
		{
			var menuarray3 = optmenuarray;
			imgname[2] = optimgname;
			c = 3;
		}
		else
		{
			c = 2;
		}

		styletag = '<style>\n\n';

		for ( i = 0; i < c; i++ )
		{
			menutops[i] = '<div id="menu' + i + 'top">';
			menutops[i] += '<table border="0" width="180" cellspacing="0" cellpadding="0">';
			menutops[i] += '<tr align="right">';
			menutops[i] += '<td width="180" height="19"><a href="#" onmouseover="clearTimeout(menuTimer);showmenu(' + i + ');hidesubmenu(' + i + ', lastmenuitem);lastmenuitem = -1;" onmouseout="menuTimer = setTimeout(\'hidemenu(' + i + ')\', 250);"><img src="' + imgname[i] + '" height="19" width="180" border="0"></a></td>';
			menutops[i] += '</tr>';
			menutops[i] += '</table>';
			menutops[i] += '</div>';

			j_offset = 0;

			menuarrays[i] = "";
			menuarraysback[i] = "";
			menuarraysfront[i] = "";

			menusubarrays[i] = new Array();
			menusubarraysback[i] = new Array();
			menusubarraysfront[i] = new Array();

			clipsubheight[i] = new Array();

			for ( j = 0; j < eval('menuarray' + i + '.length'); j++ )
			{
				clipsubheight[i][j] = -1;
				haschildren = false;

				for ( k = 0; k < eval('menuarray' + i + '.length'); k++ )
				{
					if ( eval('menuarray' + i + '[' + k + '].par') == j )
					{
						haschildren = true;
					}
				}

				if ( haschildren == true )
				{
					styletag += '#menu' + i + 'sub' + j + 'sub { position: absolute; top: ' + ( ( ( j - j_offset ) * 25 ) + vertpos + 19 ) + 'px; left: ' + ( xpos[i] + 180 ) + 'px; visibility: hidden; z-index: 75; }\n';
					styletag += '#menu' + i + 'sub' + j + 'subback { position: absolute; top: ' + ( ( ( j - j_offset ) * 25 ) + vertpos + 19 ) + 'px; left: ' + ( xpos[i] + 180 ) + 'px; visibility: hidden; z-index: 74; }\n';
					styletag += '#menu' + i + 'sub' + j + 'subfront { position: absolute; top: ' + ( ( ( j - j_offset ) * 25 ) + vertpos + 19 ) + 'px; left: ' + ( xpos[i] + 180 ) + 'px; visibility: hidden; z-index: 76; }\n';

					menusubarrays[i][j] = '<div id="menu' + i + 'sub' + j + 'sub"><table border="0" cellpadding="0" cellspacing="0">\n';
					menusubarraysback[i][j] = '<div id="menu' + i + 'sub' + j + 'subback"><table border="0" cellpadding="0" cellspacing="0">\n';
					menusubarraysfront[i][j] = '<div id="menu' + i + 'sub' + j + 'subfront"><table border="0" cellpadding="0" cellspacing="0">\n';
				}
				else
				{
					menusubarrays[i][j] = '';
					menusubarraysback[i][j] = '';
					menusubarraysfront[i][j] = '';
				}

				if ( eval('menuarray' + i + '[' + j + '].par') == -1 )
				{
					styletag += '#menu' + i + 'sub' + j + ' { position: absolute; top: ' + ( ( j - j_offset ) * 25 ) + 'px; left: 0px; height: 25px; width: 180px; z-index: 75; }\n';

					menuarrays[i] += '<tr>\n\n<td height="25" width="165"><a href="#" class="menu"><nobr>&nbsp;&nbsp;' + eval('menuarray' + i + '[' + j + '].txt') + '&nbsp;&nbsp;</nobr></a></td><td width="15"><img src="';

					if ( haschildren == true )
					{
						menuarrays[i] += '/puertorico/cards/en/nav/menu/arr_rgt.gif';
					}
					else
					{
						menuarrays[i] += '/us/cards/nav/menu/spacer.gif';
					}

					menuarrays[i] += '" height="19" width="15" border="0" align="right"></td>\n\n</tr>';

					menuarraysback[i] += '<tr>\n\n<td height="25" width="180"><img src="' + menubackground + '" name="menu' + i + 'back' + j + '" height="25" width="180" border="0"></td>\n\n</tr>';
					menuarraysfront[i] += '<tr>\n\n<td height="25" width="180"><a href="';

					if ( eval('menuarray' + i + '[' + j + '].url') != "" )
					{
						if ( eval('menuarray' + i + '[' + j + '].linktype') > 0 )
						{
							menuarraysfront[i] += 'javascript:popupURL(' + i + ', ' + j + ');';
						}
						else
						{
							menuarraysfront[i] += eval('menuarray' + i + '[' + j + '].url');
						}
					}
					else
					{
						menuarraysfront[i] += '#';
					}

					menuarraysfront[i] += '" onmouseover="menuitemover(' + i + ', ' + j + ', ' + haschildren + ');" onmouseout="menuitemout(' + i + ', ' + j + ', ' + haschildren + ');"><img src="/us/cards/nav/menu/spacer.gif" height="25" width="180" border="0"></a></td>\n\n</tr>';
				}
				else
				{
					j_offset++;

					menusubarrays[i][eval('menuarray' + i + '[' + j + '].par')] += '<tr>\n\n<td height="25"><a href="#" class="menuSub"><nobr>&nbsp;&nbsp;' + eval('menuarray' + i + '[' + j + '].txt') + '&nbsp;&nbsp;</nobr></a></td>\n\n</tr>\n';
					menusubarraysback[i][eval('menuarray' + i + '[' + j + '].par')] += '<tr>\n\n<td height="25"><img src="' + submenubackground + '" name="menuback' + i + 'sub' + j + 'sub" height="25" width="1000" border="0"></td>\n\n</tr>';
					menusubarraysfront[i][eval('menuarray' + i + '[' + j + '].par')] += '<tr>\n\n<td height="25"><a href="' + eval('menuarray' + i + '[' + j + '].url') + '" onmouseover="clearTimeout(menuTimer);clearTimeout(menuTimer1);changesubBG(' + i + ', ' + j + ', ' + eval('menuarray' + i + '[' + j + '].par') + ', submenuhighlight);" onmouseout="menuTimer1 = setTimeout(\'hidesubmenu(' + i + ', ' + eval('menuarray' + i + '[' + j + '].par') + ')\', 250);menuTimer = setTimeout(\'hidemenu(' + i + ')\', 250);changesubBG(' + i + ', ' + j + ', ' + eval('menuarray' + i + '[' + j + '].par') + ', submenubackground);"><img src="/us/cards/nav/menu/spacer.gif" height="25" width="1000" border="0"></a></td>\n\n</tr>';

					clipsubheight[i][j] = j_offset * 25;
				}
			}

			haschildren = false;
			lastfinishedmenu = -1;

			for ( j = 0; j < eval('menuarray' + i + '.length'); j++ )
			{
				for ( k = 0; k < eval('menuarray' + i + '.length'); k++ )
				{
					if ( ( eval('menuarray' + i + '[' + k + '].par') == j ) && ( lastfinishedmenu != j ) )
					{
						menusubarrays[i][j] += '<tr>\n\n<td height="1">';
						menusubarrays[i][j] += '<table border="0" width="100%" cellpadding="0" cellspacing="0">\n';
						menusubarrays[i][j] += '<tr>\n\n<td height="1"><img src="/us/cards/nav/menu/spacer.gif" name="widthtester' + i + 'sub' + j + '" height="1" width="100%" border="0"></td>\n\n</tr>\n';
						menusubarrays[i][j] += '</table>';
						menusubarrays[i][j] += '</td>\n\n</tr>\n';
						menusubarrays[i][j] += '</table></div>';
						menusubarraysback[i][j] += '</table></div>';
						menusubarraysfront[i][j] += '</table></div>';
						lastfinishedmenu = j;
					}
				}
			}

			menuarrays[i] = '<div id="menu' + i + '"><table border="0" width="180" cellspacing="0" cellpadding="0">' + menuarrays[i] + '</table></div>';
			menuarraysback[i] = '<div id="menu' + i + 'back"><table border="0" width="180" cellspacing="0" cellpadding="0">' + menuarraysback[i] + '</table></div>';
			menuarraysfront[i] = '<div id="menu' + i + 'front"><table border="0" width="180" cellspacing="0" cellpadding="0">' + menuarraysfront[i] + '</table></div>';

			styletag += '#menu' + i + 'top { position: absolute; top: ' + vertpos + 'px; left: ' + xpos[i] + 'px; z-index: 75; visibility: visible; }\n';
			styletag += '#menu' + i + ' { position: absolute; top: ' + ( vertpos + 19 ) + 'px; left: ' + xpos[i] + 'px; z-index: 75; visibility: hidden; }\n';
			styletag += '#menu' + i + 'back { position: absolute; top: ' + ( vertpos + 19 ) + 'px; left: ' + xpos[i] + 'px; z-index: 74; visibility: hidden; }\n';
			styletag += '#menu' + i + 'front { position: absolute; top: ' + ( vertpos + 19 ) + 'px; left: ' + xpos[i] + 'px; z-index: 76; visibility: hidden; }\n';
		}

		styletag += '\n</style>';

		document.write(styletag);

		for ( i = 0; i < c; i++ )
		{
			document.write(menutops[i]);
		}

		for ( i = 0; i < menuarrays.length; i++ )
		{
			document.write(menuarrays[i]);
		}
		for ( i = 0; i < menuarraysback.length; i++ )
		{
			document.write(menuarraysback[i]);
		}
		for ( i = 0; i < menuarraysfront.length; i++ )
		{
			document.write(menuarraysfront[i]);
		}

		for ( i = 0; i < menusubarrays.length; i++ )
		{
			for ( j = 0; j < menusubarrays[i].length; j++ )
			{
				if ( menusubarrays[i][j] != '' )
				{
					document.write(menusubarrays[i][j]);
				}
			}
		}
		for ( i = 0; i < menusubarrays.length; i++ )
		{
			clipsubwidth[i] = new Array();
			for ( j = 0; j < menusubarrays[i].length; j++ )
			{
				if ( menusubarrays[i][j] != '' )
				{
					clipsubwidth[i][j] = eval('cb_getImage("menu' + i + 'sub' + j + 'sub", "widthtester' + i + 'sub' + j + '").width');
				}
			}
		}
		for ( i = 0; i < menusubarraysback.length; i++ )
		{
			for ( j = 0; j < menusubarraysback[i].length; j++ )
			{
				if ( menusubarraysback[i][j] != '' )
				{
					document.write(menusubarraysback[i][j]);
					if ( document.layers )
					{
						eval('cb_getElementStyle("menu' + i + 'sub' + j + 'subback").clip.width = clipsubwidth[' + i + '][' + j + ']');
					}
					else
					{
						eval('cb_getElementStyle("menu' + i + 'sub' + j + 'subback").clip = "rect(0, ' + clipsubwidth[i][j] + ', 1000, 0)";');
					}
				}
			}
		}
		for ( i = 0; i < menusubarraysfront.length; i++ )
		{
			for ( j = 0; j < menusubarraysfront[i].length; j++ )
			{
				if ( menusubarraysfront[i][j] != '' )
				{
					document.write(menusubarraysfront[i][j]);
					if ( document.layers )
					{
						eval('cb_getElementStyle("menu' + i + 'sub' + j + 'subfront").clip.width = clipsubwidth[' + i + '][' + j + ']');
					}
					else
					{
						eval('cb_getElementStyle("menu' + i + 'sub' + j + 'subfront").clip = "rect(0, ' + clipsubwidth[i][j] + ', 1000, 0)";');
					}
				}
			}
		}
	}
	else
	{
		styletag = '<style>\n\n';
		styletag += 'A.menuClass {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }';
		styletag += 'A.menuClass:link {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }';
		styletag += 'A.menuClass:alink {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }';
		styletag += 'A.menuClass:vlink {  color: ' + menuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }';
		styletag += 'A.menuSubClass {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }';
		styletag += 'A.menuSubClass:link {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }';
		styletag += 'A.menuSubClass:alink {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }';
		styletag += 'A.menuSubClass:vlink {  color: ' + submenuforeground + '; FONT-FAMILY: arial, helvetica; FONT-SIZE: 12px; TEXT-DECORATION: none;  }';

		if ( ( optmenu == true ) && ( optmenuarray.length != 0 ) && ( optimgname != "" ) )
		{
			var menuarray3 = optmenuarray;
			imgname[3] = optimgname;
			c = 4;
		}
		else
		{
			c = 3;
		}

		for ( i = 0; i < c; i++ )
		{
			menutops[i] = '<div id="menu' + i + 'top">';
			menutops[i] += '<table border="0" width="180" cellspacing="0" cellpadding="0">';
			menutops[i] += '<tr>';
			menutops[i] += '<td width="180" height="19"><a href="#" onmouseover="clearTimeout(menuTimer);showmenu(' + i + ');hidesubmenu(' + i + ', lastmenuitem);lastmenuitem = -1;" onmouseout="menuTimer = setTimeout(\'hidemenu(' + i + ')\', 250);"><img src="' + imgname[i] + '" height="19" width="180" border="0"></a></td>';
			menutops[i] += '</tr>';
			menutops[i] += '</table>';
			menutops[i] += '</div>';

			j_offset = 0;

			menuarrays[i] = "";

			menusubarrays[i] = new Array();

			clipsubheight[i] = new Array();

			for ( j = 0; j < eval('menuarray' + i + '.length'); j++ )
			{
				clipsubheight[i][j] = -1;
				haschildren = false;

				for ( k = 0; k < eval('menuarray' + i + '.length'); k++ )
				{
					if ( eval('menuarray' + i + '[' + k + '].par') == j )
					{
						haschildren = true;
					}
				}

				if ( haschildren == true )
				{
					styletag += '#menu' + i + 'sub' + j + 'sub { position: absolute; top: ' + ( ( ( j - j_offset ) * 25 ) + vertpos + 19 ) + 'px; left: ' + ( xpos[i] + 180 ) + 'px; visibility: hidden; z-index: 75; }\n';

					menusubarrays[i][j] = '<div id="menu' + i + 'sub' + j + 'sub"><table border="0" cellpadding="0" cellspacing="0">\n';
				}
				else
				{
					menusubarrays[i][j] = '';
				}

				if ( eval('menuarray' + i + '[' + j + '].par') == -1 )
				{
					styletag += '#menu' + i + 'sub' + j + ' { position: absolute; top: ' + ( ( j - j_offset ) * 25 ) + 'px; left: 0px; height: 25px; width: 180px; z-index: 75; }\n';

					menuarrays[i] += '<tr>\n\n<td height="25" width="180" style="background-image: url( ' + menubackground + ' );" onmouseover="menuitemover(' + i + ', ' + j + ', ' + haschildren + ');this.style.backgroundImage = \'url( ' + menuhighlight + ' )\';" onmouseout="menuitemout(' + i + ', ' + j + ', ' + haschildren + ');this.style.backgroundImage = \'url( ' + menubackground + ' )\';"><a href="';

					if ( eval('menuarray' + i + '[' + j + '].url') != "" )
					{
						if ( eval('menuarray' + i + '[' + j + '].linktype') > 0 )
						{
							menuarrays[i] += 'javascript:popupURL(' + i + ', ' + j + ');';
						}
						else
						{
							menuarrays[i] += eval('menuarray' + i + '[' + j + '].url');
						}
					}
					else
					{
						menuarrays[i] += '#';
					}

					menuarrays[i] += '" class="menuClass"><nobr><img src="';

					if ( haschildren == true )
					{
						menuarrays[i] += '/puertorico/cards/en/nav/menu/arr_rgt.gif';
					}
					else
					{
						menuarrays[i] += '/us/cards/nav/menu/spacer.gif';
					}

					menuarrays[i] += '" height="19" width="15" border="0" align="right">&nbsp;&nbsp;' + eval('menuarray' + i + '[' + j + '].txt') + '&nbsp;&nbsp;</nobr></a></td>\n\n</tr>';
				}
				else
				{
					j_offset++;

					menusubarrays[i][eval('menuarray' + i + '[' + j + '].par')] += '<tr>\n\n<td height="25" style="background-image: url( ' + submenubackground + ' );" onmouseover="clearTimeout(menuTimer);clearTimeout(menuTimer1);this.style.backgroundImage = \'url( ' + submenuhighlight + ' )\';" onmouseout="menuTimer1 = setTimeout(\'hidesubmenu(' + i + ', ' + eval('menuarray' + i + '[' + j + '].par') + ')\', 250);menuTimer = setTimeout(\'hidemenu(' + i + ')\', 250);this.style.backgroundImage = \'url( ' + submenubackground + ' )\';"><a href="';

					if ( eval('menuarray' + i + '[' + j + '].url') != "" )
					{
						if ( eval('menuarray' + i + '[' + j + '].linktype') > 0 )
						{
							menusubarrays[i][eval('menuarray' + i + '[' + j + '].par')] += 'javascript:popupURL(' + i + ', ' + j + ');';
						}
						else
						{
							menusubarrays[i][eval('menuarray' + i + '[' + j + '].par')] += eval('menuarray' + i + '[' + j + '].url');
						}
					}
					else
					{
						menusubarrays[i][eval('menuarray' + i + '[' + j + '].par')] += '#';
					}

					menusubarrays[i][eval('menuarray' + i + '[' + j + '].par')] += '" class="menuSubClass"><nobr>&nbsp;&nbsp;' + eval('menuarray' + i + '[' + j + '].txt') + '&nbsp;&nbsp;</nobr></a></td>\n\n</tr>\n';

					clipsubheight[i][j] = j_offset * 25;
				}
			}

			haschildren = false;
			lastfinishedmenu = -1;

			for ( j = 0; j < eval('menuarray' + i + '.length'); j++ )
			{
				for ( k = 0; k < eval('menuarray' + i + '.length'); k++ )
				{
					if ( ( eval('menuarray' + i + '[' + k + '].par') == j ) && ( lastfinishedmenu != j ) )
					{
						menusubarrays[i][j] += '</table></div>';
						lastfinishedmenu = j;
					}
				}
			}

			menuarrays[i] = '<div id="menu' + i + '"><table border="0" width="180" cellspacing="0" cellpadding="0">' + menuarrays[i] + '</table></div>';

			styletag += '#menu' + i + 'top { position: absolute; top: ' + vertpos + 'px; left: ' + xpos[i] + 'px; z-index: 75; visibility: visible; }\n';
			styletag += '#menu' + i + ' { position: absolute; top: ' + ( vertpos + 19 ) + 'px; left: ' + xpos[i] + 'px; z-index: 75; visibility: hidden; }\n';
		}

		styletag += '\n</style>';

		document.write(styletag);

		for ( i = 0; i < c; i++ )
		{
			document.write(menutops[i]);
		}

		for ( i = 0; i < menuarrays.length; i++ )
		{
			document.write(menuarrays[i]);
		}

		for ( i = 0; i < menusubarrays.length; i++ )
		{
			for ( j = 0; j < menusubarrays[i].length; j++ )
			{
				if ( menusubarrays[i][j] != '' )
				{
					document.write(menusubarrays[i][j]);
				}
			}
		}
	}
}


