/* [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','43301',jdecode('Notices'),jdecode(''),'43301.html','true',[],'',''],
	['PAGE','14161',jdecode('Beers'),jdecode(''),'14161/index.html','true',[ 
		['PAGE','41201',jdecode('Stafford+Knot'),jdecode(''),'14161/41201.html','true',[],'','']
	],'',''],
	['PAGE','16501',jdecode('Beer+names'),jdecode(''),'16501/index.html','true',[ 
		['PAGE','16601',jdecode('Vote'),jdecode(''),'16501/16601.html','true',[],'','']
	],'',''],
	['PAGE','13901',jdecode('History'),jdecode(''),'13901.html','true',[],'',''],
	['PAGE','10801',jdecode('News'),jdecode(''),'10801/index.html','true',[ 
		['PAGE','20401',jdecode('GBBF+2009'),jdecode(''),'10801/20401.html','true',[],'',''],
		['PAGE','38201',jdecode('Extra+Tour'),jdecode(''),'10801/38201.html','false',[],'',''],
		['PAGE','11001',jdecode('Come+Back'),jdecode(''),'10801/11001.html','true',[],'',''],
		['PAGE','11027',jdecode('Set+in+Stone'),jdecode(''),'10801/11027.html','true',[],'','']
	],'',''],
	['PAGE','19701',jdecode('Your+Stories'),jdecode(''),'19701/index.html','true',[ 
		['PAGE','15201',jdecode('Gets+about'),jdecode(''),'19701/15201.html','true',[],'',''],
		['PAGE','34601',jdecode('Testimonials'),jdecode(''),'19701/34601.html','true',[],'','']
	],'',''],
	['PAGE','5052',jdecode('Tours'),jdecode(''),'5052/index.html','true',[ 
		['PAGE','40101',jdecode('Your+Tour'),jdecode(''),'5052/40101.html','true',[],'','']
	],'',''],
	['PAGE','5401',jdecode('Directions'),jdecode(''),'5401.html','true',[],'',''],
	['PAGE','5601',jdecode('Links'),jdecode(''),'5601.html','true',[],'',''],
	['PAGE','12301',jdecode('Contact+us'),jdecode(''),'12301.html','true',[],'',''],
	['PAGE','18601',jdecode('Marketing+Materials'),jdecode(''),'18601/index.html','true',[ 
		['PAGE','18201',jdecode('Pumpclips'),jdecode(''),'18601/18201.html','true',[],'',''],
		['PAGE','18627',jdecode('Tour+poster'),jdecode(''),'18601/18627.html','true',[],'','']
	],'',''],
	['PAGE','15901',jdecode('Guestbook'),jdecode(''),'15901.html','true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='cutout';
theSitetree.paletteFamily='BEDEB5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.html';
theSitetree.fontsetId='10350';
theSitetree.graphicsetId='10477';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'cutout',
				paletteFamily: 	'BEDEB5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10350',
				graphicsetId: 	'10477',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				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:  '5001',
internalId:  '',
customField: '20091026-112153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20101013-195610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20090930-155739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20101013-200255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20100709-101946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20090112-211600'
};
webappMappings['7008']=webappMappings['7008-3542']={
webappId:    '7008',
documentId:  '12301',
internalId:  '3542',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11027',
internalId:  '',
customField: '20090112-211621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41201',
internalId:  '',
customField: '20091218-161624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20100105-142937'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20090210-141308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14161',
internalId:  '',
customField: '20101013-211933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20091120-103730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20090323-111245'
};
webappMappings['1002']=webappMappings['1002-15901anbt20iner4r']={
webappId:    '1002',
documentId:  '15901',
internalId:  '15901anbt20iner4r',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20090427-120356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38201',
internalId:  '',
customField: '20090928-083944'
};
webappMappings['7005']=webappMappings['7005-139']={
webappId:    '7005',
documentId:  '16601',
internalId:  '139',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20090930-154606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20090427-125630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20090624-203026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20090709-221528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18627',
internalId:  '',
customField: '20090624-210054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20091026-115544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20401',
internalId:  '',
customField: '20090811-112421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34601',
internalId:  '',
customField: '20100208-190047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43301',
internalId:  '',
customField: '20101013-200639'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INER4R';
var companyName   = 'Lymestone+Brewery';
var htmlTitle	  = 'Lymestone+Brewery';
var metaKeywords  = 'lymestone+brewery%2C+brewery%2C+ian+bradford%2C+ron+makins%2C+real+ale%2C+brewery+tours%2C+stone';
var metaContents  = 'Real+Ales+from+Lymestone+Brewery+in+Stone.+Visit+our+website+to+see+everything+you+need+to+know+about+the+brewery.++Please+get+in+touch%2C+it+would+be+great+to+hear+from+you.';
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__%20%2b%20page%2c%20true%2c%20true.html)).toString();
};

