/* [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','41101',jdecode('CF+Kids+Triathlon+Series'),jdecode(''), jdecode('%2F41101.html'), 'true',[],'',''],
	['PAGE','54112',jdecode('October+8+Race+Itinerary'),jdecode(''), jdecode('%2F54112.html'), 'true',[],'',''],
	['PAGE','57712',jdecode('August+Pictures%2FResults'),jdecode(''), jdecode('%2F57712.html'), 'true',[],'',''],
	['PAGE','55512',jdecode('April+Pictures%2F+Results'),jdecode(''), jdecode('%2F55512.html'), 'true',[],'',''],
	['PAGE','45812',jdecode('Kids+Races+Sponsorship'),jdecode(''), jdecode('%2F45812.html'), 'true',[],'',''],
	['PAGE','58312',jdecode('Sponsors'),jdecode(''), jdecode('%2F58312.html'), 'true',[],'',''],
	['PAGE','49112',jdecode('CF+Kids+Tri+Blog'),jdecode(''), jdecode('%2F49112.html'), 'true',[],'',''],
	['PAGE','42312',jdecode('Email+for+Kids'),jdecode(''), jdecode('%2F42312.html'), 'false',[],'',''],
	['PAGE','42812',jdecode('Kids+Age+Groups'),jdecode(''), jdecode('%2F42812.html'), 'false',[],'',''],
	['PAGE','2701',jdecode('Our+Team'),jdecode(''), jdecode('%2F2701.html'), 'true',[],'',''],
	['PAGE','21101',jdecode('Tri+Performance+Testing'),jdecode(''), jdecode('%2F21101%2Findex.html'), 'true',[ 
		['PAGE','21122',jdecode('Prices'),jdecode(''), jdecode('%2F21101%2F21122.html'), 'true',[],'','']
	],'',''],
	['PAGE','23201',jdecode('Search'),jdecode(''), jdecode('%2F23201.html'), 'true',[],'',''],
	['PAGE','2722',jdecode('Camps'),jdecode(''), jdecode('%2F2722.html'), 'false',[],'',''],
	['PAGE','36101',jdecode('Triathlon+Race+Camps'),jdecode(''), jdecode('%2F36101%2Findex.html'), 'false',[ 
		['PAGE','21001',jdecode('Camp+Location'),jdecode(''), jdecode('%2F36101%2F21001.html'), 'false',[],'',''],
		['PAGE','22801',jdecode('Camps+Calendar'),jdecode(''), jdecode('%2F36101%2F22801.html'), 'false',[],'','']
	],'',''],
	['PAGE','38301',jdecode('Race+Camp+Registration'),jdecode(''), jdecode('%2F38301.html'), 'false',[],'',''],
	['PAGE','30801',jdecode('Club+Membership'),jdecode(''), jdecode('%2F30801.html'), 'false',[],'',''],
	['PAGE','36901',jdecode('Member+Clinics'),jdecode(''), jdecode('%2F36901%2Findex.html'), 'false',[ 
		['PAGE','38901',jdecode('Club+Members'),jdecode(''), jdecode('%2F36901%2F38901.html'), 'false',[],'','']
	],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Polo';
theSitetree.paletteFamily='7D0101';
theSitetree.keyvisualId='7507';
theSitetree.keyvisualName='kv_7507.jpg';
theSitetree.fontsetId='16552';
theSitetree.graphicsetId='12188';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'enom',
  product: 'WSCENOSSSLYTC210'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Polo',
				paletteFamily: 	'7D0101',
				keyvisualId: 	'7507',
				keyvisualName: 	'kv_7507.jpg',
				fontsetId: 		'16552',
				graphicsetId: 	'12188',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20110303-065127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2722',
internalId:  '',
customField: '20100222-140600'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '41101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54112',
internalId:  '',
customField: '20111005-060403'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '21001',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20100202-123339'
};
webappMappings['4001']=webappMappings['4001-23072687']={
webappId:    '4001',
documentId:  '21122',
internalId:  '23072687',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20110125-073641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21122',
internalId:  '',
customField: '20100202-123436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20100202-131004'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '23201',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20091222-103757'
};
webappMappings['7008']=webappMappings['7008-3021']={
webappId:    '7008',
documentId:  '30801',
internalId:  '3021',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30801',
internalId:  '',
customField: '20110125-071230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36101',
internalId:  '',
customField: '20100315-071931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36901',
internalId:  '',
customField: '20110125-074311'
};
webappMappings['7008']=webappMappings['7008-3281']={
webappId:    '7008',
documentId:  '38301',
internalId:  '3281',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20100315-062718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20100315-075436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41101',
internalId:  '',
customField: '20110823-070804'
};
webappMappings['7008']=webappMappings['7008-4275']={
webappId:    '7008',
documentId:  '42312',
internalId:  '4275',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42312',
internalId:  '',
customField: '20110110-130620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42812',
internalId:  '',
customField: '20110110-135454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45812',
internalId:  '',
customField: '20110124-113215'
};
webappMappings['7008']=webappMappings['7008-4331']={
webappId:    '7008',
documentId:  '45812',
internalId:  '4331',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-350']={
webappId:    '7050',
documentId:  '49112',
internalId:  '350',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49112',
internalId:  '',
customField: '20110210-062205'
};
webappMappings['1501']=webappMappings['1501-23071714']={
webappId:    '1501',
documentId:  '41101',
internalId:  '23071714',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55512',
internalId:  '',
customField: '20110427-051921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57712',
internalId:  '',
customField: '20110902-090424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58312',
internalId:  '',
customField: '20110615-070052'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN330INF4OD';
var companyName   = 'Tri-Motion+Sports';
var htmlTitle	  = 'Kids+Triathlon+Races+%2Cathletic+development%2Cendurance+camps%2C+youth+Triathletes';
var metaKeywords  = 'Kids+triathlon+races%2C+athletic+development%2Clactate+testing%2Cendurance+camps%2C+youth+Triathletes';
var metaContents  = 'Kids+triathlon+races%2C+athletic+development%2Clactate+testing%2Cendurance+camps%2C+youth+Triathletes';
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();
};

