/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','14401',jdecode('Sherwood+Forest'),jdecode(''),'/14401.html','true',[],'',''],
	['PAGE','2901',jdecode('Heritage+Woodland'),jdecode(''),'/2901.html','true',[],'',''],
	['PAGE','2922',jdecode('Thynghowe'),jdecode(''),'/2922.html','true',[],'',''],
	['PAGE','33171',jdecode('Vikings+of+Sherwood'),jdecode(''),'/33171.html','true',[],'',''],
	['PAGE','4601',jdecode('Events'),jdecode(''),'/4601.html','true',[],'',''],
	['PAGE','4627',jdecode('Articles'),jdecode(''),'/4627.html','true',[],'',''],
	['PAGE','4653',jdecode('History'),jdecode(''),'/4653.html','true',[],'',''],
	['PAGE','26771',jdecode('The+Welbeck+Estate'),jdecode(''),'/26771.html','true',[],'',''],
	['PAGE','36971',jdecode('Lord+Byron+Newstead'),jdecode(''),'/36971.html','true',[],'',''],
	['PAGE','29471',jdecode('The+Dukeries'),jdecode(''),'/29471.html','true',[],'',''],
	['PAGE','13801',jdecode('King%26%23x27%3Bs+Wood+Sherwood'),jdecode(''),'/13801.html','true',[],'',''],
	['PAGE','9201',jdecode('Woodland+Photography'),jdecode(''),'/9201.html','true',[],'',''],
	['PAGE','23229',jdecode('Working+Trees'),jdecode(''),'/23229.html','true',[],'',''],
	['PAGE','23255',jdecode('Robin+Hood'),jdecode(''),'/23255.html','true',[],'',''],
	['PAGE','5401',jdecode('Old+Photographs'),jdecode(''),'/5401.html','true',[],'',''],
	['PAGE','552',jdecode('Favorite+Links'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','9701',jdecode('Woodsmen+%26+Foresters'),jdecode(''),'/9701.html','true',[],'',''],
	['PAGE','20515',jdecode('The+Robin+Hood+Way'),jdecode(''),'/20515.html','true',[],'',''],
	['PAGE','9727',jdecode('Woodland+Businesses'),jdecode(''),'/9727.html','true',[],'',''],
	['PAGE','9753',jdecode('Translations'),jdecode(''),'/9753.html','true',[],'',''],
	['PAGE','10001',jdecode('Regional+Park'),jdecode(''),'/10001.html','true',[],'',''],
	['PAGE','11501',jdecode('contact'),jdecode(''),'/11501.html','true',[],'',''],
	['PAGE','28571',jdecode('Website+Terms+of+Use'),jdecode(''),'/28571.html','true',[],'',''],
	['PAGE','49171',jdecode('Robin+Hood%26%23x27%3Bs+Blog'),jdecode(''),'/49171.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Livinginamerica';
theSitetree.paletteFamily='A7A664';
theSitetree.keyvisualId='6338';
theSitetree.keyvisualName='kv_6338.jpg';
theSitetree.fontsetId='11151';
theSitetree.graphicsetId='11960';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E1E0C5';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Livinginamerica',
				paletteFamily: 	'A7A664',
				keyvisualId: 	'6338',
				keyvisualName: 	'kv_6338.jpg',
				fontsetId: 		'11151',
				graphicsetId: 	'11960',
				contentColor: 	'000000',
				contentBGColor: 'E1E0C5',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100901-163905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20090801-225054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20090330-164740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2922',
internalId:  '',
customField: '20080506-233521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20100516-222934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4627',
internalId:  '',
customField: '20100729-165201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4653',
internalId:  '',
customField: '20090531-202046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20090531-213205'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20090501-122018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20090417-080854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9727',
internalId:  '',
customField: '20090828-135543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9753',
internalId:  '',
customField: '20080501-165955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20090417-082808'
};
webappMappings['1002']=webappMappings['1002-11501anbt10in2qrj']={
webappId:    '1002',
documentId:  '11501',
internalId:  '11501anbt10in2qrj',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20080424-091436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20100719-104316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20100620-202329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20515',
internalId:  '',
customField: '20090518-071950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23229',
internalId:  '',
customField: '20100719-120752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23255',
internalId:  '',
customField: '20100708-230014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26771',
internalId:  '',
customField: '20090531-211847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28571',
internalId:  '',
customField: '20090531-215421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29471',
internalId:  '',
customField: '20090717-201710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33171',
internalId:  '',
customField: '20100424-171910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49171',
internalId:  '',
customField: '20100712-175053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36971',
internalId:  '',
customField: '20100103-151030'
};
webappMappings['7050']=webappMappings['7050-4075']={
webappId:    '7050',
documentId:  '49171',
internalId:  '4075',
customField: 'language:en;country:GB;'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2QRJ';
var companyName   = 'SHERWOOD+FOREST';
var htmlTitle	  = 'SHERWOOD+FOREST';
var metaKeywords  = 'VISITOR+INFORMATION+SHERWOOD+FOREST+HISTORY+ARCHAEOLOGY+MAPS+HERITAGE+WOODLAND+ANCIENT+TREES+ROBIN+HOOD+MAJOR+OAK%2C+NOTTINGHAMSHIRE%2C+SHEERWOOD+FOREST%2C+NOTTINGHAMSHIRE%2C+ENGLAND%2C+ROBIN+HOOD%2C+THE+DUKERIES%2C+MAJOR+OAK%2C+KING+JOHN%2C+CULTURAL+HERITAGE';
var metaContents  = 'VISITOR+INFORMATION+SHERWOOD+FOREST+HISTORY+ARCHAEOLOGY+AND+MAPS+HERITAGE+WOODLAND+AND+ANCIENT+TREES%2C+SHEERWOOD+FOREST%2C+NOTTINGHAMSHIRE%2C+ENGLAND%2C+ROBIN+HOOD%2C+THE+DUKERIES%2C+MAJOR+OAK%2C+KING+JOHN%2C+CULTURAL+HERITAGE';
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();
};
