/* [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','1574',jdecode('Home'),jdecode(''),'/1574.html','true',[],'',''],
	['PAGE','41001',jdecode('About+Us'),jdecode(''),'/41001.html','true',[],'',''],
	['PAGE','2901',jdecode('Latest+News'),jdecode(''),'/2901.html','false',[],'',''],
	['PAGE','6901',jdecode('Diary'),jdecode(''),'/6901.html','true',[],'',''],
	['PAGE','1595',jdecode('Where+Are+We%3F'),jdecode(''),'/1595.html','true',[],'',''],
	['PAGE','2927',jdecode('Executive+%26+Officers'),jdecode(''),'/2927.html','true',[],'',''],
	['PAGE','2953',jdecode('Honours+Board'),jdecode(''),'/2953.html','true',[],'',''],
	['PAGE','2501',jdecode('Mens+Fixtures+2009'),jdecode(''),'/2501.html','false',[],'',''],
	['PAGE','12201',jdecode('Ladies+Fixtures+2009'),jdecode(''),'/12201.html','false',[],'',''],
	['PAGE','94212',jdecode('Mens+Fixtures+2010'),jdecode(''),'/94212.html','true',[],'',''],
	['PAGE','94238',jdecode('Ladies+Fixtures+2010'),jdecode(''),'/94238.html','true',[],'',''],
	['PAGE','91712',jdecode('League+Fixtures+2010'),jdecode(''),'/91712.html','true',[],'',''],
	['PAGE','3005',jdecode('League+Fixtures+2009'),jdecode(''),'/3005.html','false',[],'',''],
	['PAGE','3031',jdecode('Club+Competitions+2009'),jdecode(''),'/3031.html','false',[],'',''],
	['PAGE','99912',jdecode('County+%26+National+Comps+2010'),jdecode(''),'/99912.html','true',[],'',''],
	['PAGE','3201',jdecode('County+%26+National+Comps+2009'),jdecode(''),'/3201.html','false',[],'',''],
	['PAGE','98312',jdecode('Club+Competitions+2010'),jdecode(''),'/98312.html','false',[],'',''],
	['PAGE','5701',jdecode('Bar+Rota'),jdecode(''),'/5701.html','true',[],'',''],
	['PAGE','27001',jdecode('Tea+Rota'),jdecode(''),'/27001.html','true',[],'',''],
	['PAGE','2979',jdecode('Roll+of+Honour+2010'),jdecode(''),'/2979.html','true',[],'',''],
	['PAGE','17501',jdecode('Links'),jdecode(''),'/17501.html','true',[],'',''],
	['PAGE','1669',jdecode('Contact'),jdecode(''),'/1669.html','true',[],'',''],
	['PAGE','1616',jdecode('Photo+Gallery'),jdecode(''),'/1616.html','true',[],'',''],
	['PAGE','21701',jdecode('Our+Blog'),jdecode(''),'/21701.html','false',[],'',''],
	['PAGE','1648',jdecode('Guestbook'),jdecode(''),'/1648.html','false',[],'',''],
	['PAGE','36601',jdecode('Dave+Cheeseman+entry+form'),jdecode(''),'/36601.html','false',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Basic';
theSitetree.paletteFamily='2E681F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10828';
theSitetree.graphicsetId='11286';
theSitetree.contentColor='2E681F';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Basic',
				paletteFamily: 	'2E681F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10828',
				graphicsetId: 	'11286',
				contentColor: 	'2E681F',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-0e820b10adb7319d87772c9c3d677320']={
webappId:    '7060',
documentId:  '1616',
internalId:  '0e820b10adb7319d87772c9c3d677320',
customField: 'language:en;country:GB;'
};
webappMappings['7002']=webappMappings['7002-1777']={
webappId:    '7002',
documentId:  '1648',
internalId:  '1777',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-4094']={
webappId:    '7008',
documentId:  '1669',
internalId:  '4094',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1574',
internalId:  '',
customField: '20100902-135221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1595',
internalId:  '',
customField: '20090316-151331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1616',
internalId:  '',
customField: '20090311-140013'
};
webappMappings['7050']=webappMappings['7050-1984']={
webappId:    '7050',
documentId:  '21701',
internalId:  '1984',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1648',
internalId:  '',
customField: '20090324-123327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1669',
internalId:  '',
customField: '20090324-123435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20091001-135610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20090612-131130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99912',
internalId:  '',
customField: '20100831-092833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21701',
internalId:  '',
customField: '20090316-134042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2927',
internalId:  '',
customField: '20091123-092929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20090912-111231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3031',
internalId:  '',
customField: '20100316-153012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3005',
internalId:  '',
customField: '20090908-083012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2979',
internalId:  '',
customField: '20100831-092731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2953',
internalId:  '',
customField: '20100719-084511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100831-092755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20100829-074859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20091001-135743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20090316-121710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27001',
internalId:  '',
customField: '20100823-122558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36601',
internalId:  '',
customField: '20090427-125122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41001',
internalId:  '',
customField: '20100621-112119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91712',
internalId:  '',
customField: '20100824-101653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94212',
internalId:  '',
customField: '20100902-135250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94238',
internalId:  '',
customField: '20100902-135324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98312',
internalId:  '',
customField: '20100829-075102'
};
webappMappings['1501']=webappMappings['1501-9071163']={
webappId:    '1501',
documentId:  '1574',
internalId:  '9071163',
customField: '1501'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEZPB';
var companyName   = 'BOROUGH+GREEN+BOWLS+CLUB+';
var htmlTitle	  = 'BOROUGH+GREEN+BOWLS+CLUB';
var metaKeywords  = 'Bowls%2C+Borough+Green%2C+Kent';
var metaContents  = 'The+home+of+bowls+in+Borough+Green%2C+Kent';
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();
};
