/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','452',jdecode('About+us'),jdecode(''),'/452.html','true',[],'',''],
	['PAGE','473',jdecode('Our+Services+%26+Menus'),jdecode(''),'/473.html','true',[],'',''],
	['PAGE','557',jdecode('Testimonials'),jdecode(''),'/557.html','true',[],'',''],
	['PAGE','8001',jdecode('Photos'),jdecode(''),'/8001.html','true',[],'',''],
	['PAGE','8022',jdecode('Organising+your+function'),jdecode(''),'/8022.html','true',[],'',''],
	['PAGE','8043',jdecode('Local+Halls+for+Hire'),jdecode(''),'/8043.html','true',[],'',''],
	['PAGE','599',jdecode('Contact+us'),jdecode(''),'/599.html','true',[],'',''],
	['PAGE','14201',jdecode('How+to+find+us'),jdecode(''),'/14201.html','true',[],'',''],
	['PAGE','620',jdecode('Links'),jdecode(''),'/620.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Porthole';
theSitetree.paletteFamily='8227AF';
theSitetree.keyvisualId='6710';
theSitetree.keyvisualName='kv_6710.jpg';
theSitetree.fontsetId='11200';
theSitetree.graphicsetId='12014';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E9C7F8';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Porthole',
				paletteFamily: 	'8227AF',
				keyvisualId: 	'6710',
				keyvisualName: 	'kv_6710.jpg',
				fontsetId: 		'11200',
				graphicsetId: 	'12014',
				contentColor: 	'000000',
				contentBGColor: 'E9C7F8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20081024-174142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20080425-191634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20080930-134530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20100223-233902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20080930-140739'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8022',
internalId:  '',
customField: '20080208-184539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20080930-134957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8043',
internalId:  '',
customField: '20090211-145705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20080607-192505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20080508-151146'
};
webappMappings['7008']=webappMappings['7008-1229']={
webappId:    '7008',
documentId:  '599',
internalId:  '1229',
customField: 'language:en;country:GB;'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2R3Z';
var companyName   = 'DOREEN+LAMBERT+CATERING+SERVICES';
var htmlTitle	  = '';
var metaKeywords  = 'catering+in+bedford%2C+caterers+in+bedford%2C+bedford+catering%2C+catering+in+bedfordshire%2C+caterers+in+bedfordshire%2C+weddings+in+bedford%2C+funerals+in+bedford%2C+christenings+in+bedford%2C+dinners+in+bedford%2C+buffets+in+bedford%2C+hot+meals+in+bedford%2C+sit-down+meals+in+bedford%2C+finger+buffets+in+bedford%2C+hot+buffets+in+bedford%2C+cold+buffets+in+bedford%2C+carvery+in+bedford%2C+finger+buffet+menu+in+bedford%2C+fork+buffets+in+bedford%2C+supper+in+bedford%2C+menus+for+bedford%2C+lunches+in+bedford%2C+business+lunches+in+bedford%2C+corporate+catering+in+bedford%2C+balls+in+bedford%2C+roast+dinners+in+bedford%2C+roast+beef+in+bedford%2C+canapes+in+bedford%2C+canap%C3%A9s+in+bedford%2C+bedfordshire+catering%2C+bedfordshire+caterers%2C+outside+catering+in+bedfordshire%2C+outside+caterers+in+bedfordshrie';
var metaContents  = 'Catering+for+all+occasions%2C+hot+and+cold+sit-down+meals+and+buffets.+Fully+staffed+or+delivered+only%3B+Bedford%2C+Bedfordshire';
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();
};
