/* [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','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],'',''],
	['PAGE','2052',jdecode('Our+Service'),jdecode(''),'/2052.html','true',[],'',''],
	['PAGE','2078',jdecode('Dinner+Party'),jdecode(''),'/2078/index.html','true',[ 
		['PAGE','10201',jdecode('Starters'),jdecode(''),'/2078/10201.html','true',[],'',''],
		['PAGE','10227',jdecode('Fish+Courses'),jdecode(''),'/2078/10227.html','true',[],'',''],
		['PAGE','10253',jdecode('Main+Meal'),jdecode(''),'/2078/10253.html','true',[],'',''],
		['PAGE','10279',jdecode('Desserts'),jdecode(''),'/2078/10279.html','true',[],'','']
	],'',''],
	['PAGE','2104',jdecode('Romantic+Dinner+for+Two'),jdecode(''),'/2104.html','true',[],'',''],
	['PAGE','10401',jdecode('Etiquette+Rules'),jdecode(''),'/10401.html','true',[],'',''],
	['PAGE','10427',jdecode('What+to+Drink%3F'),jdecode(''),'/10427.html','true',[],'',''],
	['PAGE','2130',jdecode('Buffets'),jdecode(''),'/2130/index.html','true',[ 
		['PAGE','20301',jdecode('Hot+Buffets'),jdecode(''),'/2130/20301.html','true',[],'',''],
		['PAGE','20327',jdecode('Breakfast+Buffets'),jdecode(''),'/2130/20327.html','true',[],'','']
	],'',''],
	['PAGE','2208',jdecode('Weddings'),jdecode(''),'/2208/index.html','true',[ 
		['PAGE','2234',jdecode('Funerals'),jdecode(''),'/2208/2234.html','true',[],'',''],
		['PAGE','2260',jdecode('Christenings'),jdecode(''),'/2208/2260.html','true',[],'',''],
		['PAGE','2676',jdecode('Anniversaries'),jdecode(''),'/2208/2676.html','true',[],'',''],
		['PAGE','2702',jdecode('Birthdays'),jdecode(''),'/2208/2702.html','true',[],'','']
	],'',''],
	['PAGE','2286',jdecode('Themed+Parties'),jdecode(''),'/2286/index.html','true',[ 
		['PAGE','2312',jdecode('French+Evening'),jdecode(''),'/2286/2312.html','true',[],'',''],
		['PAGE','2338',jdecode('Italian+Evening'),jdecode(''),'/2286/2338.html','true',[],'',''],
		['PAGE','2364',jdecode('Spanish+Evening'),jdecode(''),'/2286/2364.html','true',[],'',''],
		['PAGE','2390',jdecode('Halloween'),jdecode(''),'/2286/2390.html','true',[],'',''],
		['PAGE','2416',jdecode('Bonfire+Night'),jdecode(''),'/2286/2416.html','true',[],'',''],
		['PAGE','2442',jdecode('Easter'),jdecode(''),'/2286/2442.html','true',[],'','']
	],'',''],
	['PAGE','2468',jdecode('Christmas+Fayre'),jdecode(''),'/2468/index.html','true',[ 
		['PAGE','2494',jdecode('Christmas+Champagne+Breakfast'),jdecode(''),'/2468/2494.html','true',[],'',''],
		['PAGE','2520',jdecode('Christmas+Hampers'),jdecode(''),'/2468/2520.html','true',[],'','']
	],'',''],
	['PAGE','2650',jdecode('Order'),jdecode(''),'/2650.html','true',[],'',''],
	['PAGE','18001',jdecode('Terms+%26+Conditions+2010'),jdecode(''),'/18001.html','true',[],'',''],
	['PAGE','2572',jdecode('References'),jdecode(''),'/2572.html','true',[],'',''],
	['PAGE','2624',jdecode('Email'),jdecode(''),'/2624.html','true',[],'',''],
	['PAGE','2728',jdecode('Contact'),jdecode(''),'/2728.html','true',[],'','']];
var siteelementCount=33;
theSitetree.topTemplateName='Lunch';
theSitetree.paletteFamily='77432E';
theSitetree.keyvisualId='3865';
theSitetree.keyvisualName='kv_3865.jpg';
theSitetree.fontsetId='10491';
theSitetree.graphicsetId='11066';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='91543C';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Lunch',
				paletteFamily: 	'77432E',
				keyvisualId: 	'3865',
				keyvisualName: 	'kv_3865.jpg',
				fontsetId: 		'10491',
				graphicsetId: 	'11066',
				contentColor: 	'FFFFFF',
				contentBGColor: '91543C',
				a_color: 		'77432E',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D2A390',
				e_color: 		'D2A390',
				f_color: 		'D2A390',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-5361']={
webappId:    '7008',
documentId:  '2624',
internalId:  '5361',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20091007-152433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2052',
internalId:  '',
customField: '20090823-205226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2078',
internalId:  '',
customField: '20100325-204841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2624',
internalId:  '',
customField: '20100325-205314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20091021-171741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2104',
internalId:  '',
customField: '20090816-212739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2130',
internalId:  '',
customField: '20100110-182246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10227',
internalId:  '',
customField: '20090825-144853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20091104-120634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2208',
internalId:  '',
customField: '20100110-183105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2234',
internalId:  '',
customField: '20090810-214450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2260',
internalId:  '',
customField: '20090810-214450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2676',
internalId:  '',
customField: '20090810-214450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2702',
internalId:  '',
customField: '20090810-214450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2286',
internalId:  '',
customField: '20100110-190513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2312',
internalId:  '',
customField: '20100110-191617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2338',
internalId:  '',
customField: '20100110-193530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2364',
internalId:  '',
customField: '20100110-193918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2390',
internalId:  '',
customField: '20100110-194341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2416',
internalId:  '',
customField: '20100110-192944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2442',
internalId:  '',
customField: '20100110-192007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2468',
internalId:  '',
customField: '20100325-205659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2494',
internalId:  '',
customField: '20100106-194038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2520',
internalId:  '',
customField: '20091007-194650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2650',
internalId:  '',
customField: '20090810-214450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2572',
internalId:  '',
customField: '20090810-214450'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2728',
internalId:  '',
customField: '20090918-085604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10253',
internalId:  '',
customField: '20090828-105322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10279',
internalId:  '',
customField: '20090825-154202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20090826-172543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10427',
internalId:  '',
customField: '20090918-084210'
};
webappMappings['7008']=webappMappings['7008-5643']={
webappId:    '7008',
documentId:  '2728',
internalId:  '5643',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20301',
internalId:  '',
customField: '20100110-201627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20327',
internalId:  '',
customField: '20100110-204327'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN30V3';
var companyName   = 'Wine+and+Dine+at+Home.co.uk';
var htmlTitle	  = 'Wine+and+Dine+at+Home';
var metaKeywords  = 'contract+catering+staffordshire%2Cchristmas+parties+staffordshire%2C+caterers+staffordshire%2Cwedding+party+catering+staffordshire%2Cbirthday+party+catering+staffordshire%2Ccaterers+sutton+coldfield%2Ccaterers+lichfield%2Cparty+catering+in+derby%2Cchristmas+lunch+derbyshire%2Cderby+christmas+dinners%2Cbuffet+service+staffordshire%2Csunday+lunch+in+derbyshire%2Cwedding+breakfasts+staffordshire%2Cwedding+dinners+in+derby%2Cdinner+party+caterers%2Cprivate+dinner+parties%2Ccooking+for+dinner+parties%2Cplanning+for+dinner+parties%2Cdinner+party+starters%2Crecipes+for+dinner+parties%2Csingles+dinner+parties%2Cdinner+party+menu%2Cdinner+parties+catering%2Cdinner+party+food%2Cprivate+chef+for+hire%2Ccooks+derby%2Cgourmet+food+derbyshire%2Cpersonal+chef+at+home%2C+Food%2C+lunch%2C+evenings%2C+chef%2C+catering%2C+cooking%2C+home%2C+wine+and+dine%2C+dinner+party%2C+dinner+parties%2C+parties%2C+events.+entertain+at+home%2C+roasts%2C+sunday+dinner%2C+dine%2C+dinner%2C+dinners%2C+formal+occasion%2C+dietary+requirements%2C+weightwatchers%2C+diet%2C+slimming+food%2C+etiquette%2C+table+manners%2C+fresh+food%2C+homemade+cooking%2C+cook%2C+table%2C+table+decorations%2C+tablecloths%2C+napkins%2C+chocolates%2C+flowers%2C+champagne%2C+wine%2C+drinks%2C+centrepiece%2C+weddings%2C+buffets%2C+funerals%2C+christenings%2C+themed+party%2C+retirement%2C+guests%2C+corporate%2C+starters%2C+fish+course%2C+main+meals%2C+desserts%2C+dishes%2C+baked%2C+waiter%2C+butler%2C+waitress%2C+christmas%2C+christmas+fayre%2C+gift+voucher%2C+present%2C+husband%2C+wife%2C+girlfriend%2C+boyfriend%2C+partner%2C+single%2C+host%2C+hostess%2C+private%2C+meal%2C+meals%2C+cutlery%2C+silverware%2C+glasses%2C+chocolate+fountain%2C+salads%2C+recipe%2C+meat%2C+organic%2C+';
var metaContents  = 'Wine+and+Dine+at+Home...Let+us+do+the+shopping%2C+cook+and+serve+your+food+and+clean+up+afterwards%21+Chill+and+relax%2C+enjoy+your+evening+with+your+guests.+Book+now+for+Christmas+Party%2C+in+the+comfort+of+your+own+home.';
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();
};
