/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','773',jdecode('Wedding+Cakes'),jdecode(''),'/773.html','true',[],'',''],
	['PAGE','4501',jdecode('WEDDING+DESIGNS'),jdecode(''),'/4501.html','true',[],'',''],
	['PAGE','35929',jdecode('*CELEBRATION+GALLERY*'),jdecode(''),'/35929.html','true',[],'',''],
	['PAGE','37629',jdecode('BALLOONS'),jdecode(''),'/37629.html','true',[],'',''],
	['PAGE','37655',jdecode('Charicatures+-+Gallery'),jdecode(''),'/37655.html','true',[],'',''],
	['PAGE','857',jdecode('Delivery+Details'),jdecode(''),'/857.html','true',[],'',''],
	['PAGE','878',jdecode('CONTACT+US%21'),jdecode(''),'/878.html','true',[],'',''],
	['PAGE','2906',jdecode('Customer+Feedback...'),jdecode(''),'/2906/index.html','true',[ 
		['PAGE','2901',jdecode('Read+Guestbook'),jdecode(''),'/2906/2901.html','true',[],'','']
	],'',''],
	['PAGE','55279',jdecode('How+to+find+us'),jdecode(''),'/55279.html','true',[],'',''],
	['PAGE','55305',jdecode('LINKS'),jdecode(''),'/55305.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Court';
theSitetree.paletteFamily='B572C9';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16445';
theSitetree.graphicsetId='12149';
theSitetree.contentColor='5D2F6A';
theSitetree.contentBGColor='F1C5FF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Court',
				paletteFamily: 	'B572C9',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16445',
				graphicsetId: 	'12149',
				contentColor: 	'5D2F6A',
				contentBGColor: 'F1C5FF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100714-174055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20100629-215338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55279',
internalId:  '',
customField: '20100714-174309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20100629-213928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '878',
internalId:  '',
customField: '20100714-174216'
};
webappMappings['1002']=webappMappings['1002-2906anbt10in282e']={
webappId:    '1002',
documentId:  '2906',
internalId:  '2906anbt10in282e',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20080315-013752'
};
webappMappings['7060']=webappMappings['7060-a6d68c097e88f433654cec9675a26deb']={
webappId:    '7060',
documentId:  '35929',
internalId:  'a6d68c097e88f433654cec9675a26deb',
customField: 'language:en;country:GB;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '55279',
internalId:  'routing',
customField: 'en_GB'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-5070210']={
webappId:    '1501',
documentId:  '4501',
internalId:  '5070210',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2906',
internalId:  '',
customField: '20080315-013752'
};
webappMappings['7060']=webappMappings['7060-0506c6eb0f8b12e883648822a4c77f37']={
webappId:    '7060',
documentId:  '4501',
internalId:  '0506c6eb0f8b12e883648822a4c77f37',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20100514-073627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35929',
internalId:  '',
customField: '20100514-074549'
};
webappMappings['7060']=webappMappings['7060-a0b619c9d45f9a6a42e447f7ee4596b1']={
webappId:    '7060',
documentId:  '37629',
internalId:  'a0b619c9d45f9a6a42e447f7ee4596b1',
customField: 'language:en;country:GB;'
};
webappMappings['7060']=webappMappings['7060-cdd624a13fb06fd0abb78b95d79aba83']={
webappId:    '7060',
documentId:  '37655',
internalId:  'cdd624a13fb06fd0abb78b95d79aba83',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37629',
internalId:  '',
customField: '20090818-234124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37655',
internalId:  '',
customField: '20090818-234228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55305',
internalId:  '',
customField: '20100629-215859'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN282E';
var companyName   = 'Fairytale+Cake+Company';
var htmlTitle	  = 'Fairytale+Cake+Company';
var metaKeywords  = 'Designer+Cakes%2C+Birthday+cakes%2C+wedding+cakes%2C+celebration+cakes%2C+corporate+cakes%2C+party+supplies%2C+toys%2C+gift+list%2C+sugarcraft+supplies%2C+wedding+postbox%2C+personalised+charicatures%2C+charicature%2C+keepsake%2C+cake+topper%2C+toppers%2C+west+midlands%2C+wombourne%2C+wolverhampton%2C+fancy%2C+funky%2C+tailor+make+cakes%2C+bespoke+cakes%2C+party+supplies%2C+party+packages%2C+party+stationery%2C+gift+list+service%2C+themed+parties%2C+themed+birthday+cakes%2C+childrens+cakes%2C+cupcakes%2C+cookies%2C+fruit%2C+sponge%2C+buttercream%2C+iced%2C+layered%2C+teirs%2C+Albrighton...+Aldridge...+Bentley...+Bilston...+Birmingham...+Blackheath...+Bloxwich...+Bridgnorth...+Brierley+Hill...+Brockmoor...+Brownhills...+Castle+Bromwich...+Chaddesley+Corbett...+Claverley...+Clent...+Codsall...+Coleshill...+Compton%E2%80%A6+Coventry...+Cradley+Heath...+Dudley...+Kidderminster...+Enville...+Gornal...+Sedgley...+Gornal+Wood...+Haleswowen...+Kingswinford...+Oldbury...+Warley...+Pattingham...+Penn...+Pensnett...+Perton...+Princess+End...+Quarry+Bank...+Romsley...+Rowley+Regis...+Sedgley...+Shifnal...+Smethwick...+Stourbridge...+Sutton+Coldfield...+Swindon...+Tamworth...+Telford...+Tettenhall+Wood...+Tettenhall...+Tipton...+Tividale...+Trysull...+Wall+Heath...+Walsall...+Wednesbury...West+Bromwich...+Willenhall...+Wollaston...+Wolverhampton...+Wombourne...+Oldswinford...+Hagley...+Belbroughton...+Bromsgrove...+Kinver...+Quinton...';
var metaContents  = 'The+West+Midlands+premier+wedding+and+novelty+cake+design+team.+We+create+designer+cakes++personalised+charicature+keepsake+cake+toppers+to+your+specification.+We+bake+delicious+chocolate%2C+sponge%2C+carrot%2C+toffee%2C+lemon+or+fruit+cake+filling.+Based+in+Wombourne%2C+we+are+ideally+located+to+serve+the+West+Midlands%2C+Shropshire%2C+Staffordshire%2C+Worcestershire+and+beyond.++++++All+our+cakes+are+baked+to+the+highest+standards+using+only+the+best+quality+products.+Each+cake+is+individually+designed+to+your+specification%2C+from+exquisite+wedding+cakes+to+fun++funky+novelty+cakes.+You+are+guaranteed+the+highest+quality+of+cake%2C+craftsmanship+and+attention+to+detail.+If+you+have+a+design+in+mind+thats+not+displayed+on+our+website+please+get+in+touch+to+discuss+your+ideas+and+together+we+can+create+a+cake+to+compliment+any+occasion.++++We+also+offer+the+complete+range+of+various+themed+party+packages+for+all+age+groups.++++The+creator+of+little+VIP+Gift+List+Service.+Albrighton...+Aldridge...+Bentley...+Bilston...+Birmingham...+Blackheath...+Bloxwich...+Bridgnorth...+Brierley+Hill...+Brockmoor...+Brownhills...+Castle+Bromwich...+Chaddesley+Corbett...+Claverley...+Clent...+Codsall...+Coleshill...+Compton...+Coventry...+Cradley+Heath...+Dudley...+Kidderminster...+Enville...+Gornal...+Sedgley...+Gornal+Wood...+Haleswowen...+Kingswinford...+Oldbury...+Warley...+Pattingham...+Penn...+Pensnett...+Perton...+Princess+End...+Quarry+Bank...+Romsley...+Rowley+Regis...+Sedgley...+Shifnal...+Smethwick...+Stourbridge...+Sutton+Coldfield...+Swindon...+Tamworth...+Telford...+Tettenhall+Wood...+Tettenhall...+Tipton...+Tividale...+Trysull...+Wall+Heath...+Walsall...+Wednesbury...West+Bromwich...+Willenhall...+Wollaston...+Wolverhampton...+Wombourne...+Oldswinford...+Hagley...+Belbroughton...+Bromsgrove...+Kinver...+Quinton...';
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();
};
