/* [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','1612',jdecode('Home'),jdecode(''),'/1612.html','true',[],'',''],
	['PAGE','14991',jdecode('Local+News+%26+Information'),jdecode(''),'/14991/index.html','true',[ 
		['PAGE','15977',jdecode('Map'),jdecode(''),'/14991/15977.html','true',[],'',''],
		['PAGE','15899',jdecode('Cinemas'),jdecode(''),'/14991/15899.html','true',[],'',''],
		['PAGE','25939',jdecode('Flower+Show'),jdecode(''),'/14991/25939.html','true',[],'',''],
		['PAGE','15951',jdecode('Ockley+Windmill'),jdecode(''),'/14991/15951.html','true',[],'',''],
		['PAGE','15925',jdecode('Train+Timetable'),jdecode(''),'/14991/15925.html','true',[],'',''],
		['PAGE','15873',jdecode('Weather'),jdecode(''),'/14991/15873.html','true',[],'','']
	],'',''],
	['PAGE','14399',jdecode('Amenities'),jdecode(''),'/14399/index.html','true',[ 
		['PAGE','14665',jdecode('Village+Hall'),jdecode(''),'/14399/14665.html','true',[],'',''],
		['PAGE','14691',jdecode('Village+Shop'),jdecode(''),'/14399/14691.html','true',[],'',''],
		['PAGE','15665',jdecode('Doctors%26%23x27%3B+Surgery'),jdecode(''),'/14399/15665.html','true',[],'',''],
		['PAGE','14717',jdecode('Public+Houses'),jdecode(''),'/14399/14717.html','true',[],'',''],
		['PAGE','15691',jdecode('Service+Station'),jdecode(''),'/14399/15691.html','true',[],'','']
	],'',''],
	['PAGE','14165',jdecode('Church'),jdecode(''),'/14165.html','true',[],'',''],
	['PAGE','20839',jdecode('Education'),jdecode(''),'/20839/index.html','true',[ 
		['PAGE','15639',jdecode('Elderslie+Nursery+School'),jdecode(''),'/20839/15639.html','true',[],'',''],
		['PAGE','14191',jdecode('Scott+Broadwood+School'),jdecode(''),'/20839/14191.html','true',[],'','']
	],'',''],
	['PAGE','14217',jdecode('Ockley+Society'),jdecode(''),'/14217/index.html','true',[ 
		['PAGE','17439',jdecode('About+us'),jdecode(''),'/14217/17439.html','true',[],'',''],
		['PAGE','29839',jdecode('Calendar+of+Events+2010'),jdecode(''),'/14217/29839.html','true',[],'',''],
		['PAGE','14243',jdecode('History'),jdecode(''),'/14217/14243.html','true',[],'',''],
		['PAGE','14269',jdecode('Quiz+Evening'),jdecode(''),'/14217/14269.html','true',[],'',''],
		['PAGE','14295',jdecode('Cricket+Sevens'),jdecode(''),'/14217/14295.html','true',[],'',''],
		['PAGE','14321',jdecode('Bonfire+%26+Fireworks'),jdecode(''),'/14217/14321.html','true',[],'',''],
		['PAGE','14347',jdecode('Carols+on+the+Green'),jdecode(''),'/14217/14347.html','true',[],'',''],
		['PAGE','14373',jdecode('Ocklympics'),jdecode(''),'/14217/14373.html','true',[],'',''],
		['PAGE','14639',jdecode('Who%26%23x27%3Bs+Who'),jdecode(''),'/14217/14639.html','true',[],'','']
	],'',''],
	['PAGE','14965',jdecode('History'),jdecode(''),'/14965/index.html','true',[ 
		['PAGE','15717',jdecode('Ancestors'),jdecode(''),'/14965/15717.html','true',[],'',''],
		['PAGE','15769',jdecode('Ockley+School'),jdecode(''),'/14965/15769.html','true',[],'',''],
		['PAGE','15795',jdecode('Footpath+on+the+Green'),jdecode(''),'/14965/15795.html','true',[],'','']
	],'',''],
	['PAGE','15821',jdecode('Societies+and+Clubs'),jdecode(''),'/15821/index.html','true',[ 
		['PAGE','14425',jdecode('Dramatic+Society'),jdecode(''),'/15821/14425.html','true',[],'',''],
		['PAGE','14743',jdecode('Cricket+Club'),jdecode(''),'/15821/14743.html','true',[],'',''],
		['PAGE','25139',jdecode('Camera+Club'),jdecode(''),'/15821/25139.html','true',[],'',''],
		['PAGE','25639',jdecode('Yoga+Class'),jdecode(''),'/15821/25639.html','true',[],'',''],
		['PAGE','37639',jdecode('Keep+Fit+Classes'),jdecode(''),'/15821/37639.html','true',[],'','']
	],'',''],
	['PAGE','15017',jdecode('Local+Businesses'),jdecode(''),'/15017.html','true',[],'',''],
	['PAGE','21039',jdecode('Guest+Book'),jdecode(''),'/21039.html','true',[],'',''],
	['PAGE','24439',jdecode('Contact'),jdecode(''),'/24439.html','true',[],'','']];
var siteelementCount=41;
theSitetree.topTemplateName='Favor';
theSitetree.paletteFamily='ADACAC';
theSitetree.keyvisualId='7344';
theSitetree.keyvisualName='kv_7344.jpg';
theSitetree.fontsetId='16467';
theSitetree.graphicsetId='12161';
theSitetree.contentColor='323232';
theSitetree.contentBGColor='E6E5E5';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Favor',
				paletteFamily: 	'ADACAC',
				keyvisualId: 	'7344',
				keyvisualName: 	'kv_7344.jpg',
				fontsetId: 		'16467',
				graphicsetId: 	'12161',
				contentColor: 	'323232',
				contentBGColor: 'E6E5E5',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14165',
internalId:  '',
customField: '20081106-093213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14399',
internalId:  '',
customField: '20081212-122322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15821',
internalId:  '',
customField: '20100220-143551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14217',
internalId:  '',
customField: '20090221-131611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1612',
internalId:  '',
customField: '20090102-191641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14191',
internalId:  '',
customField: '20081212-093339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15977',
internalId:  '',
customField: '20081212-093801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14295',
internalId:  '',
customField: '20081212-093423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14965',
internalId:  '',
customField: '20081212-094411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21039',
internalId:  '',
customField: '20081212-094014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15639',
internalId:  '',
customField: '20090120-104933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14243',
internalId:  '',
customField: '20081106-100036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17439',
internalId:  '',
customField: '20081205-182123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14269',
internalId:  '',
customField: '20090221-132628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14321',
internalId:  '',
customField: '20081212-093446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14347',
internalId:  '',
customField: '20081212-093501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14373',
internalId:  '',
customField: '20081212-093523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14639',
internalId:  '',
customField: '20081212-170828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14665',
internalId:  '',
customField: '20091001-184227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14691',
internalId:  '',
customField: '20091127-090937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15665',
internalId:  '',
customField: '20081212-093157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14425',
internalId:  '',
customField: '20100217-183919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14717',
internalId:  '',
customField: '20081212-093230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14743',
internalId:  '',
customField: '20081212-093745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15691',
internalId:  '',
customField: '20081212-093249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15717',
internalId:  '',
customField: '20081212-093622'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1612',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15769',
internalId:  '',
customField: '20081212-093635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15795',
internalId:  '',
customField: '20081212-093650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14991',
internalId:  '',
customField: '20100120-110828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15873',
internalId:  '',
customField: '20081212-093814'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '15977',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15925',
internalId:  '',
customField: '20081212-093832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20839',
internalId:  '',
customField: '20081212-093316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15899',
internalId:  '',
customField: '20081211-182040'
};
webappMappings['7002']=webappMappings['7002-1222']={
webappId:    '7002',
documentId:  '21039',
internalId:  '1222',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15951',
internalId:  '',
customField: '20091127-091019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15017',
internalId:  '',
customField: '20100209-180946'
};
webappMappings['7008']=webappMappings['7008-3339']={
webappId:    '7008',
documentId:  '24439',
internalId:  '3339',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24439',
internalId:  '',
customField: '20081212-092528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25139',
internalId:  '',
customField: '20081212-122617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25639',
internalId:  '',
customField: '20081212-181805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25939',
internalId:  '',
customField: '20090815-131706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29839',
internalId:  '',
customField: '20100108-145329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37639',
internalId:  '',
customField: '20100220-143512'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20IN2IVE';
var companyName   = 'Ockley.com+-+the+original+village+web+site';
var htmlTitle	  = 'Ockley+Village+Is+Online%21';
var metaKeywords  = 'ockley+website.+read+all+about+ockley%2Chistoric+village%2C+panto+in+ockley';
var metaContents  = 'Ockley%2C+Dorking%2C+Surrey.+Village+web+site.+historic+village%2C+historic+english+village%2C+official+web+site';
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();
};
