/* [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','1201',jdecode('Home'),jdecode(''),'/1201.html','true',[],'',''],
	['PAGE','1252',jdecode('About+Us'),jdecode(''),'/1252/index.html','true',[ 
		['PAGE','31401',jdecode('NATE+Certified+Techs'),jdecode(''),'/1252/31401.html','true',[],'',''],
		['PAGE','31422',jdecode('Comfort+Specialist'),jdecode(''),'/1252/31422.html','true',[],'',''],
		['PAGE','32101',jdecode('Our+Team'),jdecode(''),'/1252/32101.html','true',[],'','']
	],'',''],
	['PAGE','7901',jdecode('What+we+offer'),jdecode(''),'/7901/index.html','true',[ 
		['PAGE','7922',jdecode('Products'),jdecode(''),'/7901/7922.html','true',[],'',''],
		['PAGE','1315',jdecode('Specials'),jdecode(''),'/7901/1315.html','true',[],'',''],
		['PAGE','7943',jdecode('Tips+%26+Tricks'),jdecode(''),'/7901/7943.html','true',[],'','']
	],'',''],
	['PAGE','37114',jdecode('Replacements'),jdecode(''),'/37114/index.html','true',[ 
		['PAGE','39001',jdecode('Geothermal'),jdecode(''),'/37114/39001.html','true',[],'',''],
		['PAGE','1357',jdecode('Credit+Application'),jdecode(''),'/37114/1357.html','true',[],'','']
	],'',''],
	['PAGE','36862',jdecode('Service'),jdecode(''),'/36862.html','true',[],'',''],
	['PAGE','37893',jdecode('FAQ'),jdecode(''),'/37893.html','true',[],'',''],
	['PAGE','30101',jdecode('Newsletter'),jdecode(''),'/30101.html','true',[],'',''],
	['PAGE','1336',jdecode('Weather'),jdecode(''),'/1336.html','true',[],'',''],
	['PAGE','34158',jdecode('Available+Positions'),jdecode(''),'/34158/index.html','true',[ 
		['PAGE','37218',jdecode('Job+Application'),jdecode(''),'/34158/37218.html','true',[],'','']
	],'',''],
	['PAGE','35366',jdecode('Customer+Reviews'),jdecode(''),'/35366.html','true',[],'',''],
	['PAGE','34859',jdecode('Guestbook'),jdecode(''),'/34859/index.html','true',[ 
		['PAGE','34858',jdecode('Read+Guestbook'),jdecode(''),'/34859/34858.html','true',[],'','']
	],'',''],
	['PAGE','1378',jdecode('Contact+Us'),jdecode(''),'/1378/index.html','true',[ 
		['PAGE','21301',jdecode('Contact+%28follow+up+page%29'),jdecode(''),'/1378/21301.html','false',[],'',''],
		['PAGE','34877',jdecode('Map'),jdecode(''),'/1378/34877.html','true',[],'','']
	],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Boston';
theSitetree.paletteFamily='8BAD63';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11069';
theSitetree.graphicsetId='11841';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='66873E';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Boston',
				paletteFamily: 	'8BAD63',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11069',
				graphicsetId: 	'11841',
				contentColor: 	'FFFFFF',
				contentBGColor: '66873E',
				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['1002']=webappMappings['1002-34859ahw050ine0l8']={
webappId:    '1002',
documentId:  '34859',
internalId:  '34859ahw050ine0l8',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20090217-135809'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '34877',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1252',
internalId:  '',
customField: '20090203-160143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31401',
internalId:  '',
customField: '20081205-100446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31422',
internalId:  '',
customField: '20081205-100315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32101',
internalId:  '',
customField: '20090218-112454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20090217-164501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7922',
internalId:  '',
customField: '20090202-171459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1315',
internalId:  '',
customField: '20090217-135924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1357',
internalId:  '',
customField: '20090116-115710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7943',
internalId:  '',
customField: '20090203-155526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30101',
internalId:  '',
customField: '20081205-101626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1336',
internalId:  '',
customField: '20081205-101719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34158',
internalId:  '',
customField: '20090707-131314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35366',
internalId:  '',
customField: '20090202-172737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34859',
internalId:  '',
customField: '20081124-121409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34858',
internalId:  '',
customField: '20081003-113936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1378',
internalId:  '',
customField: '20090217-164732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21301',
internalId:  '',
customField: '20070524-125309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34877',
internalId:  '',
customField: '20081126-165009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36862',
internalId:  '',
customField: '20090202-171942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37114',
internalId:  '',
customField: '20081205-101328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37218',
internalId:  '',
customField: '20090305-131041'
};
webappMappings['1501']=webappMappings['1501-897370']={
webappId:    '1501',
documentId:  '1201',
internalId:  '897370',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37893',
internalId:  '',
customField: '20090320-120150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39001',
internalId:  '',
customField: '20090203-155108'
};
webappMappings['7008']=webappMappings['7008-1707']={
webappId:    '7008',
documentId:  '37893',
internalId:  '1707',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1201',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-9078']={
webappId:    '7008',
documentId:  '1378',
internalId:  '9078',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INE0L8';
var companyName   = 'Mainstream+Heating+%26+Cooling';
var htmlTitle	  = 'Mainstream+Heating+and+Cooling+-+Clarksville%2C+TN';
var metaKeywords  = 'HVAC%2C+heating%2C+cooling%2C+AC%2C+Mainstream%2C+air+conditioning%2C+Trane%2C+replacement%2C+installation%2C+service%2C+home+depot%2C+a%2Fc%2C+maintenance';
var metaContents  = 'HVAC%2C+heating%2C+cooling%2C+AC%2C+Mainstream%2C+air+conditioning%2C+Trane%2C+replacement%2C+installation%2C+service%2C+home+depot%2C+a%2Fc%2C+maintenance';
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();
};

