/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var POS_TARGET=8;
var theSitetree=[ 
	['PAGE','21201',jdecode('Home'),jdecode(''),'/21201.html','true',[],'',''],
	['PAGE','3164',jdecode('About+us'),jdecode(''),'/3164/index.html','true',[ 
		['PAGE','3173',jdecode('The+team'),jdecode(''),'/3164/3173.html','true',[],'','']
	],'',''],
	['PAGE','537',jdecode('Current+courses'),jdecode(''),'/537/index.html','true',[ 
		['PAGE','7084',jdecode('Occupational+First+Aid+Level+1'),jdecode(''),'/537/7084.html','true',[],'',''],
		['PAGE','7346',jdecode('Transportation+Endorsement'),jdecode(''),'/537/7346.html','true',[],'',''],
		['PAGE','7355',jdecode('WHMIS'),jdecode(''),'/537/7355.html','true',[],'',''],
		['PAGE','7364',jdecode('Workplace+Emergency+First+Aid'),jdecode(''),'/537/7364.html','true',[],'',''],
		['PAGE','7373',jdecode('Workplace+Standard+First+Aid'),jdecode(''),'/537/7373.html','true',[],'',''],
		['PAGE','7382',jdecode('Marine+First+Aid'),jdecode(''),'/537/7382.html','true',[],'',''],
		['PAGE','7391',jdecode('FoodSafe'),jdecode(''),'/537/7391.html','true',[],'',''],
		['PAGE','18901',jdecode('Red+Cross+Instructor+Courses'),jdecode(''),'/537/18901.html','true',[],'',''],
		['PAGE','7093',jdecode('Standard+First+Aid'),jdecode(''),'/537/7093.html','true',[],'',''],
		['PAGE','7102',jdecode('Emergency+First+Aid'),jdecode(''),'/537/7102.html','true',[],'',''],
		['PAGE','7111',jdecode('CPR-A%2C+-C%2C+-HCP'),jdecode(''),'/537/7111.html','true',[],'',''],
		['PAGE','7138',jdecode('ChildCare+Emergency+First+Aid'),jdecode(''),'/537/7138.html','true',[],'',''],
		['PAGE','7725',jdecode('Wilderness+%26+Remote+First+Aid'),jdecode(''),'/537/7725.html','true',[],'',''],
		['PAGE','3441',jdecode('Special+courses'),jdecode(''),'/537/3441.html','true',[],'','']
	],'',''],
	['PAGE','16001',jdecode('WorkSafe+Education+Partner'),jdecode(''),'/16001/index.html','true',[ 
		['PAGE','16101',jdecode('Joint+Health+and+Safety+Committees'),jdecode(''),'/16001/16101.html','true',[],'',''],
		['PAGE','16122',jdecode('Hazard+Recognition+and+Control'),jdecode(''),'/16001/16122.html','true',[],'',''],
		['PAGE','16143',jdecode('Preventing+and+Investigating+Musculoskeletal+Injury+%28MSI%29'),jdecode(''),'/16001/16143.html','true',[],'',''],
		['PAGE','16164',jdecode('Preventing+Workplace+Violence'),jdecode(''),'/16001/16164.html','true',[],'',''],
		['PAGE','16185',jdecode('Supervisor+Safety+Management'),jdecode(''),'/16001/16185.html','true',[],'','']
	],'',''],
	['PAGE','519',jdecode('Contact'),jdecode(''),'/519/index.html','true',[ 
		['PAGE','6635',jdecode('Office+Location'),jdecode(''),'/519/6635.html','true',[],'',''],
		['PAGE','6769',jdecode('Our+Training+Location'),jdecode(''),'/519/6769.html','true',[],'','']
	],'',''],
	['PAGE','3191',jdecode('Feedback'),jdecode(''),'/3191/index.html','true',[ 
		['PAGE','3264',jdecode('Feedback+%28follow+up+page%29'),jdecode(''),'/3191/3264.html','false',[],'','']
	],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Easy';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='54';
theSitetree.graphicsetId='57';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Easy',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'54',
				graphicsetId: 	'57',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6635',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '6769',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['7008']=webappMappings['7008-9110']={
webappId:    '7008',
documentId:  '3191',
internalId:  '9110',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-1580964']={
webappId:    '1501',
documentId:  '21201',
internalId:  '1580964',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '537',
internalId:  '',
customField: '20100817-182147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7364',
internalId:  '',
customField: '20090210-233655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7382',
internalId:  '',
customField: '20090210-233840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7391',
internalId:  '',
customField: '20090210-232154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7102',
internalId:  '',
customField: '20090210-234319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7111',
internalId:  '',
customField: '20090217-233144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7138',
internalId:  '',
customField: '20090210-234529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7725',
internalId:  '',
customField: '20090401-190125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3441',
internalId:  '',
customField: '20090211-133702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20090210-235312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20100805-221355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3164',
internalId:  '',
customField: '20100323-033540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3173',
internalId:  '',
customField: '20090401-200852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7084',
internalId:  '',
customField: '20090211-102830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7346',
internalId:  '',
customField: '20090211-114151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7355',
internalId:  '',
customField: '20090210-233510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7373',
internalId:  '',
customField: '20090210-233754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7093',
internalId:  '',
customField: '20090211-140832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16122',
internalId:  '',
customField: '20100805-213103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16143',
internalId:  '',
customField: '20090210-235547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16164',
internalId:  '',
customField: '20100805-214240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16185',
internalId:  '',
customField: '20100805-221327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '519',
internalId:  '',
customField: '20090210-235848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6635',
internalId:  '',
customField: '20090210-235923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6769',
internalId:  '',
customField: '20090217-233003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3191',
internalId:  '',
customField: '20100802-205344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3264',
internalId:  '',
customField: '20060324-061630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20100222-172807'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '21201',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21201',
internalId:  '',
customField: '20100817-182211'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN380A';
var companyName   = 'Be+Prepared+-+Trainers+in+First+Aid+Inc.';
var htmlTitle	  = 'Be+Prepared+-+Trainers+in+First+Aid+Inc.';
var metaKeywords  = 'First+Aid+CPR+C.P.R.+Cardio+Pulmonary+Resuscitation+SFA+Standard+First+Aid+EFA+Emergency+AED+Automated+External+Defibrillator+ChildSafe+ChildCare+Red+Cross+Fort+Langley+Abbotsford+Chilliwack+WCB+WorkSafe+BC+Wilderness+Remote+Marine+Accident+Simulation+FA+Attendant+Occupational+Health+and+Safety';
var metaContents  = '';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};
