/* Pop up window for all external links <SCRIPT>*/

// --------------------------------------------------------------------------------------------------------------
// Top and Sub Navigation Code
// --------------------------------------------------------------------------------------------------------------
var mtopnavs = null;
var mcallouts = new Object();

function Topnav(pid, phref, pwidth, pheight, pcallout) {
	// class used to hold onto the image, title and text of each bmo tour section
	this.id = pid; this.href = phref;
	this.width = pwidth; this.height = pheight;
	mcallouts[pid] = pcallout;	// used in filter() mouseover event
}

function initialize() {
	var counter = -1, counter2 = -1;

	mtopnavs = new Array(9)	// 0 to 8
	for (counter=1; counter < mtopnavs.length; counter++) {
		mtopnavs[counter] = new Array();
	}

	mtopnavs[1][1] = new Topnav("finsum", "../finsum/finsum_mysum.html", 88, 36, "Visualisez vos comptes, voyez le d&eacute;tail de vos transactions ou t&eacute;l&eacute;chargez les donn&eacute;es de vos comptes dans un logiciel de gestion des finances personnelles.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("finsum_mysum", "../finsum/finsum_mysum.html", 88, 38, "Obtenez la liste de tous vos comptes et de vos transactions avec BMO Banque de Montr&eacute;al.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("finsum_viewacc", "../finsum/finsum_viewacc.jsp", 113, 38, "Obtenez le d&eacute;tail des op&eacute;rations effectu&eacute;es dans chacun de vos comptes selon un intervalle de dates temps pr&eacute;cis.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("finsum_download", "../finsum/finsum_download.html", 146, 38, "&Agrave; partir des Services bancaires en ligne, t&eacute;l&eacute;chargez les donn&eacute;es de vos comptes dans un logiciel de gestion des finances personnelles.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("finsum_modify", "", 112, 38, "Ajoutez ou supprimez un compte de d&eacute;pôt ou de pr&ecirc;t BMO Banque de Montr&eacute;al.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("finsum_tracker", "../finsum/finsum_tracker.html",121, 38, "Consultez les d&eacute;tails apparaissant au BMO Relev&eacute; unique pour tous vos comptes li&eacute;s.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("", "", 224, 38, "");

	mtopnavs[2][1] = new Topnav("billpay", "../billpay/billpay_pay.jsp", 93, 36, "Payez des factures, programmez le paiement des factures p&eacute;riodiques et g&eacute;rez votre liste de fournisseurs.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_pay", "../billpay/billpay_pay.jsp", 83, 38, "Payez vos factures maintenant - ou programmez les paiements &agrave; venir - rapidement et facilement. Plus de ch&egrave;ques, plus de timbres, plus de tracas.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_view", "", 92, 38, "Recevez et consultez le d&eacute;tail de vos factures en ligne au moyen du service <i>postel</i>.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_modify", "../billpay/billpay_modify_add.jsp", 95, 38, "Ajoutez, modifiez ou supprimez un fournisseur figurant sur votre liste.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_investigate", "", 112, 38, "Envoyez une demande de recherche d'un r&egrave;glement de facture.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_listdel", "", 154, 38, "Obtenez la liste de vos r&egrave;glements postdat&eacute;s, et modifiez-les &agrave; votre gr&eacute;.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_history", "", 125, 38, "Obtenez la liste des factures que vous avez r&eacute;gl&eacute;es au cours de votre session d'utilisation des Services bancaires en ligne.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("", "", 1, 38, "");

	mtopnavs[3][1] = new Topnav("transfers", "../transfers/transfers_account.jsp", 90, 36, "Virez des fonds d'un compte &agrave; un autre, obtenez une avance de fonds ou envoyez ou recevez des fonds par courriel.");
	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_account", "../transfers/transfers_account.jsp", 83, 38, "Virez des fonds d'un compte &agrave; un autre en quelques secondes.");
//	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_advance", "../transfers/transfers_advance.jsp", 83, 38, "Obtenez une avance de fonds &agrave; partir de votre marge de cr&eacute;dit ou de votre carte MasterCard BMO®*, et d&eacute;posez-la directement dans le compte de votre choix.");
	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_email", "../transfers/transfers_email.html", 127, 38, "Envoyez et recevez des fonds rapidement et en toute s&eacute;curit&eacute; par courriel, pourvu que l'exp&eacute;diteur ou le destinataire ait une adresse de courriel et un compte bancaire canadien.");
//	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_usdollar", "", 87, 38, "Virez des fonds entre comptes en dollars am&eacute;ricains et canadiens, ou entre comptes en dollars am&eacute;ricains.");
	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_recurring", "", 95, 38, "Programmez des virements p&eacute;riodiques pour couvrir le montant de vos paiements, de vos ch&egrave;ques, etc.");
	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_history", "", 130, 38, "Obtenez la liste des virements effectu&eacute;s au cours d'une s&eacute;ance d'utilisation des Services bancaires en ligne.");
	mtopnavs[3][mtopnavs[3].length] = new Topnav("", "", 320, 38, "");

	mtopnavs[4][1] = new Topnav("messcent", "../messcent/messcent_contactus.html", 87, 36, "Envoyez des demandes de service &agrave; la client&egrave;le et soyez bien renseign&eacute;(e) grâce aux alertes des Services bancaires en <br>ligne.");
	mtopnavs[4][mtopnavs[4].length] = new Topnav("messcent_messages", "", 90, 38, "Si vous avez besoin d'aide, envoyez un message au directeur - Services bancaires en direct.");
	mtopnavs[4][mtopnavs[4].length] = new Topnav("messcent_history", "", 88, 38, "Acc&eacute;dez aux archives de tous les messages que vous avez envoy&eacute;s et reçus par l'entremise des Services bancaires en ligne.");
	mtopnavs[4][mtopnavs[4].length] = new Topnav("messcent_contactus", "../messcent/messcent_contactus.html", 100, 38, "Voyez comment communiquer avec un directeur - Services bancaires en direct.");
	mtopnavs[4][mtopnavs[4].length] = new Topnav("", "", 462, 38, "");

	mtopnavs[5][1] = new Topnav("persinfo", "../persinfo/persinfo_change.html", 103, 36, "G&eacute;rez tous vos renseignements personnels &agrave; partir d'ici.");
	mtopnavs[5][mtopnavs[5].length] = new Topnav("persinfo_view", "", 80, 38, "Visualisez l'adresse inscrite dans nos dossiers, et la marche &agrave; suivre pour la modifier.");
	mtopnavs[5][mtopnavs[5].length] = new Topnav("persinfo_change", "../persinfo/persinfo_change.html", 85, 38, "Modifiez votre adresse si vous d&eacute;m&eacute;nagez ou si vos coordonn&eacute;es changent.");
	mtopnavs[5][mtopnavs[5].length] = new Topnav("persinfo_password", "", 94, 38, "Changez votre mot de passe pour les Services bancaires en ligne et les Services bancaires par t&eacute;l&eacute;phone.");
	mtopnavs[5][mtopnavs[5].length] = new Topnav("", "", 453, 38, "");

	mtopnavs[6][1] = new Topnav("accnts", "../accnts/accnts_order.html", 100, 36, "Assurez la gestion et le suivi de vos comptes et de vos programmes de services bancaires BMO Banque de Montr&eacute;al.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_myacc", "", 87, 38, "Voyez, en un coup d'œil, l'ensemble de vos comptes et de vos op&eacute;rations bancaires.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_order", "../accnts/accnts_order.html", 84, 38, "Commandez une nouvelle provision de ch&egrave;ques rapidement et facilement, sans avoir &agrave; vous rendre en succursale.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_open", "", 108, 38, "Ouvrez un compte sans avoir &agrave; vous rendre en succursale.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_foreign", "", 153, 38, "Commandez des ch&egrave;ques de voyage et des devises, puis passez les prendre en succursale ou faites-les livrer &agrave; votre domicile par service de messagerie.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_stop", "../accnts/accnts_stop.html", 85, 38, "&Eacute;tablissez un arr&ecirc;t de paiement &agrave; l'&eacute;gard d'un ch&egrave;que ou d'un pr&eacute;l&egrave;vement automatique.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_consolidate", "", 128, 38, "Consolidez vos relev&eacute;s mensuels et obtenez tous les d&eacute;tails de vos comptes sur un m&ecirc;me relev&eacute;.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_firstbank", "", 129, 38, "Liez jusqu'&agrave; 10 comptes &agrave; votre Maxi-Carte<sup>MD</sup> afin de pouvoir v&eacute;rifier les transactions qui y sont port&eacute;es.");

	mtopnavs[7][1] = new Topnav("invest", "../invest/invest_myinvest.html", 107, 36, "Obtenez des renseignements et des outils pour faciliter la gestion de vos placements BMO Banque de Montr&eacute;al.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_myinvest", "../invest/invest_myinvest.html", 103, 38, "Consultez en un coup d'œil tous vos placements BMO.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_gic", "", 113, 38, "G&eacute;rez vos Fonds d'investissement BMO et vos Placements &agrave; terme BMO non enregistr&eacute;s au moyen d'un sommaire personnalis&eacute; permettant de consulter les d&eacute;tails de vos comptes.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_rrsp", "", 75, 38, "Consultez le sommaire de votre R&eacute;gime enregistr&eacute; d'&eacute;pargne-retraite pour conna&icirc;tre les d&eacute;tails de vos comptes et de vos transactions, et avoir acc&egrave;s &agrave; des renseignements et des outils.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_resp", "", 75, 38, "Acc&eacute;dez et g&eacute;rez vos comptes de R&eacute;gime enregistr&eacute; d'&eacute;pargne-&eacute;tudes (REEE) et obtenez des outils et des renseignements.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_rrif", "", 72, 38, "G&eacute;rez et contrôlez votre compte de Fonds enregistr&eacute; de revenu de retraite et acc&eacute;dez au d&eacute;tails et &agrave; l'historique du compte.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_investorline", "", 108, 38, "Consultez votre compte BMO Ligne d'action en un coup d'oeil.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_nesbitt", "", 119, 38, "Consultez vos comptes BMO Nesbitt Burns en un coup d'oeil.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("", "", 153, 38, "");

	mtopnavs[8][1] = new Topnav("mortlons", "../mortlons/mortlons_myholdings.html", 106, 36, "Obtenez des renseignements et des outils pour faciliter la gestion de tous vos pr&ecirc;ts personnels et hypoth&eacute;caires BMO Banque de Montr&eacute;al.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("mortlons_myholdings", "../mortlons/mortlons_myholdings.html", 83, 38, "Obtenez un sommaire de vos comptes de pr&ecirc;t personnel, de pr&ecirc;t hypoth&eacute;caire et de carte de cr&eacute;dit.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("mortlons_lumpsum", "", 141, 38, "Acc&eacute;l&eacute;rez le remboursement du capital de votre pr&ecirc;t hypoth&eacute;caire jusqu'&agrave; concurrence de 20 % par ann&eacute;e civile.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("mortlons_increase", "", 139, 38, "Augmentez vos versements hypoth&eacute;caires p&eacute;riodiques jusqu'&agrave; concurrence de 20 % par ann&eacute;e civile.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("mortlons_skip", "", 115, 38, "Sautez jusqu'&agrave; quatre versements hypoth&eacute;caires (capital et int&eacute;r&ecirc;t) durant une ann&eacute;e civile.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("mortlons_applications", "", 130, 38, "Pr&eacute;sentez une demande de pr&ecirc;t hypoth&eacute;caire, de pr&ecirc;t personnel ou de marge de cr&eacute;dit en ligne.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("", "", 69, 38, "");

	// Add the 'Try it now' link...
	for (counter=1; counter < mtopnavs.length; counter++) {
		for (counter2=1; counter2 < mtopnavs[counter].length; counter2++) {
			if (mtopnavs[counter][counter2].href != "") {
				// mcallouts[mtopnavs[counter][counter2].id] += " <A HRef='" + mtopnavs[counter][counter2].href + "' class='links'>Try it now.</A>";
				mcallouts[mtopnavs[counter][counter2].id] += " <B><br>Faites-en l'essai maintenant.</B>";
			}
		}
	}
}
initialize();

function body_topnav() {
	var topnavid = "";
	var id = "";
	var image_onmouseover = "", image_onmouseout = "", image_default = "";
	var href = "";

	// Topnav -------------------------------------------------------------------------------------------------------------------------------------------------------
	document.write(
		  "<table width='775' border='0' cellspacing='0' cellpadding='0'>"
		+ "<tr>"
		+ "<td Width=1><img src='../../images/fr/left_on.gif' width='1' height='36' alt='' border='0'></td>"
	);

	for (counter=1; counter < mtopnavs.length; counter++) {
		id =  mtopnavs[counter][1].id;
		image_onmouseover = " if (mcallouts['" + id + "']) { callout_open('a" + id + "', mcallouts['" + id + "']); }";
		image_onmouseout = " callout_close();";

		if (mfilenamefirst == id) {
			// case 1 : user picked this tab. it defaults to highlighted.
			topnavid = counter;
			image_default = "../../images/fr/" + id + "_on.gif";

		} else if (mtopnavs[counter][1].href == "") {
			// case 2 : user did NOT pick this tab. this tab CANNOT be picked. it defaults to OFF
			// image_default = "../../images/fr/" + id + "_off.gif";
			image_default = "../../images/fr/" + id + ".gif";

		} else {
			// case 3 : use did NOT pick this tab. this tab CAN be picked. mouseover and mouseout need to highlight and dehighlight (in addition to callouts)
			// if (objectsrc.substring(objectsrc.length - 3, objectsrc.length) == "_on") {
			image_onmouseover += " filter('" + id + "', '" + id + "_on');";
			image_onmouseout += " filter('" + id + "', '" + id + "');";
			image_default = "../../images/fr/" + id + ".gif";
		}

		if (mtopnavs[counter][1].href == "") { href = ""; } else { href = " href='" + mtopnavs[counter][1].href + "'"; }
		document.write(
			  "<td width='" + mtopnavs[counter][1].width + "'><a id='a" + id + "' " + href + " onmouseover=\"" + image_onmouseover + "\" onmouseout=\"" + image_onmouseout+ "\"><img src='" + image_default + "' border='0' name='" + id + "'></a></td>"
		);
	}

	document.write(
		  "</tr>"
		+ "</table>"
	);

	// Subnav -------------------------------------------------------------------------------------------------------------------------------------------------------
	document.write(
		  "<table width='775' border='0' cellspacing='0' cellpadding='0'>"
		+ "<tr valign=top align=left>"
		+ "<td width=1><img src='../../images/fr/left_sub.gif' width='1' height='38' alt='' border='0'></td>"
	);

	for (counter=2; counter < mtopnavs[topnavid].length; counter++) {
		if (mtopnavs[topnavid][counter].id != "") {
			id = mtopnavs[topnavid][counter].id;
			image_onmouseover = " if (mcallouts['" + id + "']) { callout_open('a" + id + "', mcallouts['" + id + "']); }";
			image_onmouseout = " callout_close();";

			if (mfilename.match(id)) {
				// case 1 : user picked this tab. it defaults to highlighted.
				image_default = "../../images/fr/" + id + "_on.gif";

			} else if (mtopnavs[topnavid][counter].href == "") {
				// case 2 : user did NOT pick this tab. this tab CANNOT be picked. it defaults to OFF
				// image_default = "../../images/fr/" + id + "_off.gif";
				image_default = "../../images/fr/" + id + ".gif";

			} else {
				// case 3 : use did NOT pick this tab. this tab CAN be picked. mouseover and mouseout need to highlight and dehighlight (in addition to callouts)
				// if (objectsrc.substring(objectsrc.length - 3, objectsrc.length) == "_on") {
				image_onmouseover += " filter('" + id + "', '" + id + "_on');";
				image_onmouseout += " filter('" + id + "', '" + id + "');";
				image_default = "../../images/fr/" + id + ".gif";
			}

			if (mtopnavs[topnavid][counter].href == "") { href = ""; } else { href = " href='" + mtopnavs[topnavid][counter].href + "'"; }
			document.write(
				  "<td width='" + mtopnavs[topnavid][counter].width + "'><a id='a" + id + "' " + href + " onmouseover=\"" + image_onmouseover + "\" onmouseout=\"" + image_onmouseout+ "\"><img src='" + image_default + "' border='0' name='" + id + "'></a></td>"
			);
		} else {
			// bottom dark line is part of graphic, so it needs to be added like a full cell (bgcolor won't do it)
			document.write(
				"<td width='" + mtopnavs[topnavid][counter].width + "'><img src='../../images/fr/sp_sub.gif' border=0 width='" + mtopnavs[topnavid][counter].width + "' height='" + mtopnavs[topnavid][counter].height + "'></td>"
			);
		}
	}

	document.write(
		"</tr>"
		+ "</table>"
	);
}

// --------------------------------------------------------------------------------------------------------------
// Callout Code
// --------------------------------------------------------------------------------------------------------------
var mcallout_timerid = -1;
var mcallout_holdid = "";
var mcallout_html = "", mcallout_left = -1, mcallout_top = -1;
var mcallout_id = "", mcallout_holdid = "";

function callout_open(pID, phtml) {
	// 1. In Netscape 4, this will work only when attached to an anchor
	//    because ONLY anchors support the onmouseover event
	var arrow_left = false;

	if (browser.get_id("speak", browser.object)) {
		if (mcallout_timerid > -1) { window.clearTimeout(mcallout_timerid); }

		if (browser.get_anchorx(pID) < 350) { arrow_left = true; } else { arrow_left = false; }

		mcallout_html =
			  "<table width='222' cellspacing='0' cellpadding='0' border='0'>"
			+ "<tr valign='TOP'>";

		if (arrow_left) { 	mcallout_html += "    <td><img src='../../images/fr/tour_callout_arrow.gif' width=20 height=32 border=0 alt=''></td>"; }

		mcallout_html +=
			  "    <td><img src='../../images/fr/tour_callout_title.gif' width=256 height=20 border=0 alt=''><br>"
			+ "		<table width='256' border='0' cellspacing='0' cellpadding='2' bgcolor='#d60000'>"
			+ "		<tr>"
			+ "		    <td>"
			+ "				<table width='252' border='0' cellspacing='0' cellpadding='5' bgcolor='#ffffff'>"
			+ "				<tr>"
			+ "				    <td class=bodytext>" + phtml + "</td>"
			+ "				</tr>"
			+ "				</table>"
			+ "			</td>"
			+ "		</tr>"
			+ "		</table>"
			+ "	</td>";

		if (!arrow_left) { 	mcallout_html += "    <td><img src='../../images/fr/tour_callout_arrow2.gif' width=20 height=32 border=0 alt=''></td>"; }

		mcallout_html +=
			  "</tr>"
			+ "</table>";

		// alert(document.images["billpay"].offsetLeft + ":" + document.images["billpay"].width + ":" + document.images["billpay"].height);
		// style='position:relative; needs to exist to access offsetLeft (relative and absolute work great)
		// images only have width & height readily available. netscape has .x and .y for getting the absolute position of the image, but ie doesn't (unless you add a style sheet)

		if (arrow_left) {
			mcallout_left = browser.get_anchorx(pID) + browser.get_id(pID, browser.object).offsetWidth - 15;
		} else {
			mcallout_left = browser.get_anchorx(pID) - 256 - 5;
		}
		mcallout_top = browser.get_anchory(pID) - 20;
		if (browser.type == browser.N6) { mcallout_top -= 20; }
		mcallout_id = pID;

		mcallout_timerid = window.setTimeout("callout_timer();", 1000);	// in 1/2 a second, show the callout
	}
}

function callout_close() {
	// we've mousedout of the word or the callout, close in 1 second
	if (mcallout_timerid > -1) { window.clearTimeout(mcallout_timerid); mcallout_timerid = -1; }

	if (browser.get_id("speak", browser.object)) {
		// make it invisible
		if (browser.get("speak", browser.visibility)) {
			browser.set("speak", browser.visibility, false);
			mcallout_holdid = "";
			mcallout_id = "";
		}
	} else {
		mcallout_holdid = "";
		mcallout_id = "";
	}
}

function callout_renew() {
}

function callout_timer() {
	// we would only get here if there is a message to hide
	// make it visible if it's invisible or the id has changed
	if (browser.get_id("speak", browser.object)) {
		if ((!browser.get("speak", browser.visibility)) || (mcallout_holdid != mcallout_id)) {
			browser.set("speak", browser.left, mcallout_left);
			browser.set("speak", browser.top,  mcallout_top);
			browser.set("speak", browser.html, mcallout_html);
			browser.set("speak", browser.visibility, true);
			mcallout_holdid = mcallout_id;
		}
	}
}
// --------------------------------------------------------------------------------------------------------------

// --------------------------------------------------------------------------------------------------------------
// Browser Code
// --------------------------------------------------------------------------------------------------------------
function Browser() {
	// public constants
	this.IE=1; this.N4=2; this.N6=3;
	this.object=1; this.stylesheet=2;
	this.left=1; this.top=2; this.width=3; this.height=4; this.visibility=5; this.html=6;

	// public properties
	this.type=-1;
	this.screenwidth = -1; this.screenheight = -1

	// determine browser (not screen) version and width & height of browser (width & height is constant across browsers)
	// note: width & height of an IE browser is cannot be determined until LOAD event. hence, this must be called from load
	if (!document.all && document.getElementById) {
		// Netscape 6 : it's worth noting the way you access SPANS/DIVS and the way you access images are TOTALLY different
		this.type = this.N6 ;
	} else if (!document.all && document.layers) {
		// Netscape 4
		this.type = this.N4;
	} else { // if (document.all) {
		// IE 4+ (defaults to IE DOM implementation)
		this.type = this.IE;
	}

	this.get_anchorx = function get_anchorx(pID)
	{	var parent = null, x = 0;

		if (this.type == this.N4) {
			x = document.anchors[pID].x;
		} else {
			// works great in PC IE 5.5+, Netscape 6.2+ (for an anchor or a span)
			parent = this.get_id(pID, this.object)
			while (parent != null) {
				x += parent.offsetLeft;
				parent = parent.offsetParent;
			}
		}
		return parseInt(x);

		// anchors work in netscape 4 but lack the offsetleft to do calculations.
		// .x - works in Netscape 4 ONLY!
		// document.anchors[0] works in everything BUT document.anchors[stringname] does NOT work in IE
	}

	this.get_anchory = function get_anchory(pID)
	{	var parent = null, y = 0;

		if (this.type == this.N4) {
			y = document.anchors[pID].y;
		} else {
			// works great in PC IE 5.5+, Netscape 6.2+ (for an anchor or a span)
			parent = this.get_id(pID, this.object)
			while (parent != null) {
				y += parent.offsetTop;
				parent = parent.offsetParent;
			}
		}
		return parseInt(y);
	}

	this.get_id = function get_id(pID, ptype) {
	// pID: string: name of span/div tag in HTML
	// ptype: number: must be this.object or this.stylesheet
	// returns: pointer to object // stylesheet
	// note: cannot return document.all[pID] in a variable, must be returned directly
		if ((!ptype) || ((ptype < this.object) || (ptype > this.stylesheet))) {alert("BUG:Browser.get_id: Not passed a valid type. Supports only browser.object and browser.stylesheet.");}
		// *** should probably check if object exits

		if (this.type == this.N6) {
			// Netscape 6 : it's worth noting the way you access SPANS/DIVS and the way you access images are TOTALLY different
			if (ptype == this.object) {return document.getElementById(pID);} else if (ptype == this.stylesheet) {return window.document.getElementById(pID).style;}
		} else if (this.type == this.N4) {
			// Netscape 4
			if (ptype == this.object) {return document.layers[pID];} else if (ptype == this.stylesheet) {return document.layers[pID];}
		} else {
			// IE 4+ (defaults to IE DOM implementation) (if (document.all))
			if (ptype == this.object) {return document.all[pID];} else if (ptype == this.stylesheet) {return document.all[pID].style;}
		}
	}

	this.get = function get(pID, pproperty) {
	// developer friendly function for using get_id - abstracts the developer from stylesheet property vs. property of the tag
	// pID: string: name of span/div tag in HTML
	// ptype: number: must be this.object or this.stylesheet
	// returns: strongly typed value
		if (!(this.get_id(pID, this.object))) {alert("BUG:Browser.get: Not passed a valid ID of a span/div (case sensitive). I was passed '" + pID + "'.");}
		if ((!pproperty) || ((pproperty < this.left) || (pproperty > this.html))) {alert("BUG:Browser.get: Not passed a valid property. Supports only browser.left, browser.top, browser.width, browser.height, browser.visibility and browser.html. * Case Sensitive *");}

		if (pproperty == this.left) {
			return parseInt(this.get_id(pID, this.stylesheet).left);
		} else if (pproperty == this.top) {
			return parseInt(this.get_id(pID, this.stylesheet).top);
		} else if (pproperty == this.width) {
			return parseInt(this.get_id(pID, this.stylesheet).width);
		} else if (pproperty == this.height) {
			return parseInt(this.get_id(pID, this.stylesheet).height);
		} else if (pproperty == this.visibility) {
			hold = this.get_id(pID, this.stylesheet).visibility;
			if (hold == "visible" || hold == "show") {return true;} else {return false;}
		} else if (pproperty == this.html) {
			return this.get_id(pID, this.object).innerHTML;
		}
	}

	this.set = function set(pID, pproperty, pvalue) {
	// developer friendly function for using get_id - abstracts the developer from stylesheet property vs. property of the tag
	// pID: string: name of span/div tag in HTML
	// ptype: number: must be this.object or this.stylesheet
	// returns: nothing // void
		if (!(this.get_id(pID, this.object))) {alert("BUG:Browser.set: Not passed a valid ID of a span/div (case sensitive). I was passed '" + pID + "'.");}
		if ((!pproperty) || ((pproperty < this.left) || (pproperty > this.html))) {alert("BUG:Browser.set: Not passed a valid property. Supports only browser.left, browser.top, browser.width, browser.height, browser.visibility and browser.html. * Case Sensitive *");}

		if (pproperty == this.left) {
			this.get_id(pID, this.stylesheet).left = pvalue;
		} else if (pproperty == this.top) {
			this.get_id(pID, this.stylesheet).top = pvalue;
		} else if (pproperty == this.width) {
			if (this.type == this.N4) {
				alert("BUG:Browser.set: width property cannot be changed in Netscape4. Instead, create another hidden span/div with the new width and use visible to show it (making it look like the original span/div changed width).");
			} else {
				this.get_id(pID, this.stylesheet).width = pwidth;
			}
		} else if (pproperty == this.height) {
			if (this.type == this.N4) {
				alert("BUG:Browser.set: height property cannot be changed in Netscape4. Instead, create another hidden span/div with the new height and use visible to show it (making it look like the original span/div changed height).");
			} else {
				this.get_id(pID, this.stylesheet).height = pheight;
			}
		} else if (pproperty == this.visibility) {
			if (pvalue == true) {
				this.get_id(pID, this.stylesheet).visibility="visible";
			} else {
				this.get_id(pID, this.stylesheet).visibility="hidden";
			}
		} else if (pproperty == this.html) {
			hold = this.get_id(pID, this.object);
			if (this.type == this.N4) {
				hold.document.open();
					hold.document.write(pvalue);
				hold.document.close();
			} else {
				hold.innerHTML = pvalue;
			}
		}
	}
} // end browser class
var browser = new Browser;
// --------------------------------------------------------------------------------------------------------------

function Popup(myUrl,popType) {
	var winName='olb_popup';
	var winTop=50;
	var winLeft=150;
	var d = new Date();
	var winTime = d.getUTCHours()+'_'+d.getUTCMinutes()+'_'+d.getUTCSeconds();

	switch (popType) {
		case 1:   // tools & info/help section - max size pop up, full too bar, resizable, scrollbars
	  	popup = window.open(myUrl,winName+winTime,'width=640,height=480,top=' + winTop + ',left=' + winLeft + ',toolbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,directories=no,status=yes,copyhistory=no');
		break
		case 2:  // olb tool/message  - max pop up size, no tool bar, not resizable, scrolling if necessary
		  popup = window.open(myUrl,winName+winTime,'width=640,height=480,top=' + winTop + ',left=' + winLeft + ',toolbar=no,scrollbars=yes,resizable=no,location=no,menubar=no,directories=no,status=no,copyhistory=no');
		break
		case 3:  // olb tool/message  - smaller pop up size, no tool bar, not resizable, scrolling if necessary
		  popup = window.open(myUrl,winName+winTime,'width=480,height=360,top=' + winTop + ',left=' + winLeft + ',toolbar=no,scrollbars=yes,resizable=no,location=no,menubar=no,directories=no,status=no,copyhistory=no');
		break
		case 4:  // calendars  - smallest pop up size, no tool bar, not resizable, scrolling if necessary
		  popup = window.open(myUrl,winName+winTime,'width=360,height=360,top=' + winTop + ',left=' + winLeft + ',toolbar=no,scrollbars=yes,resizable=no,location=no,menubar=no,directories=no,status=no,copyhistory=no');
		break
		case 5:  // popups within popups  - smallest pop up size, no tool bar, not resizable, scrolling if necessary
			winTop=100;
			winLeft=200;
	  	popup = window.open(myUrl,winName+winTime,'width=640,height=480,top=' + winTop + ',left=' + winLeft + ',toolbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,directories=no,status=no,copyhistory=no');
		break
	}

	popup.focus();

}

function selectAll(formname,checkType) {
	var idx, theCheckbox;
	idx = 0;
	theCheckbox = eval("document." + formname + "." + checkType + idx);
	while (typeof(theCheckbox) == "object")
	{
		theCheckbox.checked = true
		idx++;
		theCheckbox = eval("document." + formname + "." + checkType + idx);
	}

}

function clearAll(formname,checkType) {
	var idx, theCheckbox;
	idx = 0;
	theCheckbox = eval("document." + formname + "." + checkType + idx);
	while (typeof(theCheckbox) == "object")
	{
		theCheckbox.checked = false
		idx++;
		theCheckbox = eval("document." + formname + "." + checkType + idx);
	}
}

function changeAll(formname,checkType,ifChecked) {
	var idx, theCheckbox;

	if (eval(ifChecked)) {
		idx = 0;
		theCheckbox = eval("document." + formname + "." + checkType + idx);
		while (typeof(theCheckbox) == "object")
		{
			theCheckbox.checked = true
			idx++;
			theCheckbox = eval("document." + formname + "." + checkType + idx);
		}
	} else {
		idx = 0;
		theCheckbox = eval("document." + formname + "." + checkType + idx);
		while (typeof(theCheckbox) == "object")
		{
			theCheckbox.checked = false
			idx++;
			theCheckbox = eval("document." + formname + "." + checkType + idx);
		}
	}
}

function resetMe() {
	document.form1.reset();
}

function goHere(loc) {
	this.location.href=loc;
}


function filter (imagename, objectsrc) {
	if (document.images) {
	document.images[imagename].src=eval(objectsrc+".src")
	}
}


/* main tab rolloves */

if (document.images) {
	finsum = new Image;
	finsum_on = new Image;
	billpay = new Image;
	billpay_on = new Image;
	transfers = new Image;
	transfers_on = new Image;
	messcent = new Image;
	messcent_on = new Image;
	persinfo = new Image;
	persinfo_on = new Image;
	accnts = new Image;
	accnts_on = new Image;
	invest = new Image;
	invest_on = new Image;
	mortlons = new Image;
	mortlons_on = new Image;

	finsum.src = "../../images/fr/finsum.gif";
	finsum_on.src = "../../images/fr/finsum_on.gif";

	billpay.src = "../../images/fr/billpay.gif";
	billpay_on.src = "../../images/fr/billpay_on.gif";

	transfers.src = "../../images/fr/transfers.gif";
	transfers_on.src = "../../images/fr/transfers_on.gif";

	messcent.src = "../../images/fr/messcent.gif";
	messcent_on.src = "../../images/fr/messcent_on.gif";

	persinfo.src = "../../images/fr/persinfo.gif";
	persinfo_on.src = "../../images/fr/persinfo_on.gif";

	accnts.src = "../../images/fr/accnts.gif";
	accnts_on.src = "../../images/fr/accnts_on.gif";

	invest.src = "../../images/fr/invest.gif";
	invest_on.src = "../../images/fr/invest_on.gif";

	mortlons.src = "../../images/fr/mortlons.gif";
	mortlons_on.src = "../../images/fr/mortlons_on.gif";

/* finsum tab rollovers */

	finsum_mysum = new Image;
	finsum_mysum_on = new Image;
	finsum_viewacc = new Image;
	finsum_viewacc_on = new Image;
	finsum_download = new Image;
	finsum_download_on = new Image;
	finsum_modify = new Image;
	finsum_modify_on = new Image;
	finsum_tracker = new Image;
	finsum_tracker_on = new Image;

	finsum_mysum.src = "../../images/fr/finsum_mysum.gif";
	finsum_mysum_on.src = "../../images/fr/finsum_mysum_on.gif";

	finsum_viewacc.src = "../../images/fr/finsum_viewacc.gif";
	finsum_viewacc_on.src = "../../images/fr/finsum_viewacc_on.gif";

	finsum_download.src = "../../images/fr/finsum_download.gif";
	finsum_download_on.src = "../../images/fr/finsum_download_on.gif";

	finsum_modify.src = "../../images/fr/finsum_modify.gif";
	finsum_modify_on.src = "../../images/fr/finsum_modify_on.gif";

	finsum_tracker.src = "../../images/fr/finsum_tracker.gif";
	finsum_tracker_on.src = "../../images/fr/finsum_tracker_on.gif";

/* billpay tab rollovers */

	billpay_pay = new Image;
	billpay_pay_on = new Image;
	billpay_view = new Image;
	billpay_view_on = new Image;
	billpay_modify = new Image;
	billpay_modify_on = new Image;
	billpay_investigate = new Image;
	billpay_investigate_on = new Image;
	billpay_listdel = new Image;
	billpay_listdel_on = new Image;
	billpay_history = new Image;
	billpay_history_on = new Image;

	billpay_pay.src = "../../images/fr/billpay_pay.gif";
	billpay_pay_on.src = "../../images/fr/billpay_pay_on.gif";

	billpay_view.src = "../../images/fr/billpay_view.gif";
	billpay_view_on.src = "../../images/fr/billpay_view_on.gif";

	billpay_modify.src = "../../images/fr/billpay_modify.gif";
	billpay_modify_on.src = "../../images/fr/billpay_modify_on.gif";

	billpay_investigate.src = "../../images/fr/billpay_investigate.gif";
	billpay_investigate_on.src = "../../images/fr/billpay_investigate_on.gif";

	billpay_listdel.src = "../../images/fr/billpay_listdel.gif";
	billpay_listdel_on.src = "../../images/fr/billpay_listdel_on.gif";

	billpay_history.src = "../../images/fr/billpay_history.gif";
	billpay_history_on.src = "../../images/fr/billpay_history_on.gif";

/* transfers tab rollovers */

	transfers_account = new Image;
	transfers_account_on = new Image;
	transfers_advance = new Image;
	transfers_advance_on = new Image;
	transfers_email = new Image;
	transfers_email_on = new Image;
	transfers_usdollar = new Image;
	transfers_usdollar_on = new Image;
	transfers_recurring = new Image;
	transfers_recurring_on = new Image;
	transfers_history = new Image;
	transfers_history_on = new Image;

	transfers_account.src = "../../images/fr/transfers_account.gif";
	transfers_account_on.src = "../../images/fr/transfers_account_on.gif";

	transfers_advance.src = "../../images/fr/transfers_advance.gif";
	transfers_advance_on.src = "../../images/fr/transfers_advance_on.gif";

	transfers_email.src = "../../images/fr/transfers_email.gif";
	transfers_email_on.src = "../../images/fr/transfers_email_on.gif";

	transfers_usdollar.src = "../../images/fr/transfers_usdollar.gif";
	transfers_usdollar_on.src = "../../images/fr/transfers_usdollar_on.gif";

	transfers_recurring.src = "../../images/fr/transfers_recurring.gif";
	transfers_recurring_on.src = "../../images/fr/transfers_recurring_on.gif";

	transfers_history.src = "../../images/fr/transfers_history.gif";
	transfers_history_on.src = "../../images/fr/transfers_history_on.gif";

/* message center tab rollovers */

	messcent_messages = new Image;
	messcent_messages_on = new Image;
	messcent_history = new Image;
	messcent_history_on = new Image;
	messcent_contactus = new Image;
	messcent_contactus_on = new Image;

	messcent_messages.src = "../../images/fr/messcent_messages.gif";
	messcent_messages_on.src = "../../images/fr/messcent_messages_on.gif";

	messcent_history.src = "../../images/fr/messcent_history.gif";
	messcent_history_on.src = "../../images/fr/messcent_history_on.gif";

	messcent_contactus.src = "../../images/fr/messcent_contactus.gif";
	messcent_contactus_on.src = "../../images/fr/messcent_contactus_on.gif";

/* personal information center tab rollovers */

	persinfo_view = new Image;
	persinfo_view_on = new Image;
	persinfo_change = new Image;
	persinfo_change_on = new Image;
	persinfo_password = new Image;
	persinfo_password_on = new Image;

	persinfo_view.src = "../../images/fr/persinfo_view.gif";
	persinfo_view_on.src = "../../images/fr/persinfo_view_on.gif";

	persinfo_change.src = "../../images/fr/persinfo_change.gif";
	persinfo_change_on.src = "../../images/fr/persinfo_change_on.gif";

	persinfo_password.src = "../../images/fr/persinfo_password.gif";
	persinfo_password_on.src = "../../images/fr/persinfo_password_on.gif";

/* account & plans tab rollovers */

	accnts_myacc = new Image;
	accnts_myacc_on = new Image;
	accnts_order = new Image;
	accnts_order_on = new Image;
	accnts_open = new Image;
	accnts_open_on = new Image;
	accnts_foreign = new Image;
	accnts_foreign_on = new Image;
	accnts_stop = new Image;
	accnts_stop_on = new Image;
	accnts_consolidate = new Image;
	accnts_consolidate_on = new Image;
	accnts_firstbank = new Image;
	accnts_firstbank_on = new Image;

	accnts_myacc.src = "../../images/fr/accnts_myacc.gif";
	accnts_myacc_on.src = "../../images/fr/accnts_myacc_on.gif";

	accnts_order.src = "../../images/fr/accnts_order.gif";
	accnts_order_on.src = "../../images/fr/accnts_order_on.gif";

	accnts_open.src = "../../images/fr/accnts_open.gif";
	accnts_open_on.src = "../../images/fr/accnts_open_on.gif";

	accnts_foreign.src = "../../images/fr/accnts_foreign.gif";
	accnts_foreign_on.src = "../../images/fr/accnts_foreign_on.gif";

	accnts_stop.src = "../../images/fr/accnts_stop.gif";
	accnts_stop_on.src = "../../images/fr/accnts_stop_on.gif";

	accnts_consolidate.src = "../../images/fr/accnts_consolidate.gif";
	accnts_consolidate_on.src = "../../images/fr/accnts_consolidate_on.gif";

	accnts_firstbank.src = "../../images/fr/accnts_firstbank.gif";
	accnts_firstbank_on.src = "../../images/fr/accnts_firstbank_on.gif";

/* investments tab rollovers */

	invest_myinvest = new Image;
	invest_myinvest_on = new Image;
	invest_gic = new Image;
	invest_gic_on = new Image;
	invest_rrsp = new Image;
	invest_rrsp_on = new Image;
	invest_resp = new Image;
	invest_resp_on = new Image;
	invest_rrif = new Image;
	invest_rrif_on = new Image;
	invest_applications = new Image;
	invest_applications_on = new Image;
	invest_investorline = new Image;
	invest_investorline_on = new Image;
	invest_nesbitt = new Image;
	invest_nesbitt_on = new Image;

	invest_myinvest.src = "../../images/fr/invest_myinvest.gif";
	invest_myinvest_on.src = "../../images/fr/invest_myinvest_on.gif";

	invest_gic.src = "../../images/fr/invest_gic.gif";
	invest_gic_on.src = "../../images/fr/invest_gic_on.gif";

	invest_rrsp.src = "../../images/fr/invest_rrsp.gif";
	invest_rrsp_on.src = "../../images/fr/invest_rrsp_on.gif";

	invest_resp.src = "../../images/fr/invest_resp.gif";
	invest_resp_on.src = "../../images/fr/invest_resp_on.gif";

	invest_rrif.src = "../../images/fr/invest_rrif.gif";
	invest_rrif_on.src = "../../images/fr/invest_rrif_on.gif";

	invest_applications.src = "../../images/fr/invest_applications.gif";
	invest_applications_on.src = "../../images/fr/invest_applications_on.gif";

	invest_investorline.src = "../../images/fr/invest_investorline.gif";
	invest_investorline_on.src = "../../images/fr/invest_investorline_on.gif";

	invest_nesbitt.src = "../../images/fr/invest_nesbitt.gif";
	invest_nesbitt_on.src = "../../images/fr/invest_nesbitt_on.gif";

/* mortgages & loans tab rollovers */

	mortlons_myholdings = new Image;
	mortlons_myholdings_on = new Image;
	mortlons_lumpsum = new Image;
	mortlons_lumpsum_on = new Image;
	mortlons_increase = new Image;
	mortlons_increase_on = new Image;
	mortlons_skip = new Image;
	mortlons_skip_on = new Image;
	mortlons_applications = new Image;
	mortlons_applications_on = new Image;

	mortlons_myholdings.src = "../../images/fr/mortlons_myholdings.gif";
	mortlons_myholdings_on.src = "../../images/fr/mortlons_myholdings_on.gif";

	mortlons_lumpsum.src = "../../images/fr/mortlons_lumpsum.gif";
	mortlons_lumpsum_on.src = "../../images/fr/mortlons_lumpsum_on.gif";

	mortlons_increase.src = "../../images/fr/mortlons_increase.gif";
	mortlons_increase_on.src = "../../images/fr/mortlons_increase_on.gif";

	mortlons_skip.src = "../../images/fr/mortlons_skip.gif";
	mortlons_skip_on.src = "../../images/fr/mortlons_skip_on.gif";

	mortlons_applications.src = "../../images/fr/mortlons_applications.gif";
	mortlons_applications_on.src = "../../images/fr/mortlons_applications_on.gif";

/* public rollovers */

	public_chinese = new Image;
	public_chinese_on = new Image;

	home = new Image;
	home_on = new Image;
	accountsandplans = new Image;
	accountsandplans_on = new Image;
	mortgages = new Image;
	mortgages_on = new Image;
	loansandcreditcards = new Image;
	loansandcreditcards_on = new Image;
	investments = new Image;
	investments_on = new Image;
	insurance = new Image;
	insurance_on = new Image;
	onlinebanking = new Image;
	onlinebanking_on = new Image;
	rates = new Image;
	rates_on = new Image;

	public_chinese.src = "../public/images/fr/public_chinese.gif";
	public_chinese_on.src = "../public/images/fr/public_chinese_on.gif";

	home.src = "../public/images/fr/home_off.gif";
	home_on.src = "../public/images/fr/home_on.gif";

	accountsandplans.src = "../public/images/fr/accountsandplans_off.gif";
	accountsandplans_on.src = "../public/images/fr/accountsandplans_on.gif";

	mortgages.src = "../public/images/fr/mortgages_off.gif";
	mortgages_on.src = "../public/images/fr/mortgages_on.gif";

	loansandcreditcards.src = "../public/images/fr/loansandcreditcards_off.gif";
	loansandcreditcards_on.src = "../public/images/fr/loansandcreditcards_on.gif";

	investments.src = "../public/images/fr/investments_off.gif";
	investments_on.src = "../public/images/fr/investments_on.gif";

	insurance.src = "../public/images/fr/insurance_off.gif";
	insurance_on.src = "../public/images/fr/insurance_on.gif";

	onlinebanking.src = "../public/images/fr/onlinebanking_off.gif";
	onlinebanking_on.src = "../public/images/fr/onlinebanking_on.gif";

	rates.src = "../public/images/fr/rates_off.gif";
	rates_on.src = "../public/images/fr/rates_on.gif";

/* onlinebanking rollovers */

	onlinebanking_signin = new Image;
	onlinebanking_signin_on = new Image;
	onlinebanking_takeatour = new Image;
	onlinebanking_takeatour_on = new Image;
	onlinebanking_faqs = new Image;
	onlinebanking_faqs_on = new Image;
	onlinebanking_registernow = new Image;
	onlinebanking_registernow_on = new Image;
	onlinebanking_securitytips = new Image;
	onlinebanking_securitytips_on = new Image;
	onlinebanking_technicalrequirements = new Image;
	onlinebanking_technicalrequirements_on = new Image;

	onlinebanking_signin.src = "../public/images/fr/onlinebanking_signin_off.gif";
	onlinebanking_signin_on.src = "../public/images/fr/onlinebanking_signin_on.gif";

	onlinebanking_takeatour.src = "../public/images/fr/onlinebanking_takeatour_off.gif";
	onlinebanking_takeatour_on.src = "../public/images/fr/onlinebanking_takeatour_on.gif";

	onlinebanking_faqs.src = "../public/images/fr/onlinebanking_faqs_off.gif";
	onlinebanking_faqs_on.src = "../public/images/fr/onlinebanking_faqs_on.gif";

	onlinebanking_registernow.src = "../public/images/fr/onlinebanking_registernow_off.gif";
	onlinebanking_registernow_on.src = "../public/images/fr/onlinebanking_registernow_on.gif";

	onlinebanking_securitytips.src = "../public/images/fr/onlinebanking_securitytips_off.gif";
	onlinebanking_securitytips_on.src = "../public/images/fr/onlinebanking_securitytips_on.gif";

	onlinebanking_technicalrequirements.src = "../public/images/fr/onlinebanking_technicalrequirements_off.gif";
	onlinebanking_technicalrequirements_on.src = "../public/images/fr/onlinebanking_technicalrequirements_on.gif";


}

