/* [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','2401',jdecode('Home'),jdecode(''), jdecode('%2F2401.html'), 'true',[],'',''],
	['PAGE','2473',jdecode('About+us'),jdecode(''), jdecode('%2F2473.html'), 'true',[],'',''],
	['PAGE','2452',jdecode('Contact+Us'),jdecode(''), jdecode('%2F2452.html'), 'true',[],'',''],
	['PAGE','2494',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F2494.html'), 'true',[],'',''],
	['PAGE','30301',jdecode('Inspection%2FEvaluation'),jdecode(''), jdecode('%2F30301.html'), 'true',[],'',''],
	['PAGE','5701',jdecode('Authorization+Form'),jdecode(''), jdecode('%2F5701.html'), 'true',[],'',''],
	['PAGE','5722',jdecode('2011+PRICING'),jdecode(''), jdecode('%2F5722.html'), 'true',[],'',''],
	['PAGE','23301',jdecode('Pant+Picture'),jdecode(''), jdecode('%2F23301.html'), 'true',[],'',''],
	['PAGE','23322',jdecode('Coat+Picture'),jdecode(''), jdecode('%2F23322.html'), 'true',[],'',''],
	['PAGE','25601',jdecode('Before+%26+After+Pics'),jdecode(''), jdecode('%2F25601.html'), 'true',[],'',''],
	['PAGE','16901',jdecode('TTKO+Pocket'),jdecode(''), jdecode('%2F16901.html'), 'true',[],'',''],
	['PAGE','56123',jdecode('Firefighter+Rental'),jdecode(''), jdecode('%2F56123.html'), 'true',[],'',''],
	['PAGE','37801',jdecode('Consulting'),jdecode(''), jdecode('%2F37801.html'), 'true',[],'',''],
	['PAGE','37501',jdecode('Movie+Credits'),jdecode(''), jdecode('%2F37501.html'), 'true',[],'',''],
	['PAGE','58623',jdecode('Specials'),jdecode(''), jdecode('%2F58623.html'), 'true',[],'','']];
var siteelementCount=15;
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 prodDef={
  wl_name: 'easycgi',
  product: 'WSCSYSSSSLY0XRNU'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Steel',
				paletteFamily: 	'CA0E0E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10808',
				graphicsetId: 	'11242',
				contentColor: 	'FFFFFF',
				contentBGColor: '4E4E4E',
				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: '20111027-081643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20101014-161608'
};
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:  '30301',
internalId:  '',
customField: '20090212-101454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20081230-144725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5722',
internalId:  '',
customField: '20111112-142621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37501',
internalId:  '',
customField: '20101014-161720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37801',
internalId:  '',
customField: '20101014-161407'
};
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: '20101014-161514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25601',
internalId:  '',
customField: '20101014-161542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56123',
internalId:  '',
customField: '20111103-163216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58623',
internalId:  '',
customField: '20111112-143955'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEXWH';
var companyName   = 'Trilex+Cleaners%2C+Inc.';
var htmlTitle	  = 'Trilex+Cleaners%2C+Inc.';
var metaKeywords  = 'trilex%2Ctrilex+cleaners%2Ctrilex+bunker+gear+cleaning%2C+turnout+cleaning%2C+personal+protective+equipment+cleaning%2Ccleaning++bunker+pants%2Ccleaning+bunker+coats%2C+turnout+gear+cleaning%2C+turnout+gear%2Cmorning+pride+turnout+gear+%2Cfiredex+turnout+gear%2Clion+turnout+gear%2Cglobe+turnout+gear%2Ccairns+turnout+gear%2Cmoisture+barrier+repair%2Cthermal+liner+repair%2Cnfpa+1851%2Cboots%2C+fire+helmets%2Cfire+gloves%2Cfire+hoods%2Cfire+department+cleaning+chemicals';
var metaContents  = 'Cleaning+and+repairs+of+personal+protective+equipment+for+first+responders%2Cfirefighters%2C+EMT+and+police.';
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();
};

