/* [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','15227',jdecode('About+us'),jdecode(''),'/15227.html','true',[],'',''],
	['PAGE','5001',jdecode('Home'),jdecode(''),'/5001/index.html','true',[ 
		['PAGE','5052',jdecode('EYFS'),jdecode(''),'/5001/5052.html','true',[],'',''],
		['PAGE','5901',jdecode('Contact+details'),jdecode(''),'/5001/5901.html','true',[],'',''],
		['PAGE','15201',jdecode('news'),jdecode(''),'/5001/15201.html','true',[],'',''],
		['PAGE','23301',jdecode('Links'),jdecode(''),'/5001/23301.html','true',[],'','']
	],'',''],
	['PAGE','5078',jdecode('Windmill+Redruth'),jdecode(''),'/5078/index.html','true',[ 
		['PAGE','5104',jdecode('Facilities+'),jdecode(''),'/5078/5104.html','true',[],'',''],
		['PAGE','5130',jdecode('Meals+and+Menus'),jdecode(''),'/5078/5130.html','true',[],'',''],
		['PAGE','5156',jdecode('Services'),jdecode(''),'/5078/5156.html','true',[],'',''],
		['PAGE','5182',jdecode('Fees'),jdecode(''),'/5078/5182.html','true',[],'',''],
		['PAGE','5208',jdecode('Staff'),jdecode(''),'/5078/5208.html','true',[],'','']
	],'',''],
	['PAGE','5390',jdecode('Minors+Playclub'),jdecode(''),'/5390/index.html','true',[ 
		['PAGE','5416',jdecode('FAQ'),jdecode(''),'/5390/5416.html','true',[],'',''],
		['PAGE','5442',jdecode('Rules+for+children'),jdecode(''),'/5390/5442.html','true',[],'',''],
		['PAGE','5468',jdecode('Meals+and+Menu'),jdecode(''),'/5390/5468.html','true',[],'',''],
		['PAGE','5494',jdecode('Fees'),jdecode(''),'/5390/5494.html','true',[],'',''],
		['PAGE','5520',jdecode('How+to+book'),jdecode(''),'/5390/5520.html','true',[],'',''],
		['PAGE','9601',jdecode('Staff'),jdecode(''),'/5390/9601.html','true',[],'','']
	],'',''],
	['PAGE','24501',jdecode('Holiday+programme'),jdecode(''),'/24501.html','true',[],'',''],
	['PAGE','15253',jdecode('Jobs'),jdecode(''),'/15253.html','true',[],'',''],
	['PAGE','22401',jdecode('Gallery'),jdecode(''),'/22401.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='BB9C60';
theSitetree.keyvisualId='2224';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='364';
theSitetree.graphicsetId='417';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='BB9C60';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Enjoy',
				paletteFamily: 	'BB9C60',
				keyvisualId: 	'2224',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'364',
				graphicsetId: 	'417',
				contentColor: 	'000000',
				contentBGColor: 'BB9C60',
				a_color: 		'BB9C60',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20110212-080741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5390',
internalId:  '',
customField: '20110208-192856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5468',
internalId:  '',
customField: '20110212-084411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15253',
internalId:  '',
customField: '20091230-134723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5078',
internalId:  '',
customField: '20090306-091614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20110212-080258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5416',
internalId:  '',
customField: '20110212-084331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5442',
internalId:  '',
customField: '20100108-144707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5494',
internalId:  '',
customField: '20110208-193024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5520',
internalId:  '',
customField: '20091230-135945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20110212-080636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24501',
internalId:  '',
customField: '20110406-204721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22401',
internalId:  '',
customField: '20100108-144427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23301',
internalId:  '',
customField: '20100128-074909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15227',
internalId:  '',
customField: '20091230-152108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5104',
internalId:  '',
customField: '20110212-080940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5182',
internalId:  '',
customField: '20110212-083642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20091230-152358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5130',
internalId:  '',
customField: '20091230-170251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5156',
internalId:  '',
customField: '20090306-125154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5208',
internalId:  '',
customField: '20110212-084159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20110212-084511'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INENIQ';
var companyName   = 'Windmill+Nursery+and++Play+Club';
var htmlTitle	  = 'Windmill+Nursery+and+Playclub+-+Redruth+Cornwall';
var metaKeywords  = 'nurseries%2Cdaycare+preschool%2Cpreschool+education%2Cpreschool+learning%2Cpreschool+curriculum%2Cpre+school+learning%2Cpre+school+education%2Cpre+school+curriculum%2Cprimary+education+resources%2Cprimary+school+education%2Cday+care+centre%2Ccornwall+primary+care%2Cday+care+nursery%2Cchild+day+care%2Cchild+care+education%2Cfind+a+primary+school+in+cornwall%2Ccornwall+primary+schools%2Cwindmill+day+care+nursery+redruth%2Cplay+club%2Cnursery+school%2Cday+nursery%2Cnursery+education%2Cgarden+nurseries+cornwall%2Cwindmill+nursery+redruth%2Ccornwall+day+nursery%2Cearly+years+education%2Cearly+years+foundation+stage%2Cearly+years+childcare%2Cearly+years+care+and+education%2C+www.windmill-nurseries.co.uk%22%3E';
var metaContents  = 'Windmill+Nursery+and+Playclub%2C+Redruth%2C+Cornwall.+UK.+Quality+childcare+and+education+for+children+aged+from+0+to+11%2B+years.';
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();
};

