/* [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','6101',jdecode('Home'),jdecode(''),'/6101.html','true',[],'',''],
	['PAGE','6152',jdecode('Products'),jdecode(''),'/6152.html','true',[],'',''],
	['PAGE','6256',jdecode('Services'),jdecode(''),'/6256.html','true',[],'',''],
	['PAGE','6204',jdecode('Kitchens'),jdecode(''),'/6204.html','true',[],'',''],
	['PAGE','11501',jdecode('Bedrooms'),jdecode(''),'/11501.html','true',[],'',''],
	['PAGE','12001',jdecode('Bathroom'),jdecode(''),'/12001.html','true',[],'',''],
	['PAGE','10901',jdecode('Bookcases'),jdecode(''),'/10901.html','true',[],'',''],
	['PAGE','10401',jdecode('CNC+Machining'),jdecode(''),'/10401.html','true',[],'',''],
	['PAGE','16801',jdecode('3D+carving+Library'),jdecode(''),'/16801.html','true',[],'',''],
	['PAGE','6230',jdecode('News'),jdecode(''),'/6230.html','true',[],'',''],
	['PAGE','6282',jdecode('Contact'),jdecode(''),'/6282.html','true',[],'',''],
	['PAGE','8001',jdecode('email+us'),jdecode(''),'/8001.html','true',[],'',''],
	['PAGE','6308',jdecode('How+to+find+us'),jdecode(''),'/6308.html','true',[],'',''],
	['PAGE','43912',jdecode('E+Shop'),jdecode(''),'/43912.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Square';
theSitetree.paletteFamily='FDFEBE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10766';
theSitetree.graphicsetId='10493';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FDFEBE';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Square',
				paletteFamily: 	'FDFEBE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10766',
				graphicsetId: 	'10493',
				contentColor: 	'000000',
				contentBGColor: 'FDFEBE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'999999',
				e_color: 		'999966',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20100718-095800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43912',
internalId:  '',
customField: '20100411-133438'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100225-151220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6152',
internalId:  '',
customField: '20100718-100648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6204',
internalId:  '',
customField: '20100129-215101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6230',
internalId:  '',
customField: '20100129-220129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6256',
internalId:  '',
customField: '20100129-214814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6282',
internalId:  '',
customField: '20100129-220247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6308',
internalId:  '',
customField: '20100129-220347'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6308',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['7008']=webappMappings['7008-946']={
webappId:    '7008',
documentId:  '8001',
internalId:  '946',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20090131-084444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20100129-215944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100129-215234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20100129-215420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20100129-220047'
};
webappMappings['1501']=webappMappings['1501-5612389']={
webappId:    '1501',
documentId:  '6101',
internalId:  '5612389',
customField: '1501'
};
webappMappings['4001']=webappMappings['4001-11446895']={
webappId:    '4001',
documentId:  '43912',
internalId:  '11446895',
customField: 'language:en;country:GB;'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20IN2I7E';
var companyName   = 'FRETWORKS';
var htmlTitle	  = '';
var metaKeywords  = 'Fretwork%2CMDF%2CDoors%2CReady%2CPaint%2CFurniture%2CMackintosh%2CGothic%2CCNC%2CFreestanding%2CBookcases%2CDesigners%2CMakers%2Ckitchens%2Cbedrooms%2Cbathrooms%2CStudy%2CCabinet+making%2CPainted+Furniture%2C+CNC+Machining%2CGothic%2CMackintosh%2Cdesigns%2CMETA+name%3Dkeywords+content%3Dcustom+built+furniture+herts%2Cfitted+furniture+uk%2Ctraditional+english+furniture+uk%2Cuk+contemporary+modern+furniture%2Cbespoke+furniture+uk%2Cfurniture+store+watford%2Cfit+a+kitchen+in+herts%2Cbespoke+kitchen+design+uk%2Ckitchen+manufacturers+uk%2Ckitchen+design+uk%2Ckitchen+furniture+uk%2Ckitchen+fitters+watford%2Cfitted+bedroom+furniture+uk%2Cbedroom+furniture+uk%2Cfitted+bedroom+uk%2Cbathroom+cabinets+uk%2Cbathroom+furniture+uk%2Cbathroom+fittings+uk%2Cherts+bathroom%2Cfitted+bathroom+furniture+uk%2Cwall+bookcase%2Cbookcase+system%2Cbookcase+uk%2Cbookcase+carpenter+herts%2C+www.fretworks.co.uk';
var metaContents  = '+FRETWORKS+Fretwork%2C+Custom+made+furniture%2C+2D++3D+CNC+machining+specialist%2C+Fly+tying+benches%2C+Fly+Boxes.';
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();
};
