/* [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','401',jdecode('Home'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','38901',jdecode('Sponsored+Events'),jdecode(''), jdecode('%2F38901.html'), 'true',[],'',''],
	['PAGE','90269',jdecode('Links+%26+Events'),jdecode(''), jdecode('%2F90269.html'), 'true',[],'',''],
	['PAGE','126845',jdecode('Weekly+Group+Runs'),jdecode(''), jdecode('%2F126845.html'), 'true',[],'',''],
	['PAGE','175956',jdecode('Treadmill+Analysis'),jdecode(''), jdecode('%2F175956.html'), 'true',[],'',''],
	['PAGE','188256',jdecode('Sponsorship+'),jdecode(''), jdecode('%2F188256.html'), 'true',[],'',''],
	['PAGE','494',jdecode('Products'),jdecode(''), jdecode('%2F494%2Findex.html'), 'true',[ 
		['PAGE','515',jdecode('Footwear'),jdecode(''), jdecode('%2F494%2F515.html'), 'true',[],'',''],
		['PAGE','536',jdecode('Apparel'),jdecode(''), jdecode('%2F494%2F536.html'), 'true',[],'',''],
		['PAGE','557',jdecode('Accessories'),jdecode(''), jdecode('%2F494%2F557.html'), 'true',[],'','']
	],'',''],
	['PAGE','174056',jdecode('Westsuits+Rental'),jdecode(''), jdecode('%2F174056.html'), 'true',[],'',''],
	['PAGE','56023',jdecode('Professionals'),jdecode(''), jdecode('%2F56023.html'), 'true',[],'',''],
	['PAGE','234567',jdecode('Ruston+5k++'),jdecode(''), jdecode('%2F234567.html'), 'true',[],'',''],
	['PAGE','219167',jdecode('Lacey+5k+class'),jdecode(''), jdecode('%2F219167.html'), 'true',[],'',''],
	['PAGE','211567',jdecode('Training+Classes'),jdecode(''), jdecode('%2F211567.html'), 'true',[],'',''],
	['PAGE','169656',jdecode('Soldier+1%2F2++Group'),jdecode(''), jdecode('%2F169656%2Findex.html'), 'true',[ 
		['PAGE','171256',jdecode('Registration+form'),jdecode(''), jdecode('%2F169656%2F171256.html'), 'true',[],'','']
	],'',''],
	['PAGE','93540',jdecode('Valentines+5k+NEW%21'),jdecode(''), jdecode('%2F93540%2Findex.html'), 'true',[ 
		['PAGE','94575',jdecode('2010+results'),jdecode(''), jdecode('%2F93540%2F94575.html'), 'true',[],'',''],
		['PAGE','159256',jdecode('2011+indiv+result'),jdecode(''), jdecode('%2F93540%2F159256.html'), 'true',[],'',''],
		['PAGE','159856',jdecode('2011+team+results'),jdecode(''), jdecode('%2F93540%2F159856.html'), 'true',[],'',''],
		['PAGE','225567',jdecode('Register+Form'),jdecode(''), jdecode('%2F93540%2F225567.html'), 'true',[],'','']
	],'',''],
	['PAGE','452',jdecode('Who+we+are%21'),jdecode(''), jdecode('%2F452%2Findex.html'), 'true',[ 
		['PAGE','473',jdecode('The+Team'),jdecode(''), jdecode('%2F452%2F473.html'), 'true',[],'','']
	],'',''],
	['PAGE','578',jdecode('Contact+us'),jdecode(''), jdecode('%2F578%2Findex.html'), 'true',[ 
		['PAGE','38407',jdecode('Map'),jdecode(''), jdecode('%2F578%2F38407.html'), 'true',[],'','']
	],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='3E6E72';
theSitetree.keyvisualId='1747';
theSitetree.keyvisualName='fitness.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='354';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E6E72';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'3E6E72',
				keyvisualId: 	'1747',
				keyvisualName: 	'fitness.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'354',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E6E72',
				a_color: 		'3E6E72',
				b_color: 		'101C1D',
				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:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '38407',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20120123-210221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20111229-222710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56023',
internalId:  '',
customField: '20110818-190210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174056',
internalId:  '',
customField: '20120123-182528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90269',
internalId:  '',
customField: '20120123-185216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20101027-200336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20120123-182644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20101027-202928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20101027-204937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93540',
internalId:  '',
customField: '20120109-131541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159256',
internalId:  '',
customField: '20110214-152742'
};
webappMappings['1501']=webappMappings['1501-4560501']={
webappId:    '1501',
documentId:  '401',
internalId:  '4560501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20120123-185344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20120123-190159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20120112-152351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38407',
internalId:  '',
customField: '20120112-152245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94575',
internalId:  '',
customField: '20100220-010546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '234567',
internalId:  '',
customField: '20120131-123614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126845',
internalId:  '',
customField: '20120123-200434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159856',
internalId:  '',
customField: '20110214-165743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '225567',
internalId:  '',
customField: '20120112-152218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '169656',
internalId:  '',
customField: '20120105-195501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171256',
internalId:  '',
customField: '20120105-195414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '175956',
internalId:  '',
customField: '20120123-182210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '188256',
internalId:  '',
customField: '20120123-182334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '211567',
internalId:  '',
customField: '20111226-185414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '219167',
internalId:  '',
customField: '20111118-222333'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INEE82';
var companyName   = 'Base+work+is+CORE+strength';
var htmlTitle	  = 'www.route16runwalk.com';
var metaKeywords  = 'Gig+Harbor+running+store%2C+Gig+Harbor+walking+shoes%2C+road+racing+in+Gig+Harbor%2C+Gig+Harbor%2C+gig+harbor%2C+tacoma';
var metaContents  = 'running%2C+run%2C+walk%2C+shoes%2C+footwear%2C+track+spikes%2C+apparel%2C+walking%2C+training+groups%2C+gig+harbor%2C+tacoma';
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();
};

