/* [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','9701',jdecode('Home'),jdecode(''), jdecode('%2F9701.html'), 'true',[],'',''],
	['PAGE','9752',jdecode('SPONSORS'),jdecode(''), jdecode('%2F9752%2Findex.html'), 'true',[ 
		['PAGE','54401',jdecode('2011'),jdecode(''), jdecode('%2F9752%2F54401.html'), 'true',[],'',''],
		['PAGE','32501',jdecode('2010'),jdecode(''), jdecode('%2F9752%2F32501.html'), 'true',[],'',''],
		['PAGE','16101',jdecode('2009'),jdecode(''), jdecode('%2F9752%2F16101.html'), 'true',[],'',''],
		['PAGE','16122',jdecode('2008'),jdecode(''), jdecode('%2F9752%2F16122.html'), 'true',[],'','']
	],'',''],
	['PAGE','9773',jdecode('The+Machine'),jdecode(''), jdecode('%2F9773%2Findex.html'), 'true',[ 
		['PAGE','61001',jdecode('2011'),jdecode(''), jdecode('%2F9773%2F61001.html'), 'true',[],'',''],
		['PAGE','32522',jdecode('2010'),jdecode(''), jdecode('%2F9773%2F32522.html'), 'true',[],'',''],
		['PAGE','16143',jdecode('2009'),jdecode(''), jdecode('%2F9773%2F16143.html'), 'true',[],'',''],
		['PAGE','16164',jdecode('2008'),jdecode(''), jdecode('%2F9773%2F16164.html'), 'true',[],'','']
	],'',''],
	['PAGE','9815',jdecode('RACE+SCHEDULE'),jdecode(''), jdecode('%2F9815%2Findex.html'), 'true',[ 
		['PAGE','54422',jdecode('2011'),jdecode(''), jdecode('%2F9815%2F54422.html'), 'true',[],'',''],
		['PAGE','32543',jdecode('2010'),jdecode(''), jdecode('%2F9815%2F32543.html'), 'true',[],'',''],
		['PAGE','16185',jdecode('2009'),jdecode(''), jdecode('%2F9815%2F16185.html'), 'true',[],'','']
	],'',''],
	['PAGE','24801',jdecode('Race+Results'),jdecode(''), jdecode('%2F24801%2Findex.html'), 'true',[ 
		['PAGE','54443',jdecode('2011'),jdecode(''), jdecode('%2F24801%2F54443.html'), 'true',[],'',''],
		['PAGE','32564',jdecode('2010'),jdecode(''), jdecode('%2F24801%2F32564.html'), 'true',[],'',''],
		['PAGE','24822',jdecode('2009'),jdecode(''), jdecode('%2F24801%2F24822.html'), 'true',[],'',''],
		['PAGE','24843',jdecode('2008'),jdecode(''), jdecode('%2F24801%2F24843.html'), 'true',[],'','']
	],'',''],
	['PAGE','9794',jdecode('PHOTOS'),jdecode(''), jdecode('%2F9794%2Findex.html'), 'true',[ 
		['PAGE','54464',jdecode('Photos+2011'),jdecode(''), jdecode('%2F9794%2F54464.html'), 'true',[],'',''],
		['PAGE','32585',jdecode('Photos+2010'),jdecode(''), jdecode('%2F9794%2F32585.html'), 'true',[],'',''],
		['PAGE','16401',jdecode('LOOR+2009'),jdecode(''), jdecode('%2F9794%2F16401.html'), 'true',[],'',''],
		['PAGE','23801',jdecode('M4SX+2009'),jdecode(''), jdecode('%2F9794%2F23801.html'), 'true',[],'',''],
		['PAGE','23822',jdecode('2009+Race+Photo%26%23x27%3Bs+'),jdecode(''), jdecode('%2F9794%2F23822.html'), 'true',[],'',''],
		['PAGE','16227',jdecode('2008+Photos'),jdecode(''), jdecode('%2F9794%2F16227.html'), 'true',[],'',''],
		['PAGE','9857',jdecode('MISC.+PHOTOS'),jdecode(''), jdecode('%2F9794%2F9857.html'), 'true',[],'','']
	],'',''],
	['PAGE','34501',jdecode('LINKS'),jdecode(''), jdecode('%2F34501.html'), 'true',[],'',''],
	['PAGE','9836',jdecode('RYDER'),jdecode(''), jdecode('%2F9836%2Findex.html'), 'true',[ 
		['PAGE','16422',jdecode('1st+year'),jdecode(''), jdecode('%2F9836%2F16422.html'), 'true',[],'',''],
		['PAGE','47601',jdecode('2nd+Year'),jdecode(''), jdecode('%2F9836%2F47601.html'), 'true',[],'','']
	],'',''],
	['PAGE','16901',jdecode('Guestbook'),jdecode(''), jdecode('%2F16901.html'), 'true',[],'','']];
var siteelementCount=33;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='FC2323';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10587';
theSitetree.graphicsetId='10561';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'FC2323',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10587',
				graphicsetId: 	'10561',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20110813-171144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9752',
internalId:  '',
customField: '20110126-232635'
};
webappMappings['1002']=webappMappings['1002-16901ahw050inl7y3']={
webappId:    '1002',
documentId:  '16901',
internalId:  '16901ahw050inl7y3',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20100224-122324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16122',
internalId:  '',
customField: '20090512-231845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9773',
internalId:  '',
customField: '20090516-144043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16143',
internalId:  '',
customField: '20100224-235511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16164',
internalId:  '',
customField: '20090512-231845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9815',
internalId:  '',
customField: '20101114-004409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16185',
internalId:  '',
customField: '20090514-195434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32543',
internalId:  '',
customField: '20100227-005607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9794',
internalId:  '',
customField: '20090530-131133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20091121-121102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16227',
internalId:  '',
customField: '20100901-092020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9857',
internalId:  '',
customField: '20110203-233650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9836',
internalId:  '',
customField: '20090514-195719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16422',
internalId:  '',
customField: '20100729-165513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20090513-000316'
};
webappMappings['1501']=webappMappings['1501-4552778']={
webappId:    '1501',
documentId:  '9701',
internalId:  '4552778',
customField: '1501'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '9701',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32522',
internalId:  '',
customField: '20110127-000616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20100226-000609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34501',
internalId:  '',
customField: '20110226-225824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24801',
internalId:  '',
customField: '20090516-164549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24822',
internalId:  '',
customField: '20091119-161952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24843',
internalId:  '',
customField: '20090530-130832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20100309-231828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23822',
internalId:  '',
customField: '20090513-165910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32564',
internalId:  '',
customField: '20110123-235755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32585',
internalId:  '',
customField: '20110126-235509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47601',
internalId:  '',
customField: '20100729-170137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54401',
internalId:  '',
customField: '20110226-231654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54422',
internalId:  '',
customField: '20110123-233557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54443',
internalId:  '',
customField: '20110813-174330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54464',
internalId:  '',
customField: '20110813-180032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61001',
internalId:  '',
customField: '20110325-170558'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INL7Y3';
var companyName   = 'R-N-R+Steel+RACING';
var htmlTitle	  = 'R-N-R+Steel+Racing';
var metaKeywords  = 'LOORRs%2C+NORRS%2C+SidexSide%2C+UTV+Racing%2C+Short+course+UTV+racing%2C+CORR%2C+Kawasaki+Tyrex%2C+M4SX%2C+Robert+VanBeekum%2C+%2364%2C+%23664%2C+Lucas+Off+Road+Racing+Series%2C+';
var metaContents  = 'R-N-R+Steel+Racing+is+a+web+site+dedicated+to+Robert+VanBeekums+racing+career+in+the+side+by+side+off+road+industry.';
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();
};

