// Define file paths
var PB	= "/personal-banking/";
var BB	= "/business-banking/";
var AS	= "accounts-services/";
var AU	= "/about-us/";
var INFO	= "information/";
var MISC= "/misc/";
var LOC	= "/locations/";

// Header Nav Bar - the global nav bar at the very top of every page
var aHeader		= new Array();			var aHeaderURL	= new Array();

aHeader[0]		= "Home";				aHeaderURL[0]	= "/";

aHeader[1]		= "Online Banking";		aHeaderURL[1]	= PB + AS + "online-banking.aspx";

aHeader[2]		= "Rates";				aHeaderURL[2]	= MISC + "rates.htm";

aHeader[3]		= "Careers";			aHeaderURL[3]	= AU + INFO + "careers.htm";

aHeader[4]		= new Array();			aHeaderURL[4]	= new Array();
aHeader[4][0]	= "Contact Us";			aHeaderURL[4][0]= MISC + "contact-us.htm";


aHeader[5]		= new Array();			aHeaderURL[5]	= new Array();
aHeader[5][0]	= "Locations";			aHeaderURL[5][0]= "";
aHeader[5][1]	= "Branches";			aHeaderURL[5][1]= LOC + "branch-locations.aspx";
aHeader[5][2]	= "Commercial Business";aHeaderURL[5][2]= LOC + "cbc-locations.htm";
aHeader[5][3]	= "Head Office";		aHeaderURL[5][3]= LOC + "head-office.htm";

// added Calcualtors link at top - Aug09
aHeader[6]		= "Calculators";		aHeaderURL[6]	=  PB + "tools/tools-calculators.htm";
// added Media link at top - May09
aHeader[7]		= "Media";				aHeaderURL[7]	= AU + "news/current-news.htm";
// added Members Only
//aHeader[7]		= "Member Benefits";	aHeaderURL[7]	= MISC + "member-benefits.htm";

// Generic function isArray to determine if an object is an array
function isObject(a){ return typeof a == 'object'; }
function isArray(a){ return isObject(a) && a.constructor == Array; }


// HeaderNavBar - put the global horizontal links across the top of every page
// Most calls to this function are simply:
//		HeaderNavBar()	- this makes the label a link to its landing page
//						- this is automatically done within the /includes/header.htm 
// If you are calling this function from an actual Area landing page (like personal-banking.htm)
// you must add the following line AFTER the include call to nav-personal.inc or nav-business.inc
//		<script type="text/javascript" language="javascript">sThisPage = "Page Label";</script>

var sThisPage = "";
var	sLabel = "";
var sURL = "";
function HeaderNavBar( ) {
	var iLastHeader = aHeader.length - 1;
	for (i=0; i <= iLastHeader; i++) {
		if( isArray( aHeader[i] ) ){
			sLabel = aHeader[i][0];
			if( aHeaderURL[i][0] == "" ) sURL = aHeaderURL[i][1];
			else sURL = aHeaderURL[i][0];
		} else {
			sLabel = aHeader[i];	sURL = aHeaderURL[i];
		}
		if( sLabel == sThisPage ) // the current page is the Header landing page - no link
			document.write( '<span class="headerNavCurrent">' + sLabel + '</span>' );
		else  // the current page is NOT the Header landing page - link to the landing page
			document.write( '<a href="' + sURL + '">' + sLabel + '</a>');
		if( i != iLastHeader )document.write( ' &#8226&nbsp;' );
	}
}

// the following is required for the horizontal Area nav bar, accessed in nav-area.js
var sThisArea = "";
