/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','2222',jdecode('Registration'),jdecode(''),'/2222.html','true',[],''],
	['PAGE','44801',jdecode('Participant+Lists'),jdecode(''),'/44801.html','true',[],''],
	['PAGE','2264',jdecode('Race+Information'),jdecode(''),'/2264/index.html','true',[ 
		['PAGE','44822',jdecode('Wave+Start+Info'),jdecode(''),'/2264/44822.html','true',[],''],
		['PAGE','20401',jdecode('5K+Fun+Run-Friday'),jdecode(''),'/2264/20401.html','true',[],''],
		['PAGE','20422',jdecode('Mini+Race-Saturday'),jdecode(''),'/2264/20422.html','true',[],''],
		['PAGE','20001',jdecode('Sprint+Race+-+Sunday'),jdecode(''),'/2264/20001.html','true',[],'']
	],''],
	['PAGE','37201',jdecode('Schedule+of+Events'),jdecode(''),'/37201.html','true',[],''],
	['PAGE','37801',jdecode('2010+Expo'),jdecode(''),'/37801.html','true',[],''],
	['PAGE','6801',jdecode('Volunteers'),jdecode(''),'/6801.html','true',[],''],
	['PAGE','2285',jdecode('Sponsors'),jdecode(''),'/2285.html','true',[],''],
	['PAGE','38301',jdecode('Athlete+Race+Photos'),jdecode(''),'/38301.html','true',[],''],
	['PAGE','2243',jdecode('Parking'),jdecode(''),'/2243.html','true',[],''],
	['PAGE','25901',jdecode('Accomodations+%2F+Hotels'),jdecode(''),'/25901.html','true',[],''],
	['PAGE','46901',jdecode('2010+Race+Results'),jdecode(''),'/46901.html','true',[],''],
	['PAGE','18801',jdecode('Prior+Year+Results'),jdecode(''),'/18801/index.html','true',[ 
		['PAGE','24601',jdecode('Archived+Results'),jdecode(''),'/18801/24601.html','true',[],'']
	],''],
	['PAGE','21901',jdecode('Prior+MB+Race+Photos'),jdecode(''),'/21901.html','true',[],''],
	['PAGE','11501',jdecode('Contact+Us'),jdecode(''),'/11501.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Natural';
theSitetree.paletteFamily='A43F21';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='157';
theSitetree.graphicsetId='182';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FCFCF4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Natural',
				paletteFamily: 	'A43F21',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'157',
				graphicsetId: 	'182',
				contentColor: 	'000000',
				contentBGColor: 'FCFCF4',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'A43F21',
				b_color: 		'E76E3E',
				c_color: 		'000000',
				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:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2285',
internalId:  '',
customField: '20100504-084826'
};
webappMappings['7060']=webappMappings['7060-4bd2d05d37fb43fcc22c07609c852afe']={
webappId:    '7060',
documentId:  '21901',
internalId:  '4bd2d05d37fb43fcc22c07609c852afe',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100524-071418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2264',
internalId:  '',
customField: '20100516-192950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2222',
internalId:  '',
customField: '20100520-082723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2243',
internalId:  '',
customField: '20090520-090620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25901',
internalId:  '',
customField: '20100330-124130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20401',
internalId:  '',
customField: '20100518-162340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20422',
internalId:  '',
customField: '20100518-162425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20100512-203934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20100517-181523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18801',
internalId:  '',
customField: '20100103-072716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24601',
internalId:  '',
customField: '20090114-111134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100504-084703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21901',
internalId:  '',
customField: '20090720-064306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37201',
internalId:  '',
customField: '20100520-082744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37801',
internalId:  '',
customField: '20100520-082803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20100524-071409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44822',
internalId:  '',
customField: '20100512-203515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44801',
internalId:  '',
customField: '20100523-151825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46901',
internalId:  '',
customField: '20100524-053604'
};
var canonHostname = 'cm4all.aplus.net';
var accountId     = 'AAPLU0INZ0AI';
var companyName   = '2010+25th+Annual+Madeira+Beach+Mad+Dog+Triathlon';
var htmlTitle	  = '2010+Madeira+Beach+%2F+Mad+Dog+Triathlon';
var metaKeywords  = 'mad+beach%2C+triathlon%2C+florida%2C+race%2C+swim%2C+bike%2C+run%2C+st+pete+mad+dogs%2C+mad+dogs%2C+course%2C+5k+run%2C+sprint%2C+kids%2C+expo%2C+ironman%2C+madeira+beach%2C+pam+brown%2C+fun+run';
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();
};
