/* [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','10001',jdecode('Home'),jdecode(''),'/10001.html','true',[],'',''],
	['PAGE','18501',jdecode('Key+Personnel'),jdecode(''),'/18501/index.html','true',[ 
		['PAGE','26901',jdecode('Brian+Keenan'),jdecode(''),'/18501/26901.html','true',[],'',''],
		['PAGE','26927',jdecode('Chris+Swann'),jdecode(''),'/18501/26927.html','true',[],'',''],
		['PAGE','26953',jdecode('Jon+Warnke'),jdecode(''),'/18501/26953.html','true',[],'','']
	],'',''],
	['PAGE','10078',jdecode('Our+Services'),jdecode(''),'/10078/index.html','true',[ 
		['PAGE','19801',jdecode('Business+Development'),jdecode(''),'/10078/19801.html','true',[],'',''],
		['PAGE','19001',jdecode('Feasibility+Studies'),jdecode(''),'/10078/19001.html','true',[],'',''],
		['PAGE','19401',jdecode('Design+Audits'),jdecode(''),'/10078/19401.html','true',[],'',''],
		['PAGE','19601',jdecode('Witness+Testing'),jdecode(''),'/10078/19601.html','true',[],'',''],
		['PAGE','20001',jdecode('Root+Cause+Failure+Analysis'),jdecode(''),'/10078/20001.html','true',[],'',''],
		['PAGE','19827',jdecode('Project+Management'),jdecode(''),'/10078/19827.html','true',[],'','']
	],'',''],
	['PAGE','18527',jdecode('Recent+Projects'),jdecode(''),'/18527.html','true',[],'',''],
	['PAGE','10104',jdecode('Staff+Experience'),jdecode(''),'/10104/index.html','true',[ 
		['PAGE','25901',jdecode('Business+Development'),jdecode(''),'/10104/25901.html','true',[],'',''],
		['PAGE','20127',jdecode('Applications'),jdecode(''),'/10104/20127.html','true',[],'',''],
		['PAGE','20153',jdecode('Design+Audits'),jdecode(''),'/10104/20153.html','true',[],'',''],
		['PAGE','20179',jdecode('Root+Cause+Failure+Analysis'),jdecode(''),'/10104/20179.html','true',[],'',''],
		['PAGE','20301',jdecode('Design+and+Contracting'),jdecode(''),'/10104/20301.html','true',[],'',''],
		['PAGE','20327',jdecode('Operation+Support'),jdecode(''),'/10104/20327.html','true',[],'','']
	],'',''],
	['PAGE','10130',jdecode('Contact+Information'),jdecode(''),'/10130.html','true',[],'',''],
	['PAGE','16901',jdecode('Technical+Papers'),jdecode(''),'/16901.html','true',[],'',''],
	['PAGE','16927',jdecode('Case+Studies'),jdecode(''),'/16927.html','true',[],'',''],
	['PAGE','16953',jdecode('Useful+Links'),jdecode(''),'/16953.html','true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Rectangle';
theSitetree.paletteFamily='FFFFFF';
theSitetree.keyvisualId='2505';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='451';
theSitetree.graphicsetId='506';
theSitetree.contentColor='033568';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rectangle',
				paletteFamily: 	'FFFFFF',
				keyvisualId: 	'2505',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'451',
				graphicsetId: 	'506',
				contentColor: 	'033568',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20090303-173336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10078',
internalId:  '',
customField: '20080910-201844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10104',
internalId:  '',
customField: '20081009-142705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10130',
internalId:  '',
customField: '20090109-005948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20080905-084345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16927',
internalId:  '',
customField: '20080718-182315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16953',
internalId:  '',
customField: '20091218-160037'
};
webappMappings['7008']=webappMappings['7008-1967']={
webappId:    '7008',
documentId:  '10130',
internalId:  '1967',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20080910-200327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18527',
internalId:  '',
customField: '20091218-155407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19001',
internalId:  '',
customField: '20090208-150539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20080721-211730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20080901-183136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20080902-114812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19827',
internalId:  '',
customField: '20080902-173502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20080902-173227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26901',
internalId:  '',
customField: '20080904-235610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25901',
internalId:  '',
customField: '20090109-000001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20127',
internalId:  '',
customField: '20090109-011142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20153',
internalId:  '',
customField: '20090109-010328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20179',
internalId:  '',
customField: '20090109-001027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20301',
internalId:  '',
customField: '20090109-002854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20327',
internalId:  '',
customField: '20090109-002447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26927',
internalId:  '',
customField: '20080904-234935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26953',
internalId:  '',
customField: '20080904-235701'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20IN2ZIK';
var companyName   = 'Compressor+Consulting+Limited+and+Associates';
var htmlTitle	  = '';
var metaKeywords  = 'compressor+consulting.compressor+applications.machinery+root+cause+failure+analysis.machinery+failure+analysis.air+separation+plant+project+management.air+separation+plant+commissioning.air+separation+plant+construction+managementbusiness+development+for+petrochemical+projects.';
var metaContents  = 'Compressor+Consulting+and+Associates+offers+consulting+support+for+compressor+applications%2C+root+cause+failure+annalysis%2C+witness+testing%2C+project+management+and+business+development+for+air+separation%2C+petrochemical+and+oil+and+gas+markets.+';
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();
};
