/* 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, "View a summary of your accounts, see details of each account and download to your personal financial software.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("finsum_mysum", "../finsum/finsum_mysum.html", 88, 38, "A complete listing of all your accounts and dealings with <br>BMO Bank of Montreal.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("finsum_viewacc", "../finsum/finsum_viewacc.jsp", 113, 38, "A detailed look at each of your accounts, viewable by selecting a date range.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("finsum_download", "../finsum/finsum_download.html", 146, 38, "Download your account details from Online Banking to your financial management software.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("finsum_modify", "", 112, 38, "Add or delete any of your <br>BMO Bank of Montreal accounts or holdings.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("finsum_tracker", "../finsum/finsum_tracker.html",121, 38, "Access up-to-date BMO Account Tracker information for all linked accounts.");
	mtopnavs[1][mtopnavs[1].length] = new Topnav("", "", 194, 38, "");
	
	mtopnavs[2][1] = new Topnav("billpay", "../billpay/billpay_pay.jsp", 93, 36, "Pay bills, set up recurring bill payments and manage your list of billers.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_pay", "../billpay/billpay_pay.jsp", 83, 38, "Pay bills now - or set up future payments - quickly and easily. No more cheques, stamps or hassles.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_view", "", 92, 38, "Have your bills delivered online through <i>epost</i> where you can view them in detail.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_modify", "../billpay/billpay_modify_add.jsp", 95, 38, "Add, change or delete a biller from your bill payment list.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_investigate", "", 112, 38, "Send a request for a bill payment investigation.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_listdel", "", 154, 38, "A list of your future-dated bill payments, which you can modify.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("billpay_history", "", 125, 38, "A complete listing of bills that have been paid through Online Banking.");
	mtopnavs[2][mtopnavs[2].length] = new Topnav("", "", 113, 38, "");
	
	mtopnavs[3][1] = new Topnav("transfers", "../transfers/transfers_account.jsp", 90, 36, "Move money between accounts, get a cash advance and send and receive money via Email Money Transfer.<br>");
	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_account", "../transfers/transfers_account.jsp", 83, 38, "Transfer funds between accounts in seconds.");
//	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_advance", "../transfers/transfers_advance.jsp", 83, 38, "Make a cash advance from your line of credit or BMO MasterCardŽ*, directly to your chosen account.");
	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_email", "../transfers/transfers_email.html", 127, 38, "Send and receive money quickly and securely to anyone with an email address and Canadian bank account.");		
//	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_usdollar", "", 87, 38, "Transfer funds between your US Dollar and Canadian Dollar accounts, as well as your US Dollar and US Dollar accounts.");
	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_recurring", "", 95, 38, "Set up fund transfers on a regular basis to cover payments, cheques and more.");
	mtopnavs[3][mtopnavs[3].length] = new Topnav("transfers_history", "", 130, 38, "A complete listing of transfers that have been made through Online Banking.");
	mtopnavs[3][mtopnavs[3].length] = new Topnav("", "", 339, 38, "");			

	mtopnavs[4][1] = new Topnav("messcent", "../messcent/messcent_contactus.html", 87, 36, "Send customer service requests and stay up to date with Online Banking alerts.");
	mtopnavs[4][mtopnavs[4].length] = new Topnav("messcent_messages", "", 90, 38, "Send messages to a Direct Banking Manager for assistance.");
	mtopnavs[4][mtopnavs[4].length] = new Topnav("messcent_history", "", 88, 38, "An archive of all the messages and responses you've received through Online Banking.");
	mtopnavs[4][mtopnavs[4].length] = new Topnav("messcent_contactus", "../messcent/messcent_contactus.html", 100, 38, "Information on how to contact a Direct Banking Manager.");
	mtopnavs[4][mtopnavs[4].length] = new Topnav("", "", 496, 38, "");			
	
	mtopnavs[5][1] = new Topnav("persinfo", "../persinfo/persinfo_change.html", 103, 36, "Manage all your personal information here.");
	mtopnavs[5][mtopnavs[5].length] = new Topnav("persinfo_view", "", 80, 38, "The address we have on file for you, and how to make changes to it.");
	mtopnavs[5][mtopnavs[5].length] = new Topnav("persinfo_change", "../persinfo/persinfo_change.html", 85, 38, "Edit your address, should you move or change details.");
	mtopnavs[5][mtopnavs[5].length] = new Topnav("persinfo_password", "", 94, 38, "Change your password for Online Banking and Telephone Banking.");
	mtopnavs[5][mtopnavs[5].length] = new Topnav("", "", 515, 38, "");
	
	mtopnavs[6][1] = new Topnav("accnts", "../accnts/accnts_order.html", 100, 36, "Manage and view details of your <br>BMO Bank of Montreal accounts and plans. ");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_myacc", "", 87, 38, "An overview of all your accounts and banking activity at a glance.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_order", "../accnts/accnts_order.html", 84, 38, "Order replacement cheques quickly and easily without visiting your branch.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_open", "", 108, 38, "Open a new account from the comfort of your home.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_foreign", "", 153, 38, "Order travellers cheques and foreign currency to be picked up at your branch or delivered by courier right to your door.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_stop", "../accnts/accnts_stop.html", 85, 38, "Put a stop payment on a cheque or pre-authorized debit.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_consolidate", "", 128, 38, "Consolidate your monthly statements to see all your account details in one statement.");
	mtopnavs[6][mtopnavs[6].length] = new Topnav("accnts_firstbank", "", 129, 38, "Link up to 10 accounts to your FirstBank CardŽ to view account activity online.");
	
	mtopnavs[7][1] = new Topnav("invest", "../invest/invest_myinvest.html", 107, 36, "Information and tools to help manage all your <br>BMO Bank of Montreal investments.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_myinvest", "../invest/invest_myinvest.html", 103, 38, "View all your BMO Investments at a glance and access tools and information to make sound investing decisions.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_gic", "", 113, 38, "Manage your non-registered BMO Mutual Funds and BMO Term Investments through this summarized view with access to account details and transaction options.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_rrsp", "", 75, 38, "View a summary of all your Registered Retirement Savings Plan (RRSP) accounts with access to account details, information and tools as well as transaction options.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_resp", "", 75, 38, "All your Registered Education Savings Plan (RESP) accounts can be accessed and managed along with helpful tools and information.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_rrif", "", 72, 38, "Monitor and manage your Registered Retirement Income Fund (RRIF) accounts with access to account details and history.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_investorline", "", 108, 38, "View BMO InvestorLine accounts at a glance.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("invest_nesbitt", "", 119, 38, "View BMO Nesbitt Burns accounts at a glance.");
	mtopnavs[7][mtopnavs[7].length] = new Topnav("", "", 109, 38, "");
	
	mtopnavs[8][1] = new Topnav("mortlons", "../mortlons/mortlons_myholdings.html", 106, 36, "Information and tools to help manage all your <br>BMO Bank of Montreal mortgages and loans.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("mortlons_myholdings", "../mortlons/mortlons_myholdings.html", 83, 38, "A summary of your <br>BMO Bank of Montreal loans, mortgages and credit cards.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("mortlons_lumpsum", "", 141, 38, "Pay down your mortgage principal faster by up to 20% each calendar year.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("mortlons_increase", "", 139, 38, "Increase your regular mortgage payment amount by up to 20% each calendar year.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("mortlons_skip", "", 115, 38, "Skip up to 4 months of mortgage payments (principle and interest) in a calendar year.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("mortlons_applications", "", 130, 38, "Apply for a mortgage, loan or line of credit online.");
	mtopnavs[8][mtopnavs[8].length] = new Topnav("", "", 166, 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>Try it now!</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/en/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/en/" + 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/en/" + id + "_off.gif";
			image_default = "../../images/en/" + 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/en/" + 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/en/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/en/" + 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/en/" + id + "_off.gif";
				image_default = "../../images/en/" + 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/en/" + 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/en/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/en/tour_callout_arrow.gif' width=20 height=32 border=0 alt=''></td>"; }
	
		mcallout_html +=
			  "    <td><img src='../../images/en/tour_callout_title.gif' width=202 height=20 border=0 alt=''><br>"
			+ "		<table width='202' border='0' cellspacing='0' cellpadding='2' bgcolor='#d60000'>"
			+ "		<tr>"
			+ "		    <td>"
			+ "				<table width='198' 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/en/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) - 202 - 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=yes,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=yes,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) {

	chinese = new Image;
	chinese_on = new Image;
	
	chinese.src = "../../images/en/chinese.gif";
	chinese_on.src = "../../images/en/chinese_on.gif";

	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/en/finsum.gif";
	finsum_on.src = "../../images/en/finsum_on.gif";
	
	billpay.src = "../../images/en/billpay.gif";
	billpay_on.src = "../../images/en/billpay_on.gif";
	
	transfers.src = "../../images/en/transfers.gif";
	transfers_on.src = "../../images/en/transfers_on.gif";
	
	messcent.src = "../../images/en/messcent.gif";
	messcent_on.src = "../../images/en/messcent_on.gif";
	
	persinfo.src = "../../images/en/persinfo.gif";
	persinfo_on.src = "../../images/en/persinfo_on.gif";

	accnts.src = "../../images/en/accnts.gif";
	accnts_on.src = "../../images/en/accnts_on.gif";

	invest.src = "../../images/en/invest.gif";
	invest_on.src = "../../images/en/invest_on.gif";

	mortlons.src = "../../images/en/mortlons.gif";
	mortlons_on.src = "../../images/en/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/en/finsum_mysum.gif";
	finsum_mysum_on.src = "../../images/en/finsum_mysum_on.gif";
	
	finsum_viewacc.src = "../../images/en/finsum_viewacc.gif";
	finsum_viewacc_on.src = "../../images/en/finsum_viewacc_on.gif";
	
	finsum_download.src = "../../images/en/finsum_download.gif";
	finsum_download_on.src = "../../images/en/finsum_download_on.gif";
	
	finsum_modify.src = "../../images/en/finsum_modify.gif";
	finsum_modify_on.src = "../../images/en/finsum_modify_on.gif";
	
	finsum_tracker.src = "../../images/en/finsum_tracker.gif";
	finsum_tracker_on.src = "../../images/en/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/en/billpay_pay.gif";
	billpay_pay_on.src = "../../images/en/billpay_pay_on.gif";
	
	billpay_view.src = "../../images/en/billpay_view.gif";
	billpay_view_on.src = "../../images/en/billpay_view_on.gif";

	billpay_modify.src = "../../images/en/billpay_modify.gif";
	billpay_modify_on.src = "../../images/en/billpay_modify_on.gif";
	
	billpay_investigate.src = "../../images/en/billpay_investigate.gif";
	billpay_investigate_on.src = "../../images/en/billpay_investigate_on.gif";
	
	billpay_listdel.src = "../../images/en/billpay_listdel.gif";
	billpay_listdel_on.src = "../../images/en/billpay_listdel_on.gif";
	
	billpay_history.src = "../../images/en/billpay_history.gif";
	billpay_history_on.src = "../../images/en/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/en/transfers_account.gif";
	transfers_account_on.src = "../../images/en/transfers_account_on.gif";
	
	transfers_advance.src = "../../images/en/transfers_advance.gif";
	transfers_advance_on.src = "../../images/en/transfers_advance_on.gif";

	transfers_email.src = "../../images/en/transfers_email.gif";
	transfers_email_on.src = "../../images/en/transfers_email_on.gif";
	
	transfers_usdollar.src = "../../images/en/transfers_usdollar.gif";
	transfers_usdollar_on.src = "../../images/en/transfers_usdollar_on.gif";
	
	transfers_recurring.src = "../../images/en/transfers_recurring.gif";
	transfers_recurring_on.src = "../../images/en/transfers_recurring_on.gif";
	
	transfers_history.src = "../../images/en/transfers_history.gif";
	transfers_history_on.src = "../../images/en/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/en/messcent_messages.gif";
	messcent_messages_on.src = "../../images/en/messcent_messages_on.gif";
	
	messcent_history.src = "../../images/en/messcent_history.gif";
	messcent_history_on.src = "../../images/en/messcent_history_on.gif";

	messcent_contactus.src = "../../images/en/messcent_contactus.gif";
	messcent_contactus_on.src = "../../images/en/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/en/persinfo_view.gif";
	persinfo_view_on.src = "../../images/en/persinfo_view_on.gif";
	
	persinfo_change.src = "../../images/en/persinfo_change.gif";
	persinfo_change_on.src = "../../images/en/persinfo_change_on.gif";

	persinfo_password.src = "../../images/en/persinfo_password.gif";
	persinfo_password_on.src = "../../images/en/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/en/accnts_myacc.gif";
	accnts_myacc_on.src = "../../images/en/accnts_myacc_on.gif";
	
	accnts_order.src = "../../images/en/accnts_order.gif";
	accnts_order_on.src = "../../images/en/accnts_order_on.gif";

	accnts_open.src = "../../images/en/accnts_open.gif";
	accnts_open_on.src = "../../images/en/accnts_open_on.gif";
	
	accnts_foreign.src = "../../images/en/accnts_foreign.gif";
	accnts_foreign_on.src = "../../images/en/accnts_foreign_on.gif";
	
	accnts_stop.src = "../../images/en/accnts_stop.gif";
	accnts_stop_on.src = "../../images/en/accnts_stop_on.gif";
	
	accnts_consolidate.src = "../../images/en/accnts_consolidate.gif";
	accnts_consolidate_on.src = "../../images/en/accnts_consolidate_on.gif";

	accnts_firstbank.src = "../../images/en/accnts_firstbank.gif";
	accnts_firstbank_on.src = "../../images/en/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/en/invest_myinvest.gif";
	invest_myinvest_on.src = "../../images/en/invest_myinvest_on.gif";
	
	invest_gic.src = "../../images/en/invest_gic.gif";
	invest_gic_on.src = "../../images/en/invest_gic_on.gif";

	invest_rrsp.src = "../../images/en/invest_rrsp.gif";
	invest_rrsp_on.src = "../../images/en/invest_rrsp_on.gif";
	
	invest_resp.src = "../../images/en/invest_resp.gif";
	invest_resp_on.src = "../../images/en/invest_resp_on.gif";
	
	invest_rrif.src = "../../images/en/invest_rrif.gif";
	invest_rrif_on.src = "../../images/en/invest_rrif_on.gif";

	invest_applications.src = "../../images/en/invest_applications.gif";
	invest_applications_on.src = "../../images/en/invest_applications_on.gif";
	
	invest_investorline.src = "../../images/en/invest_investorline.gif";
	invest_investorline_on.src = "../../images/en/invest_investorline_on.gif";

	invest_nesbitt.src = "../../images/en/invest_nesbitt.gif";
	invest_nesbitt_on.src = "../../images/en/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/en/mortlons_myholdings.gif";
	mortlons_myholdings_on.src = "../../images/en/mortlons_myholdings_on.gif";
	
	mortlons_lumpsum.src = "../../images/en/mortlons_lumpsum.gif";
	mortlons_lumpsum_on.src = "../../images/en/mortlons_lumpsum_on.gif";

	mortlons_increase.src = "../../images/en/mortlons_increase.gif";
	mortlons_increase_on.src = "../../images/en/mortlons_increase_on.gif";
	
	mortlons_skip.src = "../../images/en/mortlons_skip.gif";
	mortlons_skip_on.src = "../../images/en/mortlons_skip_on.gif";
	
	mortlons_applications.src = "../../images/en/mortlons_applications.gif";
	mortlons_applications_on.src = "../../images/en/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/en/public_chinese.gif";
	public_chinese_on.src = "../public/images/en/public_chinese_on.gif";

	home.src = "../public/images/en/home_off.gif";
	home_on.src = "../public/images/en/home_on.gif";

	accountsandplans.src = "../public/images/en/accountsandplans_off.gif";
	accountsandplans_on.src = "../public/images/en/accountsandplans_on.gif";

	mortgages.src = "../public/images/en/mortgages_off.gif";
	mortgages_on.src = "../public/images/en/mortgages_on.gif";

	loansandcreditcards.src = "../public/images/en/loansandcreditcards_off.gif";
	loansandcreditcards_on.src = "../public/images/en/loansandcreditcards_on.gif";

	investments.src = "../public/images/en/investments_off.gif";
	investments_on.src = "../public/images/en/investments_on.gif";

	insurance.src = "../public/images/en/insurance_off.gif";
	insurance_on.src = "../public/images/en/insurance_on.gif";

	onlinebanking.src = "../public/images/en/onlinebanking_off.gif";
	onlinebanking_on.src = "../public/images/en/onlinebanking_on.gif";

	rates.src = "../public/images/en/rates_off.gif";
	rates_on.src = "../public/images/en/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/en/onlinebanking_signin_off.gif";
	onlinebanking_signin_on.src = "../public/images/en/onlinebanking_signin_on.gif";

	onlinebanking_takeatour.src = "../public/images/en/onlinebanking_takeatour_off.gif";
	onlinebanking_takeatour_on.src = "../public/images/en/onlinebanking_takeatour_on.gif";

	onlinebanking_faqs.src = "../public/images/en/onlinebanking_faqs_off.gif";
	onlinebanking_faqs_on.src = "../public/images/en/onlinebanking_faqs_on.gif";

	onlinebanking_registernow.src = "../public/images/en/onlinebanking_registernow_off.gif";
	onlinebanking_registernow_on.src = "../public/images/en/onlinebanking_registernow_on.gif";

	onlinebanking_securitytips.src = "../public/images/en/onlinebanking_securitytips_off.gif";
	onlinebanking_securitytips_on.src = "../public/images/en/onlinebanking_securitytips_on.gif";

	onlinebanking_technicalrequirements.src = "../public/images/en/onlinebanking_technicalrequirements_off.gif";
	onlinebanking_technicalrequirements_on.src = "../public/images/en/onlinebanking_technicalrequirements_on.gif";
	
}
