/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','28401',jdecode('Special+Offers'),jdecode(''),'/28401.html','true',[],'',''],
	['PAGE','652',jdecode('About+us'),jdecode(''),'/652.html','true',[],'',''],
	['PAGE','673',jdecode('The+studio'),jdecode(''),'/673.html','true',[],'',''],
	['PAGE','778',jdecode('Why+train+with+us%3F'),jdecode(''),'/778.html','true',[],'',''],
	['PAGE','715',jdecode('Our+Services'),jdecode(''),'/715.html','true',[],'',''],
	['PAGE','17101',jdecode('Class+Schedule'),jdecode(''),'/17101.html','true',[],'',''],
	['PAGE','757',jdecode('Try+us+for+free%21'),jdecode(''),'/757.html','true',[],'',''],
	['PAGE','32301',jdecode('Location'),jdecode(''),'/32301.html','true',[],'',''],
	['PAGE','736',jdecode('Wellness+Articles'),jdecode(''),'/736.html','true',[],'',''],
	['PAGE','32101',jdecode('Contact+Us'),jdecode(''),'/32101.html','true',[],'',''],
	['PAGE','38801',jdecode('Contact+Fitbodies'),jdecode(''),'/38801.html','false',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='AAA769';
theSitetree.keyvisualId='2450';
theSitetree.keyvisualName='fitness.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='462';
theSitetree.contentColor='2F325F';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'AAA769',
				keyvisualId: 	'2450',
				keyvisualName: 	'fitness.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'462',
				contentColor: 	'2F325F',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'AAA769',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100123-010302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17101',
internalId:  '',
customField: '20100123-010711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20081229-171803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20090701-024041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20090701-063404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '778',
internalId:  '',
customField: '20090701-024102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20100216-004751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20100123-010643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28401',
internalId:  '',
customField: '20100104-155524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38801',
internalId:  '',
customField: '20100123-002739'
};
webappMappings['7008']=webappMappings['7008-51']={
webappId:    '7008',
documentId:  '32101',
internalId:  '51',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32101',
internalId:  '',
customField: '20100104-034410'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '32301',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32301',
internalId:  '',
customField: '20090701-020815'
};
var canonHostname = 'cm1b.dca2.superb.net';
var accountId     = 'ASB030IN2MR2';
var companyName   = 'FITBODIES+Fitness+and+Wellness+Studio';
var htmlTitle	  = 'Coquitlam+Personal+Trainers+Fitbodies+Personal+Fitness+Training+in+Coquitlam%2C+Fitness+Studio+in+Coquitlam+British+Columbia%2C+%28BC%29';
var metaKeywords  = 'personal%2C+trainers%2C+training%2C+coquitlam%2C+trainer%2C+coquitlam+fitness%2C+coquitlam+fitness+training%2C+coquitlam+fitness+trainers%2C+coquitlam+fitness+centre%2C+fitness+trainers+coquitlam%2C+personal+trainers+coquitlam%2C+personal+trainer+coquitlam%2C+coquitlam+fitness+trainers%2C+coquitlam+personal+training%2C+coquitlam+personal+trainers%2C+coquitlam+weight+loss%2C+coquitlam+bootcamp%2C+coquitlam+boot+camp%2C+coquitlam+gym%2C+coquitlam+in+personal+studio+training%2C+fitness+centre+coquitlam%2C+fitness+clubs+in+coquitlam%2C+fitness+workout+program%2C+fitness+workout%2C+Vancouver+fitness%2C+fitness+training%2C+coquitlam+Pilates+classes%2C+Pilates+classes+in+Coquitlam%2C+Pilates%2C+Kick+Boxing%2C+Cardio%2C+Circuit+training%2C+working+out%2C+Coquitlam+fitness%2C+gym%2C+fitness+studio%2C+group+fitness+classes%2C+Tri-Cities+fitness%2C+wellness+classes%2C+lifestyle%2C+fitness+classes%2C+post+rehabilitation%2C+personal+fitness+training+in+Coquitlam%2C+personal+fitness+training%2C+personal+fitness+training+in+Vancouver%2C+personal+fitness+trainer%2C+fitness+instructor%2C+ACE+Certfied+Personal+Trainer%2C+personal+fitness+trainer+in+Coquitlam%2C+interval+training%2C+floor+exercises%2C+mat+exercises%2C+sports+specific+training%2C+sports+rehabilitation%2C+core+conditioning%2C+strength+training%2C+';
var metaContents  = 'Coquitlam+BC+-+personal+fitness+training+studio+in+the+Tri-Cities+%28Vancouver+area%29.+One-on-one+training+in+Coquitlam+with+a+personal+fitness+trainer%2C+Bootcamp%2C+Pilates%2C+Cardio+Kick+Boxing%2C+Circuit+Training+and+post+injury+rehabilitation...';
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();
};
