/* [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 theSitetree=[ 
	['PAGE','2401',jdecode('strongcoffey.com'),jdecode(''),'/2401.html','true',[],''],
	['PAGE','16501',jdecode('my+story'),jdecode(''),'/16501.html','true',[],''],
	['PAGE','2452',jdecode('how+it+works'),jdecode(''),'/2452.html','true',[],''],
	['PAGE','51215',jdecode('the+double+shot'),jdecode(''),'/51215.html','true',[],''],
	['PAGE','53757',jdecode('smith+college+students'),jdecode(''),'/53757.html','true',[],''],
	['PAGE','42501',jdecode('client+feedback'),jdecode(''),'/42501.html','true',[],''],
	['PAGE','14601',jdecode('locations'),jdecode(''),'/14601.html','true',[],''],
	['PAGE','40501',jdecode('press'),jdecode(''),'/40501.html','true',[],''],
	['PAGE','2536',jdecode('contact'),jdecode(''),'/2536.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='336699';
theSitetree.keyvisualId='1234';
theSitetree.keyvisualName='hantel.jpg';
theSitetree.fontsetId='191';
theSitetree.graphicsetId='230';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Profile',
				paletteFamily: 	'336699',
				keyvisualId: 	'1234',
				keyvisualName: 	'hantel.jpg',
				fontsetId: 		'191',
				graphicsetId: 	'230',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'336699',
				b_color: 		'336699',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20091018-200503'
};
webappMappings['7008']=webappMappings['7008-381']={
webappId:    '7008',
documentId:  '2536',
internalId:  '381',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20090831-215140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20090831-215330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20090617-211747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2536',
internalId:  '',
customField: '20090617-211434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40501',
internalId:  '',
customField: '20080822-174730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20090617-211337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51215',
internalId:  '',
customField: '20090831-215430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53757',
internalId:  '',
customField: '20091108-131626'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10IN3JY2';
var companyName   = 'Strong+Coffey+Personal+Training';
var htmlTitle	  = 'Strong+Coffey+Personal+Training%2C+Northampton%2C+Massachusetts';
var metaKeywords  = 'HEAD+Formerly+obese+Personal+Trainer+Kelly+Coffey+knows+what+it+takes+to+successfully+lose+the+weight+and+keep+it+off.+northampton+mass-based+personal+training+for+real+women+by+Kelly+Coffey+++western+massachusetts+easthampton+montague+sunderland+westhampton+east+longmeadow+springfield+west+springfield+workouts+women+overweight+woman+strength+training+weights+wight+lifting+weight-lifting+weight+loss+weightloss+dieting+diets+healthy+wellbeing+wellness+programs+program+cooley+dickinson+hospital+lesbian+gay+bisexual+cardio+exercise+exercising+gyms+gym+stretching+whole+body+total+beginners+beginner+personal+trainors+trainers+training+workout+buddies+buddy+gastric+bypass+lapband+lap+band+weight+loss+surgery+wls+fitness+universal+health+cardiovascular+certified+acsm+american+college+of+sports+medicine+self-love+selflove+practicing+practice+Im+worth+it+.+%21+help+me+lose+weight+muscles+body+building+femme+butch+kelly+coffey+smith+college+students+faculty+universal+health+fitness+one-on-one+training+grecourt+gate+news+gazette+daily+hampshire+article+fat+girl+leading+the+weigh+weight+how+to+lose+weight+losing+weight+through+exercise+exercising+when+youre+fat+republican+springfield+corporate+wellness+liz+washer+northampton+plus-size+women+fat+women+fat+woman+help+me+lose+weight+overweight+clients+specializing+in+overweight+people+weight+issues+massachusetts+real+women+womans+trainer+womens+trainer+womens+workouts+wokring+out++hartford+connecticut+overweight+weight+problems+fat+people+fat+women+overweight+women+lazy+people+%2FHEAD';
var metaContents  = 'Unique+Personal+Training+in+Western+Massachusetts+and+remotely.+Personal+Trainer+Kelly+Coffey+knows+how+it+feels+to+be+overweight...';
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();
};
