/* [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('Home'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','5286',jdecode('news'),jdecode(''),'/5286.html','true',[],'',''],
	['PAGE','5078',jdecode('About+the+Route'),jdecode(''),'/5078.html','true',[],'',''],
	['PAGE','27201',jdecode('HI+SPEED+PROTESTS'),jdecode(''),'/27201.html','true',[],'',''],
	['PAGE','5260',jdecode('Walk+Programme'),jdecode(''),'/5260.html','true',[],'',''],
	['PAGE','5104',jdecode('About+us'),jdecode(''),'/5104/index.html','true',[ 
		['PAGE','5130',jdecode('History'),jdecode(''),'/5104/5130.html','true',[],'',''],
		['PAGE','5156',jdecode('Committee'),jdecode(''),'/5104/5156.html','true',[],'',''],
		['PAGE','5182',jdecode('Constitution'),jdecode(''),'/5104/5182.html','true',[],'',''],
		['PAGE','5208',jdecode('Becoming+a+member'),jdecode(''),'/5104/5208.html','true',[],'','']
	],'',''],
	['PAGE','18101',jdecode('Chairman%26%23x27%3Bs+Message'),jdecode(''),'/18101.html','true',[],'',''],
	['PAGE','27601',jdecode('FOOTNOTES+-+NEWS'),jdecode(''),'/27601.html','true',[],'',''],
	['PAGE','24101',jdecode('Guide+Book+Sales'),jdecode(''),'/24101.html','true',[],'',''],
	['PAGE','5312',jdecode('Path+%26+Transport+Links'),jdecode(''),'/5312.html','true',[],'',''],
	['PAGE','17001',jdecode('Annual+General+Meeting'),jdecode(''),'/17001.html','true',[],'',''],
	['PAGE','15501',jdecode('Pubs+On+Route'),jdecode(''),'/15501.html','true',[],'',''],
	['PAGE','5364',jdecode('The+Arden+Way'),jdecode(''),'/5364.html','true',[],'',''],
	['PAGE','23201',jdecode('contact'),jdecode(''),'/23201.html','true',[],'',''],
	['PAGE','25501',jdecode('WEATHER+STATION'),jdecode(''),'/25501.html','true',[],'',''],
	['PAGE','11701',jdecode('guestbook'),jdecode(''),'/11701.html','true',[],'',''],
	['PAGE','11727',jdecode('links'),jdecode(''),'/11727.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Wave';
theSitetree.paletteFamily='6EB058';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16368';
theSitetree.graphicsetId='12119';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6EB058';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Wave',
				paletteFamily: 	'6EB058',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16368',
				graphicsetId: 	'12119',
				contentColor: 	'FFFFFF',
				contentBGColor: '6EB058',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'366B24',
				e_color: 		'366B24',
				f_color: 		'366B24',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20100806-210231'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-11701anbt10in3wb7']={
webappId:    '1002',
documentId:  '11701',
internalId:  '11701anbt10in3wb7',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5078',
internalId:  '',
customField: '20091227-211058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5104',
internalId:  '',
customField: '20091108-230533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5130',
internalId:  '',
customField: '20090927-190930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5156',
internalId:  '',
customField: '20091108-230604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5182',
internalId:  '',
customField: '20090928-012237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5208',
internalId:  '',
customField: '20091108-230947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11727',
internalId:  '',
customField: '20090920-134015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5260',
internalId:  '',
customField: '20100817-114927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5286',
internalId:  '',
customField: '20100314-203713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5312',
internalId:  '',
customField: '20100524-145156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20091021-185843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5364',
internalId:  '',
customField: '20100806-210845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20091108-232000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20100606-140113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20100606-141008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24101',
internalId:  '',
customField: '20100806-210542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20100701-121447'
};
webappMappings['1501']=webappMappings['1501-10863555']={
webappId:    '1501',
documentId:  '5001',
internalId:  '10863555',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20100212-193452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20100901-194656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20100901-204648'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3WB7';
var companyName   = 'HEART+OF+ENGLAND+WAY+ASSOCIATION';
var htmlTitle	  = 'HEART+OF+ENGLAND+WAY+ASSOCIATION+-+WALKING';
var metaKeywords  = 'HoEW+Walking+Arden+Heart+Way+England+Walk+Cotswolds+Cannock+Chase+Meriden+Alcester+Henley+in+Arden+Lichfield+Bourton+on+the+Water';
var metaContents  = 'Heart+of+England+Way+100+miles+recreational+walking+route%2C+support+Association+and+walking+group.+From+Cannock+Chase+to+the+Cotswolds%2C+the+Heart+of+England+Way+uses+public+rights+of+way+and+permissive+paths.+There+is+a+complimentary+route+over+26+or+13+miles+called+The+Arden+Way+www.ardenway.org';
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();
};
