/* [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','11001',jdecode('Home'),jdecode(''), jdecode('%2F11001.html'), 'true',[],'',''],
	['PAGE','13001',jdecode('The+Story'),jdecode(''), jdecode('%2F13001%2Findex.html'), 'true',[ 
		['PAGE','13027',jdecode('Preparing+'),jdecode(''), jdecode('%2F13001%2F13027.html'), 'true',[],'',''],
		['PAGE','13053',jdecode('Cut+planks'),jdecode(''), jdecode('%2F13001%2F13053.html'), 'true',[],'',''],
		['PAGE','13079',jdecode('Air+drying'),jdecode(''), jdecode('%2F13001%2F13079.html'), 'true',[],'',''],
		['PAGE','13105',jdecode('Solar+kiln'),jdecode(''), jdecode('%2F13001%2F13105.html'), 'true',[],'','']
	],'',''],
	['PAGE','121201',jdecode('continue...............'),jdecode(''), jdecode('%2F121201.html'), 'false',[],'',''],
	['PAGE','11327',jdecode('The+Furniture'),jdecode(''), jdecode('%2F11327%2Findex.html'), 'true',[ 
		['PAGE','15053',jdecode('Seating'),jdecode(''), jdecode('%2F11327%2F15053.html'), 'true',[],'',''],
		['PAGE','15027',jdecode('Storage'),jdecode(''), jdecode('%2F11327%2F15027.html'), 'true',[],'',''],
		['PAGE','15001',jdecode('Tables+'),jdecode(''), jdecode('%2F11327%2F15001.html'), 'true',[],'',''],
		['PAGE','107001',jdecode('Sold+Gallery'),jdecode(''), jdecode('%2F11327%2F107001.html'), 'true',[],'','']
	],'',''],
	['PAGE','192101',jdecode('Designed+by+Nature'),jdecode(''), jdecode('%2F192101.html'), 'true',[],'',''],
	['PAGE','26901',jdecode('Maker+%26+Making'),jdecode(''), jdecode('%2F26901.html'), 'true',[],'',''],
	['PAGE','118501',jdecode('Commissions'),jdecode(''), jdecode('%2F118501.html'), 'true',[],'',''],
	['PAGE','113401',jdecode('A+Special+Yew'),jdecode(''), jdecode('%2F113401.html'), 'true',[],'',''],
	['PAGE','228001',jdecode('Exhibitions'),jdecode(''), jdecode('%2F228001.html'), 'true',[],'',''],
	['PAGE','115201',jdecode('News......'),jdecode(''), jdecode('%2F115201.html'), 'true',[],'',''],
	['PAGE','112101',jdecode('Restoration+Tree'),jdecode(''), jdecode('%2F112101.html'), 'true',[],'',''],
	['PAGE','161601',jdecode('Your+Trees'),jdecode(''), jdecode('%2F161601.html'), 'true',[],'',''],
	['PAGE','48601',jdecode('Woodland+Management'),jdecode(''), jdecode('%2F48601.html'), 'true',[],'',''],
	['PAGE','170101',jdecode('Grain+Patterns'),jdecode(''), jdecode('%2F170101.html'), 'true',[],'',''],
	['PAGE','63601',jdecode('Contact+us'),jdecode(''), jdecode('%2F63601.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Gaudy';
theSitetree.paletteFamily='5C5D96';
theSitetree.keyvisualId='5975';
theSitetree.keyvisualName='kv_5975.jpg';
theSitetree.fontsetId='11113';
theSitetree.graphicsetId='11905';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6E8BCE';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Gaudy',
				paletteFamily: 	'5C5D96',
				keyvisualId: 	'5975',
				keyvisualName: 	'kv_5975.jpg',
				fontsetId: 		'11113',
				graphicsetId: 	'11905',
				contentColor: 	'FFFFFF',
				contentBGColor: '6E8BCE',
				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:  '11001',
internalId:  '',
customField: '20120125-233739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '228001',
internalId:  '',
customField: '20120201-122435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20111216-102212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13027',
internalId:  '',
customField: '20110830-235350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13053',
internalId:  '',
customField: '20110329-185619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13079',
internalId:  '',
customField: '20100727-233411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13105',
internalId:  '',
customField: '20111120-210818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115201',
internalId:  '',
customField: '20120126-195323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11327',
internalId:  '',
customField: '20120122-172439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192101',
internalId:  '',
customField: '20120104-103916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113401',
internalId:  '',
customField: '20120126-195836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20111126-125151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15053',
internalId:  '',
customField: '20111126-125015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15027',
internalId:  '',
customField: '20120126-201034'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '11001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26901',
internalId:  '',
customField: '20120113-104845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48601',
internalId:  '',
customField: '20120201-124552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118501',
internalId:  '',
customField: '20120103-234628'
};
webappMappings['7008']=webappMappings['7008-6187']={
webappId:    '7008',
documentId:  '63601',
internalId:  '6187',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63601',
internalId:  '',
customField: '20101201-113927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121201',
internalId:  '',
customField: '20120125-235115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112101',
internalId:  '',
customField: '20120112-123310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107001',
internalId:  '',
customField: '20111126-122559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '170101',
internalId:  '',
customField: '20110820-130434'
};
webappMappings['1501']=webappMappings['1501-10809334']={
webappId:    '1501',
documentId:  '11001',
internalId:  '10809334',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161601',
internalId:  '',
customField: '20120126-204116'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN303U';
var companyName   = 'Forest+2+Furniture';
var htmlTitle	  = 'Handmade+Furniture+from+Sherwood+Forest%2C+Nottinghamshire';
var metaKeywords  = 'furniture%2C+handmade+furniture%2C+forest2furniture%2C+forest+2+furniture%2C+forest2+furniture%2C+forest+2furniture%2C+foret+2+furniture%2C+handmade+furniture+nottingham%2C+handmade+furniture+nottinghamshire%2C+handmade+furniture%2C+hand+made%2C+patrick+turk+furniture%2C+patrick+turk+furnirure%2C+art%2C+loomtime.com%2C+victoria+picon%2C+sweet+chestnut%2C+handmade+oak+furniture%2C+handmade%2C+handmade+furniture+sherwood+forest%2C+major+oak+sherwood+forest%2C+nottingame+forest%2C+forest+of+cherwood%2C+fores+2+furniture%2C+patrick+turk%2C+robin+hood%2C+davenport+shop+of+originality%2C+sarah+davenport%2C+handmade+oak+table%2C+handmade+oak+chair%2C+handmade+oak+settle%2C+handmade+oak+coffee+table%2C+handmade+oak+side+table%2C+handmade+oak+bed%2C+handmade+oak+cabinet%2C+handmade+oak+hall+chair%2C+handmade+table%2C+handmade+coffer%2C+handmade+sweet+chestnut%2C+handmade+chest%2C+handmade+marriage+chest%2C+handmade+dowry+chest%2C+handmade+yew+music+stand%2C+handmade+yew+table%2C+handmade+yew+side+table%2C+english+yew%2C+handmade+english+yew+table%2C+english+yew+music+stand%2C+music+stand%2C+country+style+furniture+Nottingham%2C+traditional+handmade+furniture+Nottingham%2C+exclusive%2C+traditional%2C+sherwood+forest%2C+furniture+in+Sherwood+forest%2C+king+john%2C+12th+century%2C+Edwinstowe%2C+Nottinghamshire%2C+BBC+Inside+Out%2C+environmental%2C+solar+kiln%2C+English%2C+England%2C+parliament+oak%2C+major+oak%2C+burr+oak%2C+duke+of+newcastle%2C++thoresby+hall%2C+rufford+abbey%2C+southwell+minster%2C+Patrick+Turk%2C+monk%27s+seat%2C+box+settle%2C+children%27s+seats%2C+children+chairs%2C+design+resolutions%2C';
var metaContents  = 'Handmade+furniture+from+trees+grown+in+The+Dukeries+and+historic+Sherwood+Forest';
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();
};

