/* [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','98',jdecode('Home'),jdecode(''),'/98.html','true',[],'',''],
	['PAGE','20601',jdecode('Opening+hours'),jdecode(''),'/20601.html','true',[],'',''],
	['PAGE','6017',jdecode('Boxing+Fitness'),jdecode(''),'/6017.html','true',[],'',''],
	['PAGE','5934',jdecode('Personal+Training'),jdecode(''),'/5934.html','true',[],'',''],
	['PAGE','7238',jdecode('12+Week+New+Body+MakeOver'),jdecode(''),'/7238.html','true',[],'',''],
	['PAGE','18001',jdecode('Alpha+Male+Challenge'),jdecode(''),'/18001.html','true',[],'',''],
	['PAGE','128',jdecode('Forum'),jdecode(''),'/128.html','true',[],'',''],
	['PAGE','146',jdecode('My+Fitness+friends'),jdecode(''),'/146.html','true',[],'',''],
	['PAGE','5143',jdecode('How+to+Contact+Me'),jdecode(''),'/5143.html','true',[],'',''],
	['PAGE','1202',jdecode('Guestbook'),jdecode(''),'/1202/index.html','true',[ 
		['PAGE','1201',jdecode('Read+Guestbook'),jdecode(''),'/1202/1201.html','true',[],'','']
	],'',''],
	['PAGE','6108',jdecode('Articles'),jdecode(''),'/6108.html','true',[],'',''],
	['PAGE','6117',jdecode('Certifications'),jdecode(''),'/6117.html','true',[],'',''],
	['PAGE','20622',jdecode('Accomplishments'),jdecode(''),'/20622.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Activate';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='2034';
theSitetree.keyvisualName='fitness.jpg';
theSitetree.fontsetId='340';
theSitetree.graphicsetId='391';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='990000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Activate',
				paletteFamily: 	'990000',
				keyvisualId: 	'2034',
				keyvisualName: 	'fitness.jpg',
				fontsetId: 		'340',
				graphicsetId: 	'391',
				contentColor: 	'FFFFFF',
				contentBGColor: '990000',
				a_color: 		'990000',
				b_color: 		'FFFFFF',
				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:  '20601',
internalId:  '',
customField: '20100428-144829'
};
webappMappings['1002']=webappMappings['1002-1202AHW050INXX5Z']={
webappId:    '1002',
documentId:  '1202',
internalId:  '1202AHW050INXX5Z',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '98',
internalId:  '1006',
customField: '1006'
};
webappMappings['1003']=webappMappings['1003-ahw050inxx5z11a9c812b7e']={
webappId:    '1003',
documentId:  '128',
internalId:  'ahw050inxx5z11a9c812b7e',
customField: 'en:US:'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '98',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98',
internalId:  '',
customField: '20100904-143245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6017',
internalId:  '',
customField: '20100720-052919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5934',
internalId:  '',
customField: '20100720-052935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7238',
internalId:  '',
customField: '20100720-053010'
};
webappMappings['1501']=webappMappings['1501-49859']={
webappId:    '1501',
documentId:  '98',
internalId:  '49859',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128',
internalId:  '',
customField: '20070421-012015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146',
internalId:  '',
customField: '20100720-053516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5143',
internalId:  '',
customField: '20100720-053843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1202',
internalId:  '',
customField: '20070418-010318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20070418-010318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6108',
internalId:  '',
customField: '20100720-054057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6117',
internalId:  '',
customField: '20100720-054513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20100104-175730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20622',
internalId:  '',
customField: '20100428-145357'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INXX5Z';
var companyName   = 'Keith+Balbert%2C+CPT';
var htmlTitle	  = 'Keith+Fitness';
var metaKeywords  = 'Personal+Trainer%2C+Fitness+Trainer%2C+Boxing+Fitness%2C+Fitness%2C+Fat+Loss%2C+Weight+Loss%2C+Bodybuilding%2C++Nutrition';
var metaContents  = 'Personal+Trainer%2C+Fitness+Coach%2C+Boxing+Fitness%2C+Fitness%2C+Fat+Loss%2C+Weight+Loss%2C+Bodybuilding%2C+Nutrition';
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();
};
