/* [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','732',jdecode('Home'),jdecode(''),'/732.html','true',[],''],
	['PAGE','301',jdecode('About+Us'),jdecode(''),'/301.html','true',[],''],
	['PAGE','47101',jdecode('Products++'),jdecode(''),'/47101.html','false',[],''],
	['PAGE','522',jdecode('Services'),jdecode(''),'/522/index.html','true',[ 
		['PAGE','606',jdecode('+'),jdecode(''),'/522/606.html','true',[],''],
		['PAGE','543',jdecode('Plumbing'),jdecode(''),'/522/543.html','true',[],''],
		['PAGE','564',jdecode('Heating'),jdecode(''),'/522/564.html','true',[],''],
		['PAGE','585',jdecode('HVAC'),jdecode(''),'/522/585.html','true',[],'']
	],''],
	['PAGE','12601',jdecode('Photo+Gallery'),jdecode(''),'/12601.html','true',[],''],
	['PAGE','62701',jdecode('Testimonials'),jdecode(''),'/62701.html','true',[],''],
	['PAGE','96801',jdecode('References'),jdecode(''),'/96801.html','false',[],''],
	['PAGE','67401',jdecode('Energy+Savers'),jdecode(''),'/67401.html','false',[],''],
	['PAGE','41501',jdecode('Pricing'),jdecode(''),'/41501.html','true',[],''],
	['PAGE','711',jdecode('Contact+Us'),jdecode(''),'/711.html','true',[],''],
	['PAGE','8101',jdecode('Map'),jdecode(''),'/8101.html','false',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Digital';
theSitetree.paletteFamily='010128';
theSitetree.keyvisualId='354';
theSitetree.keyvisualName='abschluss.jpg';
theSitetree.fontsetId='37';
theSitetree.graphicsetId='42';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='010128';
var theTemplate={
				name: 			'Digital',
				paletteFamily: 	'010128',
				keyvisualId: 	'354',
				keyvisualName: 	'abschluss.jpg',
				fontsetId: 		'37',
				graphicsetId: 	'42',
				contentColor: 	'FFFFFF',
				contentBGColor: '010128',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'010128',
				b_color: 		'DEFDFB',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '301',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US:'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '8101',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['7060']=webappMappings['7060-3fa214e7819e604d83c863e6e03dd0a4']={
webappId:    '7060',
documentId:  '12601',
internalId:  '3fa214e7819e604d83c863e6e03dd0a4',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '732',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2176601']={
webappId:    '1501',
documentId:  '732',
internalId:  '2176601',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-820']={
webappId:    '7008',
documentId:  '711',
internalId:  '820',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '732',
internalId:  '',
customField: '20091229-175045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20091226-095309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '522',
internalId:  '',
customField: '20091226-095422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '543',
internalId:  '',
customField: '20100126-155130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '564',
internalId:  '',
customField: '20100307-093443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '585',
internalId:  '',
customField: '20100121-140554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '606',
internalId:  '',
customField: '20080620-093425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62701',
internalId:  '',
customField: '20100308-115121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12601',
internalId:  '',
customField: '20091226-095550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '711',
internalId:  '',
customField: '20100110-210003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20081215-075904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96801',
internalId:  '',
customField: '20100125-071922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67401',
internalId:  '',
customField: '20091128-201236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47101',
internalId:  '',
customField: '20091226-095344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41501',
internalId:  '',
customField: '20091226-095657'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INX243';
var companyName   = 'BONDED+MECHANICAL+CORP.';
var htmlTitle	  = 'Plumbing%2C+Heating+%26+Cooling+Contractor';
var metaKeywords  = 'plumbing%2Cplumbing+and+heating%2Cair+conditioning%2Chvac%2Cheatpump%2Cthermostat%2Chigh+efficiency%2Cradiant+heat%2Cfurnaces%2Cboilers%2Cbaseboard%2Cheatpumps%2Cplumbing+repairs%2Cmini+split++a%2Fc%2Ctankless+water+heater%2Cgas+heat%2C+oil+heat%2Celectric+heat%2Cheat+pumps%2Ccooling%2Cshowers%2Cbathrooms%2Cbathroom+remodeling%2Cfaucets%2Cpiping%2Ccopper+piping%2Cpex+piping%2Cpvc%2Cdwv%2Chumidifiers%2Ciaq%2Cair+quality%2Cair+filters%2Csteam+mist%2Cmr+steam%2C+steam+showers%2Cbonded%2Cbonded+mechanical%2Cbonded+mechanical+corp.';
var metaContents  = 'Plumbing%2C+Heating+and+Cooling+services+company.+We+are+in+the+comfort+business+and+can+help+you+with+all+of+your+Plumbing+or+Climate+Control+issues.+From+the+smallest+residential+repair+to+complete+design+and+installation+of+commercial+systems+and+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();
};
