/* [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','5001',jdecode('Home'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','8105',jdecode('Contact+Details'),jdecode(''),'/8105.html','true',[],'',''],
	['PAGE','11201',jdecode('Email+Us'),jdecode(''),'/11201.html','true',[],'',''],
	['PAGE','5501',jdecode('Industrial+and+Commercial+Heating'),jdecode(''),'/5501.html','true',[],'',''],
	['PAGE','16701',jdecode('Domestic'),jdecode(''),'/16701.html','true',[],'',''],
	['PAGE','9301',jdecode('Electrical+Engineering'),jdecode(''),'/9301.html','true',[],'',''],
	['PAGE','9501',jdecode('Thermographic+Imaging'),jdecode(''),'/9501.html','true',[],'',''],
	['PAGE','5901',jdecode('Process+Applications'),jdecode(''),'/5901.html','true',[],'',''],
	['PAGE','6201',jdecode('Control+Panels'),jdecode(''),'/6201.html','true',[],'',''],
	['PAGE','6227',jdecode('Air-Conditioning+Systems'),jdecode(''),'/6227.html','true',[],'',''],
	['PAGE','6253',jdecode('Air+Handling+Units'),jdecode(''),'/6253.html','true',[],'',''],
	['PAGE','6279',jdecode('Boilers+And+Burners'),jdecode(''),'/6279.html','true',[],'',''],
	['PAGE','6305',jdecode('Energy+Management'),jdecode(''),'/6305.html','true',[],'',''],
	['PAGE','19401',jdecode('Steam'),jdecode(''),'/19401.html','true',[],'',''],
	['PAGE','19427',jdecode('Heating'),jdecode(''),'/19427.html','true',[],'',''],
	['PAGE','8001',jdecode('Design+and+Sales'),jdecode(''),'/8001.html','true',[],'',''],
	['PAGE','8053',jdecode('Health+and+Safety'),jdecode(''),'/8053.html','true',[],'',''],
	['PAGE','13901',jdecode('Tax+Dodging'),jdecode(''),'/13901.html','true',[],'',''],
	['PAGE','8079',jdecode('Carbon+Trust+Loans'),jdecode(''),'/8079.html','true',[],'',''],
	['PAGE','14501',jdecode('Latest+News'),jdecode(''),'/14501.html','true',[],'',''],
	['PAGE','6331',jdecode('Newsletters'),jdecode(''),'/6331.html','true',[],'',''],
	['PAGE','8027',jdecode('References'),jdecode(''),'/8027.html','true',[],'',''],
	['PAGE','7001',jdecode('Accreditation'),jdecode(''),'/7001.html','true',[],'',''],
	['PAGE','13401',jdecode('Links'),jdecode(''),'/13401.html','true',[],'',''],
	['PAGE','11601',jdecode('Search'),jdecode(''),'/11601.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC2323';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20090917-153645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20081203-100345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20081113-164255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20081115-110942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6227',
internalId:  '',
customField: '20081115-112132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6253',
internalId:  '',
customField: '20090917-154127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6279',
internalId:  '',
customField: '20100705-104307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6305',
internalId:  '',
customField: '20081128-163208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20100618-105932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6331',
internalId:  '',
customField: '20100618-105325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20081117-075932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8053',
internalId:  '',
customField: '20081126-104947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8079',
internalId:  '',
customField: '20090710-163157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8105',
internalId:  '',
customField: '20091130-104537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8027',
internalId:  '',
customField: '20100705-112826'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20081117-075600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20090917-153921'
};
webappMappings['7008']=webappMappings['7008-3209']={
webappId:    '7008',
documentId:  '11201',
internalId:  '3209',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20081126-090104'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '11601',
internalId:  'search',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20081126-105023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20100705-115617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20081128-163108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20100618-105733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20081203-100400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20090710-105936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19427',
internalId:  '',
customField: '20090710-105047'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INENWL';
var companyName   = 'Saunders+Specialised+Services+';
var htmlTitle	  = '';
var metaKeywords  = 'Service%2C+servicing%2C+heating%2C+air+conditioning%2C+heat%2C+saunders%2C+engineers%2C+air+handling+units%2C+gas%2C+oil%2C+boilers%2C+heaters%2C+steam%2C+industrial%2C+commercial%2C+installation%2C+install%2C+inspection%2C+testing%2C+maintenance%2C+thermographic%2C+LPG%2C+manufacture%2C+control+panels%2C+burners%2C+energy%2C+management%2C+radiators%2C+fuel%2C+Calor%2C+water+heaters%2C+tanks%2C+insulation%2C+duct%2C+spiral%2C+thermal%2C+process%2C+repairs%2C+powrmatic%2C+ambirad%2C+riello%2C+EOGB%2C+Daikin%2C+CORGI%2C+HVCA%2C+FSB%2C+NICEIC%2C+OFTEC%2C+nu-way%2C+electrical%2C+electrics%2C+electrician%2C+heat+recovery%2C+radiant%2C+solar%2C+warm+air%2C+welding%2C+fans%2C+extract%2C+safety%2C+pipe%2C+pipes%2C+piping%2C+plumbing%2C+plumb%2C+light%2C+lights%2C+lighting%2C+power%2C+distribution%2C+boards%2C+ventilaition%2C+flue%2C+flues%2C+calor+force%2C+calor+gas.';
var metaContents  = 'Service%2C+servicing%2C+heating%2C+air+conditioning%2C+heat%2C+saunders%2C+engineers%2C+air+handling+units%2C+gas%2C+oil%2C+boilers%2C+heaters%2C+steam%2C+industrial%2C+commercial%2C+installation%2C+install%2C+inspection%2C+testing%2C+maintenance%2C+thermographic%2C+LPG%2C+manufacture%2C+control+panels%2C+burners%2C+energy%2C+management%2C+radiators%2C+fuel%2C+Calor%2C+water+heaters%2C+tanks%2C+insulation%2C+duct%2C+spiral%2C+thermal%2C+process%2C+repairs%2C+powrmatic%2C+ambirad%2C+riello%2C+EOGB%2C+Daikin%2C+CORGI%2C+HVCA%2C+FSB%2C+NICEIC%2C+OFTEC%2C+nu-way%2C+electrical%2C+electrics%2C+electrician%2C+heat+recovery%2C+radiant%2C+solar%2C+warm+air%2C+welding%2C+fans%2C+extract%2C+safety%2C+pipe%2C+pipes%2C+piping%2C+plumbing%2C+plumb%2C+light%2C+lights%2C+lighting%2C+power%2C+distribution%2C+boards%2C+ventilaition%2C+flue%2C+flues%2C+calor+force%2C+calor+gas.';
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();
};
