/* [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','2101',jdecode('Home'),jdecode(''),'/2101.html','true',[],'',''],
	['PAGE','3501',jdecode('DrawCAD'),jdecode(''),'/3501/index.html','true',[ 
		['PAGE','2379',jdecode('DrawCAD+services'),jdecode(''),'/3501/2379.html','true',[],'',''],
		['PAGE','12001',jdecode('Business+Contact'),jdecode(''),'/3501/12001.html','false',[],'',''],
		['PAGE','12027',jdecode('Private+Client+Contact'),jdecode(''),'/3501/12027.html','false',[],'','']
	],'',''],
	['PAGE','3527',jdecode('Sustained+Power'),jdecode(''),'/3527/index.html','true',[ 
		['PAGE','4427',jdecode('Solar+Panel+Systems'),jdecode(''),'/3527/4427.html','true',[],'',''],
		['PAGE','4401',jdecode('Heat+Recovery+Ventilation'),jdecode(''),'/3527/4401.html','true',[],'',''],
		['PAGE','4453',jdecode('Heat+Source+Pump+Systems'),jdecode(''),'/3527/4453.html','false',[],'',''],
		['PAGE','4479',jdecode('Wind+Turbines'),jdecode(''),'/3527/4479.html','false',[],'',''],
		['PAGE','4505',jdecode('Hydro+Power+Generation'),jdecode(''),'/3527/4505.html','false',[],'','']
	],'',''],
	['PAGE','3553',jdecode('Central+Vacuum+Systems'),jdecode(''),'/3553/index.html','true',[ 
		['PAGE','19301',jdecode('CVS+For+the+Home'),jdecode(''),'/3553/19301.html','true',[],'',''],
		['PAGE','6801',jdecode('CVS+Technical+Information'),jdecode(''),'/3553/6801.html','true',[],'',''],
		['PAGE','19327',jdecode('CVS+Installers'),jdecode(''),'/3553/19327.html','true',[],'',''],
		['PAGE','17001',jdecode('CVS+Installation'),jdecode(''),'/3553/17001.html','true',[],'',''],
		['PAGE','6827',jdecode('CVS+Health+Benefits'),jdecode(''),'/3553/6827.html','true',[],'','']
	],'',''],
	['PAGE','25101',jdecode('Karndean+Flooring'),jdecode(''),'/25101/index.html','true',[ 
		['PAGE','25127',jdecode('Karndean+Domestic'),jdecode(''),'/25101/25127.html','true',[],'',''],
		['PAGE','25153',jdecode('Karndean+Commercial'),jdecode(''),'/25101/25153.html','true',[],'','']
	],'',''],
	['PAGE','19353',jdecode('Special+Events'),jdecode(''),'/19353.html','true',[],'',''],
	['PAGE','11627',jdecode('Online+Shop'),jdecode(''),'/11627.html','false',[],'',''],
	['PAGE','2431',jdecode('Terms'),jdecode(''),'/2431.html','true',[],'',''],
	['PAGE','10201',jdecode('Contact+Us'),jdecode(''),'/10201.html','true',[],'',''],
	['PAGE','11601',jdecode('Guest+Book'),jdecode(''),'/11601.html','true',[],'',''],
	['PAGE','24001',jdecode('Gallery'),jdecode(''),'/24001.html','true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Qben';
theSitetree.paletteFamily='92AA38';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17182';
theSitetree.graphicsetId='12658';
theSitetree.contentColor='2E2E2E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Qben',
				paletteFamily: 	'92AA38',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17182',
				graphicsetId: 	'12658',
				contentColor: 	'2E2E2E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'39E094',
				e_color: 		'9DCB6E',
				f_color: 		'DC9E3C',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20090719-093850'
};
webappMappings['7008']=webappMappings['7008-1017']={
webappId:    '7008',
documentId:  '12001',
internalId:  '1017',
customField: 'language:en;country:GB;'
};
webappMappings['4001']=webappMappings['4001-5631714']={
webappId:    '4001',
documentId:  '11627',
internalId:  '5631714',
customField: 'language:en;country:GB;'
};
webappMappings['1002']=webappMappings['1002-11601anbt20in2tut']={
webappId:    '1002',
documentId:  '11601',
internalId:  '11601anbt20in2tut',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3501',
internalId:  '',
customField: '20080506-090845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2379',
internalId:  '',
customField: '20080422-153553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3527',
internalId:  '',
customField: '20080506-090920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3553',
internalId:  '',
customField: '20081008-134240'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20080413-135931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4427',
internalId:  '',
customField: '20080419-161233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4453',
internalId:  '',
customField: '20080413-135931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4479',
internalId:  '',
customField: '20080413-135931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4505',
internalId:  '',
customField: '20080413-135931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20080506-091147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2431',
internalId:  '',
customField: '20080506-090416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11627',
internalId:  '',
customField: '20080506-091224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20080422-155805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12027',
internalId:  '',
customField: '20080422-155859'
};
webappMappings['1501']=webappMappings['1501-5480569']={
webappId:    '1501',
documentId:  '2101',
internalId:  '5480569',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6827',
internalId:  '',
customField: '20080417-154739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20080417-153920'
};
webappMappings['7008']=webappMappings['7008-963']={
webappId:    '7008',
documentId:  '10201',
internalId:  '963',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20080724-092942'
};
webappMappings['7008']=webappMappings['7008-1018']={
webappId:    '7008',
documentId:  '12027',
internalId:  '1018',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20080607-142344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19301',
internalId:  '',
customField: '20081008-095905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19327',
internalId:  '',
customField: '20081008-103931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19353',
internalId:  '',
customField: '20080729-184840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24001',
internalId:  '',
customField: '20081010-082008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25101',
internalId:  '',
customField: '20090718-132616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25127',
internalId:  '',
customField: '20090627-050324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25153',
internalId:  '',
customField: '20090627-050300'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20IN2TUT';
var companyName   = 'DrawCAD+Sustained+Power+Limited';
var htmlTitle	  = 'DrawCAD+Sustained+Power+Limited+%28Vacuduct+Distributor%29';
var metaKeywords  = 'CAD%2C+Design%2C+Drawing%2C+computer+aided+design%2C+draughting%2C+Planning+application%2C+building%2C+warrant%2C+project+management%2C+Central+Vacuum+Systems%2C+CVS%2C+Vacuum%2C+Solar%2C+Panel%2C+wind%2C+turbine%2C+sustainable%2C+renewable%2C+resoures';
var metaContents  = 'CAD+design+and+sustainable+power+service';
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();
};
