/* [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','4901',jdecode('Home'),jdecode(''),'/4901.html','true',[],'',''],
	['PAGE','28071',jdecode('Testimonials'),jdecode(''),'/28071.html','true',[],'',''],
	['PAGE','5701',jdecode('Photo+Gallery'),jdecode(''),'/5701/index.html','true',[ 
		['PAGE','9401',jdecode('Cycling'),jdecode(''),'/5701/9401.html','true',[],'','']
	],'',''],
	['PAGE','17215',jdecode('Heart+Rate+Training'),jdecode(''),'/17215.html','true',[],'',''],
	['PAGE','14915',jdecode('Cancer+Survivor+Exercise'),jdecode(''),'/14915.html','true',[],'',''],
	['PAGE','28571',jdecode('Interval+Training'),jdecode(''),'/28571.html','true',[],'',''],
	['PAGE','18515',jdecode('Kim%26%23x27%3Bs+Race+Blog'),jdecode(''),'/18515.html','true',[],'',''],
	['PAGE','27171',jdecode('Guestbook'),jdecode(''),'/27171.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1737';
theSitetree.keyvisualName='blumen.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1737',
				keyvisualName: 	'blumen.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				a_color: 		'003390',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20110602-160714'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100419-142001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28071',
internalId:  '',
customField: '20100815-162508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20100628-170040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28571',
internalId:  '',
customField: '20100811-151840'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '14915',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14915',
internalId:  '',
customField: '20100604-215732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17215',
internalId:  '',
customField: '20110223-210503'
};
webappMappings['7050']=webappMappings['7050-16027']={
webappId:    '7050',
documentId:  '18515',
internalId:  '16027',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18515',
internalId:  '',
customField: '20100611-140226'
};
webappMappings['1002']=webappMappings['1002-27171aendu0inlq3x']={
webappId:    '1002',
documentId:  '27171',
internalId:  '27171aendu0inlq3x',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27171',
internalId:  '',
customField: '20100730-174206'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INLQ3X';
var companyName   = 'Kim+Taylor+Fitness%2C+San+Jose%2C+CA';
var htmlTitle	  = 'Kim+Taylor+Fitness';
var metaKeywords  = 'fitness%2C+health%2C+cycling%2C+coaching%2C+cancer+survivor%2C+cancer%2C+personal+training%2C+cancer+exercise+specialist';
var metaContents  = 'Kim+Taylor+Fitness+can+help+you+gain+better+fitness%2C+whether+you+are+just+starting+out+in+an+exercise+program+or+are+a+seasoned+athlete%21++Kim+specializes+in+working+with+cancer+survivors%2C+as+well+as+cycling+enthusiasts+who+wish+to+improve+their+skills.++ACE-certified+Personal+Trainer+and+Cancer+Exercise+Specialist+and+Level+3+USA+Cycling+Coach.';
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();
};

