/* [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','4601',jdecode('Home'),jdecode(''), jdecode('%2F4601.html'), 'true',[],'',''],
	['PAGE','22901',jdecode('Aerial+Photo'),jdecode(''), jdecode('%2F22901.html'), 'false',[],'',''],
	['PAGE','222734',jdecode('Aerial+Photos+2010'),jdecode(''), jdecode('%2F222734.html'), 'true',[],'',''],
	['PAGE','13901',jdecode('Site+Description'),jdecode(''), jdecode('%2F13901.html'), 'true',[],'',''],
	['PAGE','263145',jdecode('Site+Facilities'),jdecode(''), jdecode('%2F263145.html'), 'true',[],'',''],
	['PAGE','13927',jdecode('Location%2FRegion'),jdecode(''), jdecode('%2F13927.html'), 'true',[],'',''],
	['PAGE','116234',jdecode('Riverside+Wild+Life'),jdecode(''), jdecode('%2F116234.html'), 'true',[],'',''],
	['PAGE','92834',jdecode('The+Red+Squirrels+'),jdecode(''), jdecode('%2F92834.html'), 'true',[],'',''],
	['PAGE','237445',jdecode('Cyber-addicts'),jdecode(''), jdecode('%2F237445.html'), 'true',[],'',''],
	['PAGE','13953',jdecode('Our+team'),jdecode(''), jdecode('%2F13953.html'), 'true',[],'',''],
	['PAGE','20901',jdecode('Local+Villages'),jdecode(''), jdecode('%2F20901.html'), 'true',[],'',''],
	['PAGE','46312',jdecode('Winter+Touring'),jdecode(''), jdecode('%2F46312.html'), 'true',[],'',''],
	['PAGE','69934',jdecode('New+Years+Eve+'),jdecode(''), jdecode('%2F69934.html'), 'false',[],'',''],
	['PAGE','72634',jdecode('New+Years+Day+09'),jdecode(''), jdecode('%2F72634.html'), 'false',[],'',''],
	['PAGE','13979',jdecode('Contact+Address'),jdecode(''), jdecode('%2F13979.html'), 'true',[],'',''],
	['PAGE','14005',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F14005.html'), 'true',[],'',''],
	['PAGE','42112',jdecode('2010+Tariff'),jdecode(''), jdecode('%2F42112.html'), 'false',[],'',''],
	['PAGE','57912',jdecode('2011+%2F+2012+Tariff'),jdecode(''), jdecode('%2F57912.html'), 'true',[],'',''],
	['PAGE','60534',jdecode('Visitor+Information'),jdecode(''), jdecode('%2F60534.html'), 'true',[],'',''],
	['PAGE','141434',jdecode('New+Year+09%2F10'),jdecode(''), jdecode('%2F141434.html'), 'false',[],'',''],
	['PAGE','134134',jdecode('Your+Winter+Photos'),jdecode(''), jdecode('%2F134134.html'), 'false',[],'',''],
	['PAGE','52312',jdecode('Guestbook'),jdecode(''), jdecode('%2F52312.html'), 'true',[],'',''],
	['PAGE','57312',jdecode('links'),jdecode(''), jdecode('%2F57312%2Findex.html'), 'false',[ 
		['PAGE','97734',jdecode('Mildred'),jdecode(''), jdecode('%2F57312%2F97734.html'), 'false',[],'',''],
		['PAGE','112334',jdecode('No+Shows'),jdecode(''), jdecode('%2F57312%2F112334.html'), 'false',[],'','']
	],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='cutout';
theSitetree.paletteFamily='F0F1D8';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10350';
theSitetree.graphicsetId='10473';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'cutout',
				paletteFamily: 	'F0F1D8',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10350',
				graphicsetId: 	'10473',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20111109-075616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20110817-103406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13979',
internalId:  '',
customField: '20100622-225657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14005',
internalId:  '',
customField: '20110831-220658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13953',
internalId:  '',
customField: '20101022-202052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13927',
internalId:  '',
customField: '20110729-202542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22901',
internalId:  '',
customField: '20100129-205353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20090322-203645'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52312',
internalId:  '',
customField: '20101211-153249'
};
webappMappings['1002']=webappMappings['1002-52312anbt20inemwo']={
webappId:    '1002',
documentId:  '52312',
internalId:  '52312anbt20inemwo',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46312',
internalId:  '',
customField: '20110331-122405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42112',
internalId:  '',
customField: '20101105-074019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57312',
internalId:  '',
customField: '20081107-185033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57912',
internalId:  '',
customField: '20111109-075704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '222734',
internalId:  '',
customField: '20110311-191943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60534',
internalId:  '',
customField: '20111026-065741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69934',
internalId:  '',
customField: '20081231-160733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72634',
internalId:  '',
customField: '20090217-215121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92834',
internalId:  '',
customField: '20090804-223405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97734',
internalId:  '',
customField: '20090512-080934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '263145',
internalId:  '',
customField: '20110829-193942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112334',
internalId:  '',
customField: '20090716-163220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116234',
internalId:  '',
customField: '20100704-140535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134134',
internalId:  '',
customField: '20101127-065442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141434',
internalId:  '',
customField: '20100102-173021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '237445',
internalId:  '',
customField: '20110423-184040'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEMWO';
var companyName   = 'Riverside+Tourer+Park';
var htmlTitle	  = 'Riverside+Tourer+Park%2C+Adult+Only+Caravan+Park%2C++Cumbria%2FLake+District.+++';
var metaKeywords  = '+HEADADULT+ONLY+CARAVAN+PARK%2CCumbria%2C+Lake+District+%2FHEAD+HEADCaravan+Site%2CCumbria+Caravan+Site%2C+Lake+District%2C+Adult+Only%2FHEADHEAD+Lake-District%2C+Adult+Only+Caravan-Park%2FHEAD';
var metaContents  = 'Riverside+Tourer+Park%2C+Wide+Access+road+15+minutes+from+J41+of+the+M6%2C+Door+Step+reach+of+North+Lakes+Fells%2C+All+weather+leavel+Hard+Standings%2C+Electric+Hook-ups.++Ideal+Safe-+Haven+for+Winter+Caravaning+and+Motor+Vans.++++';
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();
};

