/* [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','2401',jdecode('Home'),jdecode(''),'/2401.html','true',[],''],
	['PAGE','2473',jdecode('About+us'),jdecode(''),'/2473/index.html','true',[ 
		['PAGE','2494',jdecode('How+to+find+us'),jdecode(''),'/2473/2494.html','true',[],'']
	],''],
	['PAGE','30301',jdecode('Inspection%2FEvaluation'),jdecode(''),'/30301.html','true',[],''],
	['PAGE','5701',jdecode('Authorization+Form'),jdecode(''),'/5701.html','true',[],''],
	['PAGE','5722',jdecode('Pant+Form%2FPricing'),jdecode(''),'/5722.html','true',[],''],
	['PAGE','23301',jdecode('Pant+Picture'),jdecode(''),'/23301.html','true',[],''],
	['PAGE','5743',jdecode('Coat+Form%2FPricing'),jdecode(''),'/5743.html','true',[],''],
	['PAGE','23322',jdecode('Coat+Picture'),jdecode(''),'/23322.html','true',[],''],
	['PAGE','8601',jdecode('Miscellaneous+Cleaning'),jdecode(''),'/8601.html','true',[],''],
	['PAGE','26101',jdecode('Contract+Cleaning'),jdecode(''),'/26101.html','true',[],''],
	['PAGE','25601',jdecode('Before+%26+After+Pics'),jdecode(''),'/25601.html','true',[],''],
	['PAGE','2452',jdecode('Contact+Us'),jdecode(''),'/2452.html','true',[],''],
	['PAGE','16901',jdecode('TTKO+Pocket'),jdecode(''),'/16901.html','true',[],''],
	['PAGE','37501',jdecode('Movie+Credits'),jdecode(''),'/37501.html','true',[],''],
	['PAGE','37801',jdecode('Consulting'),jdecode(''),'/37801.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Steel';
theSitetree.paletteFamily='CA0E0E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10808';
theSitetree.graphicsetId='11242';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4E4E4E';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Steel',
				paletteFamily: 	'CA0E0E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10808',
				graphicsetId: 	'11242',
				contentColor: 	'FFFFFF',
				contentBGColor: '4E4E4E',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20090805-090406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20090603-114110'
};
webappMappings['7008']=webappMappings['7008-11752']={
webappId:    '7008',
documentId:  '2452',
internalId:  '11752',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2494',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2473',
internalId:  '',
customField: '20090113-085300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2494',
internalId:  '',
customField: '20081229-090800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20081230-144937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20090212-101454'
};
webappMappings['1501']=webappMappings['1501-14441778']={
webappId:    '1501',
documentId:  '2401',
internalId:  '14441778',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20081230-144725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5722',
internalId:  '',
customField: '20081230-144817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5743',
internalId:  '',
customField: '20081230-144909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37501',
internalId:  '',
customField: '20090619-155027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37801',
internalId:  '',
customField: '20090619-160321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20090107-142543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23301',
internalId:  '',
customField: '20090113-084328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23322',
internalId:  '',
customField: '20090113-084543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25601',
internalId:  '',
customField: '20090116-124816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20090512-133523'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEXWH';
var companyName   = 'Trilex+Cleaners%2C+Inc.';
var htmlTitle	  = 'Trilex+Cleaners%2C+Inc.';
var metaKeywords  = 'trilex%2C+personal+protective+equipment%2C+bunker+pants%2C+bunker+coats%2C+turnout+gear+cleaning%2C+turnout+gear%2Cmorning+pride%2Cfiredex%2Clion%2Cglobe%2Ccairns%2Cmoisture+barrier+repair%2Cthermal+liner+repair%2Cnfpa+1851%2Cboots%2C+helmets%2C+gloves%2C+hoods%2Cfire+departments';
var metaContents  = 'Service+to+Americas+first+responders+for+the+cleaning+and+repairs+of+Personal+Protective+Equipment';
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();
};
