/* [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','42',jdecode('Home'),jdecode(''),'/42.html','true',[],''],
	['PAGE','81',jdecode('Omnium+Stage+Race'),jdecode(''),'/81/index.html','true',[ 
		['PAGE','141423',jdecode('Tech+Guide'),jdecode(''),'/81/141423.html','true',[],''],
		['PAGE','79512',jdecode('Road+Race+Maps'),jdecode(''),'/81/79512.html','true',[],''],
		['PAGE','80212',jdecode('TT+Course+Map'),jdecode(''),'/81/80212.html','true',[],'']
	],''],
	['PAGE','83712',jdecode('I%26%23x27%3Bm+Riding'),jdecode(''),'/83712.html','true',[],''],
	['PAGE','148134',jdecode('Events+%26+Rides'),jdecode(''),'/148134/index.html','true',[ 
		['PAGE','3781',jdecode('Scheduled+rides'),jdecode(''),'/148134/3781.html','true',[],''],
		['PAGE','99',jdecode('Ride+Routes'),jdecode(''),'/148134/99.html','true',[],''],
		['PAGE','485',jdecode('Road-Batterman'),jdecode(''),'/148134/485.html','true',[],''],
		['PAGE','4163',jdecode('Old+Blewett+Pass'),jdecode(''),'/148134/4163.html','true',[],''],
		['PAGE','543',jdecode('Mountain'),jdecode(''),'/148134/543.html','true',[],''],
		['PAGE','5433',jdecode('Darkside+Ride'),jdecode(''),'/148134/5433.html','true',[],''],
		['PAGE','97323',jdecode('Rally+for+Ed'),jdecode(''),'/148134/97323.html','true',[],''],
		['PAGE','138423',jdecode('Yeti+Ride'),jdecode(''),'/148134/138423.html','true',[],''],
		['PAGE','139523',jdecode('Valentines+Day+Ride'),jdecode(''),'/148134/139523.html','true',[],''],
		['PAGE','139623',jdecode('Club+Social+Events'),jdecode(''),'/148134/139623.html','true',[],''],
		['PAGE','5991',jdecode('City+Bicycle+Route+link'),jdecode(''),'/148134/5991.html','true',[],''],
		['PAGE','2290',jdecode('Event+list'),jdecode(''),'/148134/2290.html','true',[],'']
	],''],
	['PAGE','4713',jdecode('Membership+Application'),jdecode(''),'/4713.html','true',[],''],
	['PAGE','86312',jdecode('Club+Clothes'),jdecode(''),'/86312.html','true',[],''],
	['PAGE','1941',jdecode('links'),jdecode(''),'/1941.html','true',[],''],
	['PAGE','148155',jdecode('About+US'),jdecode(''),'/148155/index.html','true',[ 
		['PAGE','63',jdecode('Club+Newsletter'),jdecode(''),'/148155/63.html','true',[],''],
		['PAGE','114623',jdecode('Mission+Statement'),jdecode(''),'/148155/114623.html','true',[],''],
		['PAGE','72',jdecode('Board+of+Directors'),jdecode(''),'/148155/72.html','true',[],''],
		['PAGE','5695',jdecode('Cycling+Advocacy'),jdecode(''),'/148155/5695.html','true',[],''],
		['PAGE','104723',jdecode('General+Meetings'),jdecode(''),'/148155/104723.html','true',[],''],
		['PAGE','112623',jdecode('Ride+Leaders'),jdecode(''),'/148155/112623.html','true',[],'']
	],'']];
var siteelementCount=29;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='6683B6';
theSitetree.keyvisualId='2469';
theSitetree.keyvisualName='verkehr.jpg';
theSitetree.fontsetId='406';
theSitetree.graphicsetId='461';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Collage',
				paletteFamily: 	'6683B6',
				keyvisualId: 	'2469',
				keyvisualName: 	'verkehr.jpg',
				fontsetId: 		'406',
				graphicsetId: 	'461',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'6683B6',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '42',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112623',
internalId:  '',
customField: '20100407-222934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42',
internalId:  '',
customField: '20100414-072317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63',
internalId:  '',
customField: '20100407-223103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2290',
internalId:  '',
customField: '20100331-141650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81',
internalId:  '',
customField: '20100407-231323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79512',
internalId:  '',
customField: '20090217-121224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80212',
internalId:  '',
customField: '20080502-120211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3781',
internalId:  '',
customField: '20091027-235012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5991',
internalId:  '',
customField: '20070206-165432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5695',
internalId:  '',
customField: '20061114-162722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139523',
internalId:  '',
customField: '20100216-231207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72',
internalId:  '',
customField: '20100407-221031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4713',
internalId:  '',
customField: '20100407-220744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138423',
internalId:  '',
customField: '20100216-230124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97323',
internalId:  '',
customField: '20091109-130407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5433',
internalId:  '',
customField: '20100216-222712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99',
internalId:  '',
customField: '20100407-223525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '485',
internalId:  '',
customField: '20100407-223545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4163',
internalId:  '',
customField: '20060530-165323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '543',
internalId:  '',
customField: '20081126-163939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1941',
internalId:  '',
customField: '20091029-223815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86312',
internalId:  '',
customField: '20100315-181511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104723',
internalId:  '',
customField: '20100407-221706'
};
webappMappings['7050']=webappMappings['7050-12']={
webappId:    '7050',
documentId:  '83712',
internalId:  '12',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83712',
internalId:  '',
customField: '20091028-000057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114623',
internalId:  '',
customField: '20091016-164917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148155',
internalId:  '',
customField: '20100414-071759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148134',
internalId:  '',
customField: '20100405-234613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139623',
internalId:  '',
customField: '20100216-230557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141423',
internalId:  '',
customField: '20100505-115955'
};
var canonHostname = 'cm4all01.west-datacenter.net';
var accountId     = 'AWH010INXFIK';
var companyName   = '+++++Wenatchee+Valley+Velo';
var htmlTitle	  = '+++++Wenatchee+Valley+Velo';
var metaKeywords  = 'Cycling%2C+Road+cycling%2C+Mountain+biking%2C+Wenatchee%2C+Washington+State';
var metaContents  = 'Wenatchee+Valley+Velo+cycling+club+of+Wenatchee+Washington';
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();
};
