/* [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','2301',jdecode('Home'),jdecode(''),'/2301.html','true',[],'',''],
	['PAGE','2352',jdecode('Services'),jdecode(''),'/2352/index.html','true',[ 
		['PAGE','9343',jdecode('Corporate+catering'),jdecode(''),'/2352/9343.html','true',[],'',''],
		['PAGE','9322',jdecode('Vending'),jdecode(''),'/2352/9322.html','true',[],'',''],
		['PAGE','22901',jdecode('Every+day+visit'),jdecode(''),'/2352/22901.html','true',[],'','']
	],'',''],
	['PAGE','47712',jdecode('Wholesale'),jdecode(''),'/47712.html','false',[],'',''],
	['PAGE','2415',jdecode('Menu'),jdecode(''),'/2415.html','true',[],'',''],
	['PAGE','2436',jdecode('Delivery+area'),jdecode(''),'/2436.html','true',[],'',''],
	['PAGE','2478',jdecode('Contact'),jdecode(''),'/2478.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Proton';
theSitetree.paletteFamily='FFFFFF';
theSitetree.keyvisualId='3537';
theSitetree.keyvisualName='kv_3537.jpg';
theSitetree.fontsetId='10446';
theSitetree.graphicsetId='10827';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Proton',
				paletteFamily: 	'FFFFFF',
				keyvisualId: 	'3537',
				keyvisualName: 	'kv_3537.jpg',
				fontsetId: 		'10446',
				graphicsetId: 	'10827',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'747474',
				e_color: 		'864242',
				f_color: 		'A9A9A9',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20091116-154513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2415',
internalId:  '',
customField: '20091116-163114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2436',
internalId:  '',
customField: '20090825-102254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22901',
internalId:  '',
customField: '20091116-154634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2478',
internalId:  '',
customField: '20091116-161945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2352',
internalId:  '',
customField: '20090905-093019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9322',
internalId:  '',
customField: '20091116-154615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9343',
internalId:  '',
customField: '20091116-154557'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47712',
internalId:  '',
customField: '20091116-163340'
};
webappMappings['1501']=webappMappings['1501-10303689']={
webappId:    '1501',
documentId:  '2301',
internalId:  '10303689',
customField: '1501'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2AV8';
var companyName   = 'Quality+food+%26+Reliable+service';
var htmlTitle	  = 'Quality+Food+%26+Reliable+Service%2C+South+East+London+and+North+Kent';
var metaKeywords  = 'LUNCHES+CORPORATE+Business+Catering%2C+Business+lunches%2C+Conferences+catering%2C+food+delivery%2C+sandwiches+delivery%2C+sandwich+platters%2C+savoury+platters%2C+fresh+fruits+krols+krol+krolls+krol%60s+sandwiches+limited+SE+London+Kent+free+deliveryKrols+Sandwiches+is+a+successful+food+delivery+company+since+November+2005.+All+this+time+we+have+been+delivering+excellent+service+and+high+quality+food+to+all+our+customers.Today+we+cater+for+a+wide+variety+of+customers+with+buffets%2C+catering+vans+and+vending+services+priding+ourselves+on+a+professional+and+reliable+service.+We+are+based+in+Beckenham%2C+Kent+and+operate+over+South+East+London+and+North+Kent+area.Food+is+freshly+prepared+in+purpose+built%2C+temperature+controlled+kitchen+facility+by+highly+trained+and+efficient+staff.+We+are+welcome+anyone+to+visit+our+food+storage+and+preparation+facilities.Business+Catering+Business+lunches+Conferences+catering+food+delivery+sandwiches+delivery+take+away+krols+limited+krols+In+the+main+time+we+are+only+operate+our+vans+in+Erith%2C+Belvedere+and+Dartfort+areas.+If+your+business+falls+in+to+any+of+this+areas+and+you+are+looking+for+Quality+and+Reliable+service%2C+call+us+for+more+information.sandwiches+business+meetingsLooking+for+Snack%2C+Drink+or+Food+Vending+machine+or+need+someone+to+take+care+of+your+existing+one+anywhere+in+South+East+London+or+North+Kent%3F+Call+us%21%21%21+SANDWICHES+SANDWICHES+CORPORETE+CATERING+FOOD+DELIVERY+BUSINESS+LUNCHES+CORPORATE';
var metaContents  = 'Krols+Sandwiches+is+a+successful+food+delivery+company+since+November+2005.+All+this+time+we+have+been+delivering+excellent+service+and+high+quality+food+to+all+our+customers.Today+we+cater+for+a+wide+variety+of+customers+with+buffets%2C+catering+vans+and+vending+services+priding+ourselves+on+a+professional+and+reliable+service.+We+are+based+in+Beckenham%2C+Kent+and+operate+over+South+East+London+and+North+Kent+area.Food+is+freshly+prepared+in+purpose+built%2C+temperature+controlled+kitchen+facility+by+highly+trained+and+efficient+staff.+We+are+welcome+anyone+to+visit+our+food+storage+and+preparation+facilities.Business+Catering+Business+lunches+Conferences+catering+food+delivery+sandwiches+delivery+take+away+krols+limited+krols+In+the+main+time+we+are+only+operate+our+vans+in+Erith%2C+Belvedere+and+Dartfort+areas.+If+your+business+falls+in+to+any+of+this+areas+and+you+are+looking+for+Quality+and+Reliable+service%2C+call+us+for+more+information.sandwiches+business+meetingsLooking+for+Snack%2C+Drink+or+Food+Vending+machine+or+need+someone+to+take+care+of+your+existing+one+anywhere+in+South+East+London+or+North+Kent%3F+Call+us%21%21%21';
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();
};
