/* [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 theSitetree=[ 
	['PAGE','501',jdecode('Home'),jdecode(''),'/501/index.html','true',[ 
		['PAGE','657',jdecode('Services'),jdecode(''),'/501/657.html','true',[],''],
		['PAGE','32401',jdecode('Jobsite+Photos'),jdecode(''),'/501/32401.html','true',[],'']
	],''],
	['PAGE','94201',jdecode('Line+Sheet'),jdecode(''),'/94201.html','true',[],''],
	['PAGE','615',jdecode('Filtration+Equipment'),jdecode(''),'/615/index.html','true',[ 
		['PAGE','25101',jdecode('KELSO+Air+Cleaners'),jdecode(''),'/615/25101.html','true',[],''],
		['PAGE','97401',jdecode('Rotoclones'),jdecode(''),'/615/97401.html','true',[],''],
		['PAGE','21222',jdecode('Dust+Collectors'),jdecode(''),'/615/21222.html','true',[],''],
		['PAGE','92401',jdecode('Source+Capture+Arms'),jdecode(''),'/615/92401.html','true',[],''],
		['PAGE','21243',jdecode('Replacement+Filters'),jdecode(''),'/615/21243.html','true',[],''],
		['PAGE','21264',jdecode('Filtration+Systems'),jdecode(''),'/615/21264.html','true',[],''],
		['PAGE','21285',jdecode('Scrubbers'),jdecode(''),'/615/21285.html','true',[],''],
		['PAGE','21306',jdecode('Fans'),jdecode(''),'/615/21306.html','true',[],'']
	],''],
	['PAGE','594',jdecode('FRP+Plastics+'),jdecode(''),'/594/index.html','true',[ 
		['PAGE','21327',jdecode('Grating'),jdecode(''),'/594/21327.html','true',[],''],
		['PAGE','35701',jdecode('Plate+%26+Treads'),jdecode(''),'/594/35701.html','true',[],''],
		['PAGE','35743',jdecode('Handrail%2FLadders'),jdecode(''),'/594/35743.html','true',[],''],
		['PAGE','35722',jdecode('Platforms'),jdecode(''),'/594/35722.html','true',[],''],
		['PAGE','21348',jdecode('Tanks'),jdecode(''),'/594/21348.html','true',[],''],
		['PAGE','21369',jdecode('Buildings'),jdecode(''),'/594/21369.html','true',[],''],
		['PAGE','21390',jdecode('Track+Pans'),jdecode(''),'/594/21390.html','true',[],''],
		['PAGE','21411',jdecode('Dome+Covers'),jdecode(''),'/594/21411.html','true',[],''],
		['PAGE','21432',jdecode('Trench+Drains'),jdecode(''),'/594/21432.html','true',[],''],
		['PAGE','21453',jdecode('Weirs%2C+Baffles'),jdecode(''),'/594/21453.html','true',[],''],
		['PAGE','29201',jdecode('Troughs'),jdecode(''),'/594/29201.html','true',[],''],
		['PAGE','84001',jdecode('Density+Current+Baffles'),jdecode(''),'/594/84001.html','true',[],''],
		['PAGE','84022',jdecode('Gates+%26+Guide+Frames'),jdecode(''),'/594/84022.html','true',[],''],
		['PAGE','84043',jdecode('Launder+Covers'),jdecode(''),'/594/84043.html','true',[],'']
	],''],
	['PAGE','42501',jdecode('Vaughan+Pumps+%26+Rotamix'),jdecode(''),'/42501/index.html','true',[ 
		['PAGE','636',jdecode('Vaughan+Pumps'),jdecode(''),'/42501/636.html','true',[],''],
		['PAGE','79501',jdecode('Rotamix'),jdecode(''),'/42501/79501.html','true',[],'']
	],''],
	['PAGE','12201',jdecode('Duct'),jdecode(''),'/12201.html','true',[],''],
	['PAGE','21201',jdecode('Contact+Us'),jdecode(''),'/21201.html','true',[],'']];
var siteelementCount=33;
theSitetree.topTemplateName='echo';
theSitetree.paletteFamily='712A2B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10403';
theSitetree.graphicsetId='10630';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'echo',
				paletteFamily: 	'712A2B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10403',
				graphicsetId: 	'10630',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-6ca5504a38187461ecd561883b0f7e16']={
webappId:    '7060',
documentId:  '32401',
internalId:  '6ca5504a38187461ecd561883b0f7e16',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20071217-154429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25101',
internalId:  '',
customField: '20071030-033530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21222',
internalId:  '',
customField: '20070804-043716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92401',
internalId:  '',
customField: '20071217-154902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21243',
internalId:  '',
customField: '20071026-091859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21264',
internalId:  '',
customField: '20071030-092631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21285',
internalId:  '',
customField: '20071106-074731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21306',
internalId:  '',
customField: '20071031-091635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100125-151856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21327',
internalId:  '',
customField: '20091109-093605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35701',
internalId:  '',
customField: '20091109-094937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35743',
internalId:  '',
customField: '20071106-092349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35722',
internalId:  '',
customField: '20071213-134906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21348',
internalId:  '',
customField: '20071106-111211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21369',
internalId:  '',
customField: '20071101-024501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21390',
internalId:  '',
customField: '20071112-091436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21411',
internalId:  '',
customField: '20071213-145358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21432',
internalId:  '',
customField: '20071112-110907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21453',
internalId:  '',
customField: '20071112-062305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29201',
internalId:  '',
customField: '20071112-064441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84001',
internalId:  '',
customField: '20071112-070123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84022',
internalId:  '',
customField: '20071112-073040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84043',
internalId:  '',
customField: '20071112-074859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20071207-143542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20071207-141534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79501',
internalId:  '',
customField: '20071207-140106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20071217-142206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100204-113852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20070614-094921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32401',
internalId:  '',
customField: '20070804-055406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21201',
internalId:  '',
customField: '20100129-105811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94201',
internalId:  '',
customField: '20100129-110036'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97401',
internalId:  '',
customField: '20100126-102724'
};
webappMappings['1501']=webappMappings['1501-26995861']={
webappId:    '1501',
documentId:  '501',
internalId:  '26995861',
customField: '1501'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INXXWA';
var companyName   = 'KELSO+Industrial';
var htmlTitle	  = 'KELSO+Industrial';
var metaKeywords  = '';
var metaContents  = '';
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();
};
