/* [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','34752',jdecode('STAA+Home'),jdecode(''),'/34752.html','true',[],''],
	['PAGE','4801',jdecode('PHP+5k'),jdecode(''),'/4801/index.html','true',[ 
		['PAGE','4852',jdecode('2009+Race+Details'),jdecode(''),'/4801/4852.html','true',[],''],
		['PAGE','4999',jdecode('2009+Registration'),jdecode(''),'/4801/4999.html','true',[],''],
		['PAGE','31252',jdecode('2009+Course+Map'),jdecode(''),'/4801/31252.html','true',[],''],
		['PAGE','46952',jdecode('Awards+and+Prizes'),jdecode(''),'/4801/46952.html','true',[],''],
		['PAGE','4936',jdecode('Contacts'),jdecode(''),'/4801/4936.html','true',[],''],
		['PAGE','48952',jdecode('%21%21%21+2009+Results+Link'),jdecode(''),'/4801/48952.html','true',[],''],
		['PAGE','50052',jdecode('%21%21%21+2009+Race+Pictures+Link'),jdecode(''),'/4801/50052.html','true',[],''],
		['PAGE','32652',jdecode('2008'),jdecode(''),'/4801/32652.html','true',[],''],
		['PAGE','4978',jdecode('2007'),jdecode(''),'/4801/4978.html','true',[],''],
		['PAGE','29152',jdecode('Pictures'),jdecode(''),'/4801/29152.html','true',[],''],
		['PAGE','33152',jdecode('Donors'),jdecode(''),'/4801/33152.html','true',[],''],
		['PAGE','4915',jdecode('Links'),jdecode(''),'/4801/4915.html','true',[],''],
		['PAGE','16901',jdecode('About+Jackson+County+Christmas+Charities'),jdecode(''),'/4801/16901.html','false',[],'']
	],''],
	['PAGE','34852',jdecode('Spreading+Hope+5K'),jdecode(''),'/34852/index.html','true',[ 
		['PAGE','35152',jdecode('2009+Race+Details'),jdecode(''),'/34852/35152.html','true',[],''],
		['PAGE','35173',jdecode('2009+Registration'),jdecode(''),'/34852/35173.html','true',[],''],
		['PAGE','35194',jdecode('2009+Course+Map'),jdecode(''),'/34852/35194.html','true',[],''],
		['PAGE','51152',jdecode('Awards+and+Prizes'),jdecode(''),'/34852/51152.html','true',[],''],
		['PAGE','40452',jdecode('Contacts'),jdecode(''),'/34852/40452.html','true',[],''],
		['PAGE','35236',jdecode('Pictures'),jdecode(''),'/34852/35236.html','true',[],''],
		['PAGE','45852',jdecode('About+Sadye%26%23x27%3Bs+Fund'),jdecode(''),'/34852/45852.html','true',[],''],
		['PAGE','41352',jdecode('Donors'),jdecode(''),'/34852/41352.html','true',[],''],
		['PAGE','35215',jdecode('Links'),jdecode(''),'/34852/35215.html','true',[],'']
	],''],
	['PAGE','38852',jdecode('Frantic+Frog+Triathlon'),jdecode(''),'/38852.html','true',[],''],
	['PAGE','44252',jdecode('STAA5K+Forum'),jdecode(''),'/44252.html','true',[],'']];
var siteelementCount=27;
theSitetree.topTemplateName='Art';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='1816';
theSitetree.keyvisualName='zeit.jpg';
theSitetree.fontsetId='283';
theSitetree.graphicsetId='352';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='660000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Art',
				paletteFamily: 	'660000',
				keyvisualId: 	'1816',
				keyvisualName: 	'zeit.jpg',
				fontsetId: 		'283',
				graphicsetId: 	'352',
				contentColor: 	'DDDDDD',
				contentBGColor: '660000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'660000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38852',
internalId:  '',
customField: '20090727-121905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20091012-114639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35194',
internalId:  '',
customField: '20090914-165042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34752',
internalId:  '',
customField: '20090804-175255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4999',
internalId:  '',
customField: '20090821-155512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4978',
internalId:  '',
customField: '20090717-122425'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '34752',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4852',
internalId:  '',
customField: '20090821-160136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20090707-154428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35215',
internalId:  '',
customField: '20090717-115817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4915',
internalId:  '',
customField: '20090707-155057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4936',
internalId:  '',
customField: '20090804-150850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34852',
internalId:  '',
customField: '20090914-164910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35152',
internalId:  '',
customField: '20091005-130454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35173',
internalId:  '',
customField: '20090821-162632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33152',
internalId:  '',
customField: '20091006-122913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32652',
internalId:  '',
customField: '20090717-122349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29152',
internalId:  '',
customField: '20091009-100753'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '31252',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31252',
internalId:  '',
customField: '20090902-121759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35236',
internalId:  '',
customField: '20090717-115817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40452',
internalId:  '',
customField: '20091005-130327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41352',
internalId:  '',
customField: '20090916-160844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45852',
internalId:  '',
customField: '20090821-161222'
};
webappMappings['1003']=webappMappings['1003-aendu0in3emt122e1d277a6']={
webappId:    '1003',
documentId:  '44252',
internalId:  'aendu0in3emt122e1d277a6',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44252',
internalId:  '',
customField: '20090803-161956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46952',
internalId:  '',
customField: '20090902-121540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48952',
internalId:  '',
customField: '20090922-100625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50052',
internalId:  '',
customField: '20090923-153251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51152',
internalId:  '',
customField: '20091006-175419'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN3EMT';
var companyName   = 'STAA5k.org';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};
