/* [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','2301',jdecode('Home'),jdecode(''),'/2301.html','true',[],'',''],
	['PAGE','2352',jdecode('About+us'),jdecode(''),'/2352.html','true',[],'',''],
	['PAGE','37701',jdecode('Fixtures+%26+Results'),jdecode(''),'/37701/index.html','true',[ 
		['PAGE','2378',jdecode('2009+Fixtures%2C+Results++%26+Averages'),jdecode(''),'/37701/2378.html','false',[],'',''],
		['PAGE','21801',jdecode('Averages'),jdecode(''),'/37701/21801.html','true',[],'',''],
		['PAGE','43001',jdecode('Farley+Hill+vs+Stratfield+Turgis+%E2%80%93+8th+May+2010'),jdecode(''),'/37701/43001.html','false',[],'',''],
		['PAGE','43601',jdecode('Farley+Hill+vs+Checkendon+%E2%80%93+15th+May+2010'),jdecode(''),'/37701/43601.html','false',[],'',''],
		['PAGE','45001',jdecode('Farley+Hill+vs+Pinkneys+Green+%E2%80%93+22nd+May+2010'),jdecode(''),'/37701/45001.html','false',[],'',''],
		['PAGE','46201',jdecode('Farley+Hill+vs+Shinfield+%E2%80%93+29th+May+2010'),jdecode(''),'/37701/46201.html','false',[],'',''],
		['PAGE','46701',jdecode('Farley+Hill+vs+Ruislip+Victoria+%E2%80%93+5th+June+2010'),jdecode(''),'/37701/46701.html','false',[],'',''],
		['PAGE','47501',jdecode('Farley+Hill+vs+Englefield+-+6th+June+2010'),jdecode(''),'/37701/47501.html','false',[],'',''],
		['PAGE','48601',jdecode('Farley+Hill+vs+Goring+-+12th+June+2010'),jdecode(''),'/37701/48601.html','false',[],'',''],
		['PAGE','49401',jdecode('Farley+Hill+vs+Ibis+Mapledurham+-+19th+June+2010'),jdecode(''),'/37701/49401.html','false',[],'','']
	],'',''],
	['PAGE','2404',jdecode('Contact+us'),jdecode(''),'/2404.html','true',[],'',''],
	['PAGE','2430',jdecode('Photos'),jdecode(''),'/2430.html','true',[],'',''],
	['PAGE','2456',jdecode('Blog'),jdecode(''),'/2456.html','true',[],'',''],
	['PAGE','8501',jdecode('Club+Newsletter'),jdecode(''),'/8501.html','true',[],'',''],
	['PAGE','32601',jdecode('Trophy+Cabinet'),jdecode(''),'/32601/index.html','true',[ 
		['PAGE','32701',jdecode('Player+of+the+Year'),jdecode(''),'/32601/32701.html','true',[],'',''],
		['PAGE','32727',jdecode('1st+XI+Captain%26%23x27%3Bs+Player'),jdecode(''),'/32601/32727.html','true',[],'',''],
		['PAGE','32831',jdecode('2nd+XI+Captain%26%23x27%3Bs+Player'),jdecode(''),'/32601/32831.html','true',[],'',''],
		['PAGE','32753',jdecode('Bill+Streak+Memorial+Trophy'),jdecode(''),'/32601/32753.html','true',[],'',''],
		['PAGE','32779',jdecode('Club+Batting+Award'),jdecode(''),'/32601/32779.html','true',[],'',''],
		['PAGE','32805',jdecode('The+Fred+Luker+Cup'),jdecode(''),'/32601/32805.html','true',[],'',''],
		['PAGE','36501',jdecode('BCL+Awards'),jdecode(''),'/32601/36501.html','true',[],'','']
	],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Sportfan2';
theSitetree.paletteFamily='D4E8AB';
theSitetree.keyvisualId='10139';
theSitetree.keyvisualName='kv_10139.jpg';
theSitetree.fontsetId='21087';
theSitetree.graphicsetId='13184';
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: 			'Sportfan2',
				paletteFamily: 	'D4E8AB',
				keyvisualId: 	'10139',
				keyvisualName: 	'kv_10139.jpg',
				fontsetId: 		'21087',
				graphicsetId: 	'13184',
				contentColor: 	'000000',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-4362']={
webappId:    '7008',
documentId:  '2404',
internalId:  '4362',
customField: 'language:en;country:GB;'
};
webappMappings['7060']=webappMappings['7060-e2c95708e1140ba2e5b684777c593597']={
webappId:    '7060',
documentId:  '2430',
internalId:  'e2c95708e1140ba2e5b684777c593597',
customField: 'language:en;country:GB;'
};
webappMappings['7050']=webappMappings['7050-2136']={
webappId:    '7050',
documentId:  '2456',
internalId:  '2136',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32727',
internalId:  '',
customField: '20100205-142738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20100823-101208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2456',
internalId:  '',
customField: '20090409-145114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32701',
internalId:  '',
customField: '20100205-142709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2430',
internalId:  '',
customField: '20090409-113920'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-9328557']={
webappId:    '1501',
documentId:  '2301',
internalId:  '9328557',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2352',
internalId:  '',
customField: '20100318-092047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2378',
internalId:  '',
customField: '20100210-143911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2404',
internalId:  '',
customField: '20100520-140441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20100528-114608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32805',
internalId:  '',
customField: '20100206-212952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32779',
internalId:  '',
customField: '20100205-134710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20100607-140716'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2352',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2301',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2378',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '21801',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2404',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2430',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2456',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32601',
internalId:  '',
customField: '20100205-141959'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '8501',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32753',
internalId:  '',
customField: '20100205-142838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32831',
internalId:  '',
customField: '20100205-142632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36501',
internalId:  '',
customField: '20100205-145431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37701',
internalId:  '',
customField: '20100826-102559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43001',
internalId:  '',
customField: '20100510-124429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43601',
internalId:  '',
customField: '20100608-093950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45001',
internalId:  '',
customField: '20100524-104102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46201',
internalId:  '',
customField: '20100608-094014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46701',
internalId:  '',
customField: '20100608-094033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47501',
internalId:  '',
customField: '20100608-093658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48601',
internalId:  '',
customField: '20100614-092804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49401',
internalId:  '',
customField: '20100621-103845'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEPL0';
var companyName   = 'Farley+Hill+Cricket+Club';
var htmlTitle	  = 'Farley+Hill+Cricket+Club';
var metaKeywords  = '';
var metaContents  = 'Friendly+village+cricket+club+located+in+picturesque+rural+setting';
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();
};
