/* [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','2401',jdecode('Home'),jdecode(''), jdecode('%2F2401.html'), 'true',[],'',''],
	['PAGE','2504',jdecode('Facilities'),jdecode(''), jdecode('%2F2504.html'), 'true',[],'',''],
	['PAGE','7701',jdecode('Livery+Services'),jdecode(''), jdecode('%2F7701.html'), 'true',[],'',''],
	['PAGE','16401',jdecode('Assisted+Livery+Package'),jdecode(''), jdecode('%2F16401.html'), 'true',[],'',''],
	['PAGE','16427',jdecode('Standard+Livery+Package'),jdecode(''), jdecode('%2F16427.html'), 'true',[],'',''],
	['PAGE','16453',jdecode('Full+Livery+Package'),jdecode(''), jdecode('%2F16453.html'), 'true',[],'',''],
	['PAGE','16479',jdecode('Deluxe+Livery+Package'),jdecode(''), jdecode('%2F16479.html'), 'true',[],'',''],
	['PAGE','11301',jdecode('Rug+Washing+Service'),jdecode(''), jdecode('%2F11301.html'), 'true',[],'',''],
	['PAGE','14101',jdecode('Arena+Hire'),jdecode(''), jdecode('%2F14101.html'), 'true',[],'',''],
	['PAGE','2452',jdecode('About+Us'),jdecode(''), jdecode('%2F2452.html'), 'false',[],'',''],
	['PAGE','2478',jdecode('Gallery'),jdecode(''), jdecode('%2F2478.html'), 'true',[],'',''],
	['PAGE','2530',jdecode('News+and+Events'),jdecode(''), jdecode('%2F2530.html'), 'true',[],'',''],
	['PAGE','2556',jdecode('Contact'),jdecode(''), jdecode('%2F2556.html'), 'true',[],'',''],
	['PAGE','2582',jdecode('Location'),jdecode(''), jdecode('%2F2582.html'), 'true',[],'',''],
	['PAGE','4401',jdecode('Links'),jdecode(''), jdecode('%2F4401.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Gaudy';
theSitetree.paletteFamily='207247';
theSitetree.keyvisualId='5975';
theSitetree.keyvisualName='kv_5975.jpg';
theSitetree.fontsetId='11116';
theSitetree.graphicsetId='11906';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='5CB184';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Gaudy',
				paletteFamily: 	'207247',
				keyvisualId: 	'5975',
				keyvisualName: 	'kv_5975.jpg',
				fontsetId: 		'11116',
				graphicsetId: 	'11906',
				contentColor: 	'000000',
				contentBGColor: '5CB184',
				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['7060']=webappMappings['7060-10686e7a5aef7f552593c64b43fb36d6']={
webappId:    '7060',
documentId:  '2478',
internalId:  '10686e7a5aef7f552593c64b43fb36d6',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-6583']={
webappId:    '7008',
documentId:  '2556',
internalId:  '6583',
customField: 'language:en;country:GB;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2582',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20101110-150138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20100126-172102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2478',
internalId:  '',
customField: '20100324-184344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2504',
internalId:  '',
customField: '20101029-122430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2530',
internalId:  '',
customField: '20110713-121113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2556',
internalId:  '',
customField: '20100713-133228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2582',
internalId:  '',
customField: '20100129-093718'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20100713-130427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20101029-123351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20100827-110220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20101029-122623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20100805-160301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16427',
internalId:  '',
customField: '20101029-114253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16453',
internalId:  '',
customField: '20101029-123227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16479',
internalId:  '',
customField: '20101029-120825'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3NK3';
var companyName   = '';
var htmlTitle	  = 'Salcey+Forest+Ridings';
var metaKeywords  = 'livery+yards+in+buckinghamshire%2Chorse+livery+yard%2Cequine+livery%2Chorse+livery+buckinghamshire%2Clivery+yards+northamptonshire%2Clivery+yards+for+horses%2Clivery+yards+in+bucks%2Clivery+yards+in+bucks+area%2Chorse+riding+routes%2Chorse+riding+near+milton+keynes%2Chorse+riding+stables%2Cequestrian+stables%2Criding+stables+websites%2Cforest+riding+stables%2Cnorthants+bridleway%2Chorse+trials+south+east%2Cbridleways+uk%2Cbritish+bridleways%2Chorse+menage%2Cforestry+commission+uk+%2Cequestrian+menage+%2Csalcey+forest%2Csalcey+forest+ridings%2Clivery%2Clivery+yard%2Cfull+livery%2Cforestry+commission%2Cstables%2Chorse%2Chorses%2Cforest+trails%2Cstoke+goldington%2Chartwell%2Cmilton+keynes%2Cnorthampton';
var metaContents  = 'A+professional%2C+yet+friendly+full+livery+yard+based+next+to+the+Forest+Commission%E2%80%99s+beautiful+Salcey+Forest%2C+Hartwell%2C+Northamptonshire.++With+miles+of+purpose+built+forest+trails+in+addition+to+endless+tranquil+bridleways%2C+you+and+your+horse+will+love+what+Salcey+Forest+Ridings+has+to+offer%21++Why+not+call+Jodi+Bament+on+07711+579471+to+find+out+just+how+special+you+are+to+us%3F';
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();
};

