/* [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','1701',jdecode('Home'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','1752',jdecode('MKMES'),jdecode(''), jdecode('%2F1752.html'), 'true',[],'',''],
	['PAGE','21401',jdecode('Society+Personnel'),jdecode(''), jdecode('%2F21401.html'), 'true',[],'',''],
	['PAGE','29101',jdecode('New+President'),jdecode(''), jdecode('%2F29101.html'), 'true',[],'',''],
	['PAGE','50101',jdecode('Past+Members'),jdecode(''), jdecode('%2F50101%2Findex.html'), 'true',[ 
		['PAGE','33501',jdecode('Ray+Bellchambers'),jdecode(''), jdecode('%2F50101%2F33501.html'), 'true',[],'',''],
		['PAGE','45801',jdecode('Ian+Gilroy'),jdecode(''), jdecode('%2F50101%2F45801.html'), 'true',[],'','']
	],'',''],
	['PAGE','1773',jdecode('Newsletter'),jdecode(''), jdecode('%2F1773%2Findex.html'), 'true',[ 
		['PAGE','31701',jdecode('January+%2F+February'),jdecode(''), jdecode('%2F1773%2F31701.html'), 'true',[],'',''],
		['PAGE','31722',jdecode('July'),jdecode(''), jdecode('%2F1773%2F31722.html'), 'true',[],'',''],
		['PAGE','46101',jdecode('February+2009'),jdecode(''), jdecode('%2F1773%2F46101.html'), 'true',[],'',''],
		['PAGE','55412',jdecode('June+2009'),jdecode(''), jdecode('%2F1773%2F55412.html'), 'true',[],'','']
	],'',''],
	['PAGE','1794',jdecode('News'),jdecode(''), jdecode('%2F1794.html'), 'true',[],'',''],
	['PAGE','1878',jdecode('Events'),jdecode(''), jdecode('%2F1878.html'), 'true',[],'',''],
	['PAGE','14701',jdecode('Society+Photos'),jdecode(''), jdecode('%2F14701.html'), 'true',[],'',''],
	['PAGE','49401',jdecode('Members+Trains'),jdecode(''), jdecode('%2F49401.html'), 'true',[],'',''],
	['PAGE','40101',jdecode('You+Tube+Videos'),jdecode(''), jdecode('%2F40101%2Findex.html'), 'true',[ 
		['PAGE','46801',jdecode('Video+1'),jdecode(''), jdecode('%2F40101%2F46801.html'), 'true',[],'','']
	],'',''],
	['PAGE','44001',jdecode('Birthday+Parties'),jdecode(''), jdecode('%2F44001.html'), 'true',[],'',''],
	['PAGE','3206',jdecode('Guestbook'),jdecode(''), jdecode('%2F3206%2Findex.html'), 'true',[ 
		['PAGE','3201',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F3206%2F3201.html'), 'false',[],'','']
	],'',''],
	['PAGE','18901',jdecode('Membership+Application'),jdecode(''), jdecode('%2F18901.html'), 'true',[],'',''],
	['PAGE','20201',jdecode('Items+For+sale'),jdecode(''), jdecode('%2F20201.html'), 'true',[],'',''],
	['PAGE','20701',jdecode('Sponsors+%2F+Links'),jdecode(''), jdecode('%2F20701.html'), 'true',[],'',''],
	['PAGE','32301',jdecode('Directions'),jdecode(''), jdecode('%2F32301.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='FF7112';
theSitetree.keyvisualId='8818';
theSitetree.keyvisualName='KV_04.swf';
theSitetree.fontsetId='17181';
theSitetree.graphicsetId='12654';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='262626';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Holz',
				paletteFamily: 	'FF7112',
				keyvisualId: 	'8818',
				keyvisualName: 	'KV_04.swf',
				fontsetId: 		'17181',
				graphicsetId: 	'12654',
				contentColor: 	'FFFFFF',
				contentBGColor: '262626',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FF6600',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20091114-211556'
};
webappMappings['1002']=webappMappings['1002-3206anbt10in21lg']={
webappId:    '1002',
documentId:  '3206',
internalId:  '3206anbt10in21lg',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20070621-220840'
};
webappMappings['1501']=webappMappings['1501-2318942']={
webappId:    '1501',
documentId:  '1701',
internalId:  '2318942',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1752',
internalId:  '',
customField: '20091114-210548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1773',
internalId:  '',
customField: '20080323-213723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29101',
internalId:  '',
customField: '20090330-200758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31701',
internalId:  '',
customField: '20080313-151017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3206',
internalId:  '',
customField: '20070621-220840'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '32301',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:false;'
};
webappMappings['7060']=webappMappings['7060-1fd0f8e96d6368e744a95506537d75eb']={
webappId:    '7060',
documentId:  '14701',
internalId:  '1fd0f8e96d6368e744a95506537d75eb',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1794',
internalId:  '',
customField: '20091119-155051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1878',
internalId:  '',
customField: '20100612-221226'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14701',
internalId:  '',
customField: '20090330-201259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20100310-215033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20201',
internalId:  '',
customField: '20091114-212154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20101004-212955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21401',
internalId:  '',
customField: '20091114-210719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31722',
internalId:  '',
customField: '20080712-115520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32301',
internalId:  '',
customField: '20090914-003843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33501',
internalId:  '',
customField: '20091114-210357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20090330-192400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44001',
internalId:  '',
customField: '20090914-004558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45801',
internalId:  '',
customField: '20090330-213929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46101',
internalId:  '',
customField: '20090330-193040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46801',
internalId:  '',
customField: '20090330-185053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49401',
internalId:  '',
customField: '20090330-210525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50101',
internalId:  '',
customField: '20090927-222828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55412',
internalId:  '',
customField: '20090914-002634'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN21LG';
var companyName   = 'MK+Light+Railway';
var htmlTitle	  = 'MK+Light+Railway';
var metaKeywords  = 'mk+light+railway%2C+railway%2C+light+railway%2C++model+engines%2C+5+inch+gauge%2C+3+1%2F2+inch+gauge%2C+Caldecotte%2C+Milton+Keynes%2C+steam+engines%2C+Chris+Rose%2C+Ray+Sweeting%2C+volunteers%2C+fun%2C+MKMES%2C+Milton+Keynes+Model+Engineering+Society';
var metaContents  = 'mk+light+railway%2C+railway%2C+light+railway%2C++model+engines%2C+5+inch+gauge%2C+3+1%2F2+inch+gauge%2C+Caldecotte%2C+Milton+Keynes%2C+steam+engines%2C+volunteers%2C+fun%2C+MKMES%2C+Milton+Keynes+Model+Engineering+Society';
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();
};

