/* [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','5001',jdecode('Sprint+Invaders+Home+Page'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','5073',jdecode('Members'),jdecode(''),'/5073.html','true',[],'',''],
	['PAGE','5094',jdecode('Schedule'),jdecode(''),'/5094.html','true',[],'',''],
	['PAGE','5115',jdecode('Results'),jdecode(''),'/5115.html','true',[],'',''],
	['PAGE','22801',jdecode('Photo+Gallery'),jdecode(''),'/22801/index.html','true',[ 
		['PAGE','23412',jdecode('Quincy+Raceways+7%2F19%2F2009'),jdecode(''),'/22801/23412.html','false',[],'','']
	],'',''],
	['PAGE','5501',jdecode('Rules'),jdecode(''),'/5501.html','true',[],'',''],
	['PAGE','7301',jdecode('Points'),jdecode(''),'/7301.html','true',[],'',''],
	['PAGE','25512',jdecode('SIA+Merchandise'),jdecode(''),'/25512.html','true',[],'',''],
	['PAGE','5522',jdecode('Membership+Form'),jdecode(''),'/5522.html','true',[],'',''],
	['PAGE','5136',jdecode('Sponsors+%26+Advertisers'),jdecode(''),'/5136.html','true',[],'',''],
	['PAGE','6701',jdecode('SI+Benevolent+Society'),jdecode(''),'/6701.html','true',[],'',''],
	['PAGE','5052',jdecode('Contact+Us'),jdecode(''),'/5052.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Georgia';
theSitetree.paletteFamily='6080D3';
theSitetree.keyvisualId='5981';
theSitetree.keyvisualName='kv_5981.jpg';
theSitetree.fontsetId='11118';
theSitetree.graphicsetId='11911';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6080D3';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Georgia',
				paletteFamily: 	'6080D3',
				keyvisualId: 	'5981',
				keyvisualName: 	'kv_5981.jpg',
				fontsetId: 		'11118',
				graphicsetId: 	'11911',
				contentColor: 	'FFFFFF',
				contentBGColor: '6080D3',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20100907-183351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20100311-074632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5094',
internalId:  '',
customField: '20100820-025242'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-13600148']={
webappId:    '1501',
documentId:  '5001',
internalId:  '13600148',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5073',
internalId:  '',
customField: '20090527-175532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5115',
internalId:  '',
customField: '20100719-185450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20100131-114003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5522',
internalId:  '',
customField: '20100105-111055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5136',
internalId:  '',
customField: '20100429-154853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100103-135948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20100904-023113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23412',
internalId:  '',
customField: '20090720-030717'
};
webappMappings['7060']=webappMappings['7060-e6c4a5fe11598e1a5488b9954c4798ce']={
webappId:    '7060',
documentId:  '23412',
internalId:  'e6c4a5fe11598e1a5488b9954c4798ce',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20100704-135955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25512',
internalId:  '',
customField: '20090813-151729'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHQH8';
var companyName   = 'Ideal+Ready+Mix+Sprint+Invaders';
var htmlTitle	  = 'Sprint+Invaders+Association';
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();
};
