/* [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','4801',jdecode('5th+Annual+PHP+5K'),jdecode(''),'/4801/index.html','true',[ 
		['PAGE','4852',jdecode('Race+Details'),jdecode(''),'/4801/4852.html','true',[],'',''],
		['PAGE','74152',jdecode('1+Mile+Kids+Fun+Run'),jdecode(''),'/4801/74152.html','true',[],'',''],
		['PAGE','4999',jdecode('Registration'),jdecode(''),'/4801/4999.html','true',[],'',''],
		['PAGE','46952',jdecode('Awards+and+Prizes'),jdecode(''),'/4801/46952.html','true',[],'',''],
		['PAGE','33152',jdecode('Special+Thanks'),jdecode(''),'/4801/33152.html','true',[],'',''],
		['PAGE','63652',jdecode('Course+Map'),jdecode(''),'/4801/63652.html','true',[],'',''],
		['PAGE','31252',jdecode('Directions+and+Hotels'),jdecode(''),'/4801/31252.html','true',[],'',''],
		['PAGE','4936',jdecode('Contacts'),jdecode(''),'/4801/4936.html','true',[],'',''],
		['PAGE','77152',jdecode('2011+Results'),jdecode(''),'/4801/77152.html','true',[],'',''],
		['PAGE','66452',jdecode('2010+Results'),jdecode(''),'/4801/66452.html','true',[],'',''],
		['PAGE','48952',jdecode('2009'),jdecode(''),'/4801/48952.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','50052',jdecode('%21%21%21+2009+Race+Pictures+Link'),jdecode(''),'/4801/50052.html','false',[],'',''],
		['PAGE','4915',jdecode('Links'),jdecode(''),'/4801/4915.html','true',[],'',''],
		['PAGE','16901',jdecode('About+Jackson+County+Christmas+Charities'),jdecode(''),'/4801/16901.html','false',[],'',''],
		['PAGE','35152',jdecode('2009+Race+Details'),jdecode(''),'/4801/35152.html','false',[],'',''],
		['PAGE','35173',jdecode('2009+Registration'),jdecode(''),'/4801/35173.html','false',[],'',''],
		['PAGE','35194',jdecode('2009+Course+Map'),jdecode(''),'/4801/35194.html','false',[],'',''],
		['PAGE','51152',jdecode('Awards+and+Prizes'),jdecode(''),'/4801/51152.html','false',[],'',''],
		['PAGE','40452',jdecode('Contacts'),jdecode(''),'/4801/40452.html','false',[],'',''],
		['PAGE','35236',jdecode('Pictures'),jdecode(''),'/4801/35236.html','false',[],'',''],
		['PAGE','45852',jdecode('About+Sadye%26%23x27%3Bs+Fund'),jdecode(''),'/4801/45852.html','false',[],'',''],
		['PAGE','41352',jdecode('Donors'),jdecode(''),'/4801/41352.html','false',[],'',''],
		['PAGE','35215',jdecode('Links'),jdecode(''),'/4801/35215.html','false',[],'','']
	],'',''],
	['PAGE','34752',jdecode('STAA+Home'),jdecode(''),'/34752.html','false',[],'',''],
	['PAGE','34852',jdecode('Spreading+Hope+5K'),jdecode(''),'/34852.html','false',[],'',''],
	['PAGE','38852',jdecode('Frantic+Frog+Triathlon'),jdecode(''),'/38852.html','false',[],'',''],
	['PAGE','44252',jdecode('STAA5K+Forum'),jdecode(''),'/44252.html','false',[],'','']];
var siteelementCount=31;
theSitetree.topTemplateName='Cosy';
theSitetree.paletteFamily='6E665A';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10401';
theSitetree.graphicsetId='10618';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='D4D1CA';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cosy',
				paletteFamily: 	'6E665A',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10401',
				graphicsetId: 	'10618',
				contentColor: 	'000000',
				contentBGColor: 'D4D1CA',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'977433',
				e_color: 		'5D4016',
				f_color: 		'746C60',
				hasCustomLogo: 	'false',
				contentFontFace:'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: '20110917-105136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35194',
internalId:  '',
customField: '20090914-165042'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34752',
internalId:  '',
customField: '20090804-175255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4999',
internalId:  '',
customField: '20110726-170016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4978',
internalId:  '',
customField: '20090717-122425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74152',
internalId:  '',
customField: '20110726-161937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4852',
internalId:  '',
customField: '20110726-160028'
};
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: '20110726-165245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4936',
internalId:  '',
customField: '20110725-112135'
};
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: '20110915-142035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32652',
internalId:  '',
customField: '20100719-122304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29152',
internalId:  '',
customField: '20100927-225738'
};
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: '20110725-111906'
};
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: '20091030-094138'
};
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: '20110726-161832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48952',
internalId:  '',
customField: '20100916-114929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50052',
internalId:  '',
customField: '20100719-121859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51152',
internalId:  '',
customField: '20091006-175419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63652',
internalId:  '',
customField: '20100809-101549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66452',
internalId:  '',
customField: '20100927-230049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77152',
internalId:  '',
customField: '20110917-105457'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN3EMT';
var companyName   = 'PHP5K.com';
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();
};

