/* [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','13901',jdecode('Home'),jdecode(''),'/13901.html','true',[],'',''],
	['PAGE','13952',jdecode('Furniture+Repair'),jdecode(''),'/13952.html','true',[],'',''],
	['PAGE','14004',jdecode('Furniture+Sales'),jdecode(''),'/14004.html','true',[],'',''],
	['PAGE','14030',jdecode('About+us'),jdecode(''),'/14030.html','true',[],'',''],
	['PAGE','25012',jdecode('French+Polishing'),jdecode(''),'/25012.html','true',[],'',''],
	['PAGE','14082',jdecode('Contact+us'),jdecode(''),'/14082.html','true',[],'',''],
	['PAGE','17401',jdecode('Questions+Answered'),jdecode(''),'/17401.html','false',[],'',''],
	['PAGE','31812',jdecode('Spray+Finishing'),jdecode(''),'/31812.html','true',[],'',''],
	['PAGE','32612',jdecode('Barlis+of+Lincoln'),jdecode(''),'/32612.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Linear';
theSitetree.paletteFamily='993300';
theSitetree.keyvisualId='2192';
theSitetree.keyvisualName='bau1.jpg';
theSitetree.fontsetId='361';
theSitetree.graphicsetId='412';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Linear',
				paletteFamily: 	'993300',
				keyvisualId: 	'2192',
				keyvisualName: 	'bau1.jpg',
				fontsetId: 		'361',
				graphicsetId: 	'412',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				a_color: 		'003333',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'99CC66',
				e_color: 		'CCFF66',
				f_color: 		'669966',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20100813-130912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14082',
internalId:  '',
customField: '20090409-190059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13952',
internalId:  '',
customField: '20090807-170212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14004',
internalId:  '',
customField: '20090618-095608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14030',
internalId:  '',
customField: '20091106-123104'
};
webappMappings['1002']=webappMappings['1002-17401anbt20ine71r']={
webappId:    '1002',
documentId:  '17401',
internalId:  '17401anbt20ine71r',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20081205-120044'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '13901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25012',
internalId:  '',
customField: '20100413-183110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31812',
internalId:  '',
customField: '20100802-215614'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '13901',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32612',
internalId:  '',
customField: '20091004-231514'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '13952',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '14004',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '14030',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '25012',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '14082',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '17401',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '31812',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '32612',
internalId:  '',
customField: 'language:en;country:GB;'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INE71R';
var companyName   = 'Gallant+Antiques+and+Restorations';
var htmlTitle	  = '';
var metaKeywords  = 'META+name%3Dkeywords+content%3D+furniture+repair%2Cantique+furniture+repair%2Cantique+furniture+repair+lincoln%2Cantique+furniture+restoration+lincolnshire%2Cantique+furniture+restoration+north+lincolnshire%2Coak+furniture+repair+lincolnshire%2Cantique+restoration+north+lincolnshire%2Cfurniture+restoration+lincolnshire%2Cfurniture+repair%2Cdamaged+furniture+repair%2Cfurniture+repair+services+uk%2Cantique+furniture+restorer%2Crestorer%2Cantique+restorer%2Cfurniture+restoration+uk%2Crestoration+of+furniture%2Cfrench+polishing+uk%2Cfrench+polishers+uk%2Cantique+french+polishing%2Cfrench+polish+for+furniture%2Ctraditional+french+polishing%2CGallant+Restorations%2Ctable+repairs%2Cchair+repairs%2CFrench++polishing%2Cdesk+leather+replacement%2Cantique+furniture+restoration+hemswell%2Clincolnshire%2Csouth+yorkshire%2Chumberside%2CKirton+in+Lindsey%2Clincoln%2Cscunthorpe%2Cbrigg%2C+grimsby%2Ccleethorpes%2Cgainsborough%2Cdoncaster';
var metaContents  = 'Gallant+Restorations.++Restorers+and+french+polishers+of+Antique+and+20th+century+furniture.+Antique+furniture+restoration+in+Lincolnshire.+Guild+of+master+craftsmen.';
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();
};
