/* [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(''),'/401.html','true',[],'',''],
	['PAGE','662',jdecode('About+us'),jdecode(''),'/662/index.html','true',[ 
		['PAGE','12601',jdecode('Member%26%23x27%3Bs+Profiles'),jdecode(''),'/662/12601.html','true',[],'',''],
		['PAGE','96601',jdecode('Bikers+Creed'),jdecode(''),'/662/96601.html','true',[],'','']
	],'',''],
	['PAGE','704',jdecode('How+to+find+us'),jdecode(''),'/704/index.html','true',[ 
		['PAGE','49601',jdecode('Directions'),jdecode(''),'/704/49601.html','true',[],'','']
	],'',''],
	['PAGE','557',jdecode('Events+Page'),jdecode(''),'/557.html','true',[],'',''],
	['PAGE','97501',jdecode('Mileage+Challenge'),jdecode(''),'/97501/index.html','true',[ 
		['PAGE','97901',jdecode('RULES'),jdecode(''),'/97501/97901.html','true',[],'',''],
		['PAGE','98001',jdecode('LEADER+BOARD'),jdecode(''),'/97501/98001.html','true',[],'','']
	],'',''],
	['PAGE','599',jdecode('+links+Page'),jdecode(''),'/599.html','true',[],'',''],
	['PAGE','121701',jdecode('Club+Links'),jdecode(''),'/121701.html','true',[],'',''],
	['PAGE','5701',jdecode('Downloads'),jdecode(''),'/5701.html','true',[],'',''],
	['PAGE','50601',jdecode('Motorcycle+news'),jdecode(''),'/50601.html','true',[],'',''],
	['PAGE','620',jdecode('For+Sale%2FWanted'),jdecode(''),'/620.html','true',[],'',''],
	['PAGE','14001',jdecode('Bike+%26+Car+Wash'),jdecode(''),'/14001/index.html','true',[ 
		['PAGE','42001',jdecode('Nabd+Rally+2007'),jdecode(''),'/14001/42001.html','true',[],'','']
	],'',''],
	['PAGE','42022',jdecode('Misc.+Pics'),jdecode(''),'/42022.html','true',[],'',''],
	['PAGE','81601',jdecode('Archive'),jdecode(''),'/81601.html','true',[],'',''],
	['PAGE','473',jdecode('Other+Pics'),jdecode(''),'/473/index.html','true',[ 
		['PAGE','536',jdecode('Toy+Run'),jdecode(''),'/473/536.html','true',[],'','']
	],'',''],
	['PAGE','16206',jdecode('Guestbook'),jdecode(''),'/16206/index.html','true',[ 
		['PAGE','16201',jdecode('Read+Guestbook'),jdecode(''),'/16206/16201.html','false',[],'','']
	],'',''],
	['PAGE','641',jdecode('CONTACT+US'),jdecode(''),'/641.html','true',[],'',''],
	['PAGE','105301',jdecode('Webring'),jdecode(''),'/105301.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='FC2323';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10587';
theSitetree.graphicsetId='10561';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'GB'
};
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: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-85744']={
webappId:    '1501',
documentId:  '401',
internalId:  '85744',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-1ea4a0d32a2d99923f5cdd87c53bf3f3']={
webappId:    '7060',
documentId:  '14001',
internalId:  '1ea4a0d32a2d99923f5cdd87c53bf3f3',
customField: 'language:en;country:GB;'
};
webappMappings['1002']=webappMappings['1002-16206anbt10inxstd']={
webappId:    '1002',
documentId:  '16206',
internalId:  '16206anbt10inxstd',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16201',
internalId:  '',
customField: '20061121-092154'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100730-134122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20070519-133048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42001',
internalId:  '',
customField: '20070627-210917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '662',
internalId:  '',
customField: '20100714-165827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12601',
internalId:  '',
customField: '20100714-170319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '704',
internalId:  '',
customField: '20100718-131454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20100730-140627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121701',
internalId:  '',
customField: '20100414-175714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20080506-200320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50601',
internalId:  '',
customField: '20100730-141948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100704-103622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20100722-213908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20100516-134158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20100704-103439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16206',
internalId:  '',
customField: '20061213-175606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '641',
internalId:  '',
customField: '20081209-201901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42022',
internalId:  '',
customField: '20100730-141047'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '49601',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49601',
internalId:  '',
customField: '20090604-215550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81601',
internalId:  '',
customField: '20090218-200650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96601',
internalId:  '',
customField: '20100226-160517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97501',
internalId:  '',
customField: '20091104-192350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97901',
internalId:  '',
customField: '20090311-102238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98001',
internalId:  '',
customField: '20100313-170043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105301',
internalId:  '',
customField: '20090621-183416'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10INXSTD';
var companyName   = 'MID-LIFE+CRISIS+MCC';
var htmlTitle	  = '';
var metaKeywords  = 'MotorCycle+Clubs%2C+Bikes%2C+MCC%2C++Mid-Life+Crisis%2C+Ride+Outs%2C+Clubs%2C+Meets%2C+Harley+V+Metric%2C+Rallies%2C';
var metaContents  = 'MotorBikes%2CThe+Motorcycle+Club%2C+Over+30+or%2C+Join+us+if+you+think+you+are+old+enough%21++Mid-Life+Crisis+MCC%2C+Mid-Life+Crisis+Mcc.org.uk%2C+Bikes+over+500cc%2C+Trikes%2C+Combos';
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();
};
