/* [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','24001',jdecode('HOME+DESIGN+SERVICE'),jdecode(''),'/24001.html','true',[],'',''],
	['PAGE','18201',jdecode('NEW+DESIGNS'),jdecode(''),'/18201.html','true',[],'',''],
	['PAGE','23201',jdecode('BALLOONS'),jdecode(''),'/23201.html','true',[],'',''],
	['PAGE','23601',jdecode('WEDDING+CATERING'),jdecode(''),'/23601.html','true',[],'',''],
	['PAGE','1585',jdecode('The+Cake+Gallery'),jdecode(''),'/1585/index.html','true',[ 
		['PAGE','11301',jdecode('4+Tier+Cakes'),jdecode(''),'/1585/11301.html','true',[],'',''],
		['PAGE','1648',jdecode('3+Tier+Cakes'),jdecode(''),'/1585/1648.html','true',[],'',''],
		['PAGE','1669',jdecode('2+Tier+Cakes'),jdecode(''),'/1585/1669.html','true',[],'',''],
		['PAGE','1690',jdecode('Single+Tier+Cakes'),jdecode(''),'/1585/1690.html','true',[],'',''],
		['PAGE','1711',jdecode('Individual+Cakes'),jdecode(''),'/1585/1711.html','true',[],'',''],
		['PAGE','15401',jdecode('Close-ups'),jdecode(''),'/1585/15401.html','true',[],'','']
	],'',''],
	['PAGE','12101',jdecode('Large+Wedding%3F'),jdecode(''),'/12101.html','true',[],'',''],
	['PAGE','1522',jdecode('Our+Service'),jdecode(''),'/1522.html','true',[],'',''],
	['PAGE','3101',jdecode('The+Basics'),jdecode(''),'/3101.html','true',[],'',''],
	['PAGE','12901',jdecode('Video+Funny'),jdecode(''),'/12901.html','true',[],'',''],
	['PAGE','1732',jdecode('Portion+Calculator'),jdecode(''),'/1732.html','true',[],'',''],
	['PAGE','13401',jdecode('How+to+order'),jdecode(''),'/13401.html','true',[],'',''],
	['PAGE','1501',jdecode('How+to+find+us'),jdecode(''),'/1501.html','true',[],'',''],
	['PAGE','1753',jdecode('About+us'),jdecode(''),'/1753.html','true',[],'',''],
	['PAGE','7601',jdecode('Wedding+Cake+Album'),jdecode(''),'/7601.html','true',[],'',''],
	['PAGE','17201',jdecode('Directions'),jdecode(''),'/17201.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Porthole';
theSitetree.paletteFamily='8227AF';
theSitetree.keyvisualId='6716';
theSitetree.keyvisualName='kv_6716.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: 	'6716',
				keyvisualName: 	'kv_6716.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:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-5fc3c1f9a3be3b5c1d15d4db48002772']={
webappId:    '7060',
documentId:  '7601',
internalId:  '5fc3c1f9a3be3b5c1d15d4db48002772',
customField: 'language:en;country:GB;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '17201',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20091024-160931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1585',
internalId:  '',
customField: '20070406-144901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20070406-145144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1648',
internalId:  '',
customField: '20081111-160718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1669',
internalId:  '',
customField: '20070406-161558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1690',
internalId:  '',
customField: '20070412-155837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1711',
internalId:  '',
customField: '20070406-152253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20070412-154608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20070405-170736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1522',
internalId:  '',
customField: '20070405-163346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20070405-163631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20081201-170542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1732',
internalId:  '',
customField: '20070405-164330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20080421-152508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1501',
internalId:  '',
customField: '20100406-191318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1753',
internalId:  '',
customField: '20070405-164415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20070406-172139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20100406-191506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20091021-180833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20091026-144029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23601',
internalId:  '',
customField: '20100117-165712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24001',
internalId:  '',
customField: '20100406-191208'
};
webappMappings['1501']=webappMappings['1501-11374870']={
webappId:    '1501',
documentId:  '401',
internalId:  '11374870',
customField: '1501'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10INXL2M';
var companyName   = 'Wedding+Cakes+by+Freshabake';
var htmlTitle	  = 'Wedding+Cakes+in+Derbyshire+Nottinghamshire';
var metaKeywords  = 'Wedding+Cakes';
var metaContents  = 'Wedding+Cakes+in+Derby%0D%0AWedding+Cakes+in+Mansfield%0D%0AWedding+Cakes+Derby%0D%0AWedding+Cakes+Mansfield%0D%0AWedding+Cakes+Nottingham%0D%0AWedding+Cakes+in+Nottingham';
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();
};
