/* [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','601',jdecode('Home'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','4901',jdecode('Terry%26%23x27%3Bs+Tip+of+the+month'),jdecode(''), jdecode('%2F4901%2Findex.html'), 'true',[ 
		['PAGE','4922',jdecode('The+team'),jdecode(''), jdecode('%2F4901%2F4922.html'), 'true',[],'','']
	],'',''],
	['PAGE','4943',jdecode('New'),jdecode(''), jdecode('%2F4943.html'), 'true',[],'',''],
	['PAGE','44701',jdecode('Duct+Cleaning+Service'),jdecode(''), jdecode('%2F44701.html'), 'true',[],'',''],
	['PAGE','5301',jdecode('Products'),jdecode(''), jdecode('%2F5301%2Findex.html'), 'true',[ 
		['PAGE','5322',jdecode('Air+Conditioning'),jdecode(''), jdecode('%2F5301%2F5322.html'), 'true',[],'',''],
		['PAGE','5343',jdecode('Heating+'),jdecode(''), jdecode('%2F5301%2F5343.html'), 'true',[],'',''],
		['PAGE','5364',jdecode('Air+Cleaners+'),jdecode(''), jdecode('%2F5301%2F5364.html'), 'true',[],'',''],
		['PAGE','12801',jdecode('Thermostats'),jdecode(''), jdecode('%2F5301%2F12801.html'), 'true',[],'',''],
		['PAGE','12822',jdecode('Humidification'),jdecode(''), jdecode('%2F5301%2F12822.html'), 'true',[],'',''],
		['PAGE','36301',jdecode('H20+Heaters'),jdecode(''), jdecode('%2F5301%2F36301.html'), 'true',[],'','']
	],'',''],
	['PAGE','5385',jdecode('Thank+You+%21%21%21'),jdecode(''), jdecode('%2F5385.html'), 'true',[],'',''],
	['PAGE','5406',jdecode('%22Special+Rebates%22'),jdecode(''), jdecode('%2F5406.html'), 'true',[],'',''],
	['PAGE','5427',jdecode('Contact'),jdecode(''), jdecode('%2F5427%2Findex.html'), 'true',[ 
		['PAGE','5448',jdecode('Address'),jdecode(''), jdecode('%2F5427%2F5448.html'), 'true',[],'',''],
		['PAGE','5469',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F5427%2F5469.html'), 'true',[],'','']
	],'',''],
	['PAGE','5490',jdecode('About+Us'),jdecode(''), jdecode('%2F5490.html'), 'true',[],'',''],
	['PAGE','7706',jdecode('Guestbook'),jdecode(''), jdecode('%2F7706%2Findex.html'), 'true',[ 
		['PAGE','7701',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F7706%2F7701.html'), 'false',[],'','']
	],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Stars';
theSitetree.paletteFamily='3C5284';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10466';
theSitetree.graphicsetId='10913';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3C5284';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stars',
				paletteFamily: 	'3C5284',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10466',
				graphicsetId: 	'10913',
				contentColor: 	'FFFFFF',
				contentBGColor: '3C5284',
				a_color: 		'3C5284',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20111130-231257'
};
webappMappings['1002']=webappMappings['1002-7706AHW050INE72F']={
webappId:    '1002',
documentId:  '7706',
internalId:  '7706AHW050INE72F',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20111130-231136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4922',
internalId:  '',
customField: '20070408-190030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4943',
internalId:  '',
customField: '20111107-071530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20110923-090907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5322',
internalId:  '',
customField: '20080908-191648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5343',
internalId:  '',
customField: '20070825-164321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5364',
internalId:  '',
customField: '20070825-164500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20070825-164623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12822',
internalId:  '',
customField: '20070825-233903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5385',
internalId:  '',
customField: '20110802-205318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5406',
internalId:  '',
customField: '20111107-071644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5427',
internalId:  '',
customField: '20110504-094433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5448',
internalId:  '',
customField: '20071117-133536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5469',
internalId:  '',
customField: '20070404-200338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5490',
internalId:  '',
customField: '20100404-081751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7706',
internalId:  '',
customField: '20070408-182712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20070408-182712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36301',
internalId:  '',
customField: '20110923-090545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44701',
internalId:  '',
customField: '20111201-175654'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INE72F';
var companyName   = 'T.J.Air+Heating+%26+Cooling';
var htmlTitle	  = '';
var metaKeywords  = '%3C%2Fhead%3E%0D%0A%3Ctitle%3EContact+TJ+Air+%7C++Heating+%26+Cooling+Specialists+%3C%2Ftitle%3E%0D%0A%3Cmeta+name%3D%22Description%22+content%3D%22TJ+Air-contact+us+with+any+questions+concerning+your+heating+and+cooling+needs.+Servicing+Macomb+%26+Oakland+Counties%2C+Michigan%22%3E%0D%0A%3Cmeta+name%3D%22Keywords%22+content%3D%22Michigan+heating+%26+cooling+repair%2C+replacement%2C+furnace%2C+hot+water+heater+and+air+conditioning%22%3E%0D%0A%3CMETA+http-equiv%3D%22Content-Language%22+content%3D%22en%22%3E+++++++%0D%0A%3CMETA+name%3D%22revisit-after%22+content%3D%2215+days%22%3E%0D%0A%3CMETA+name%3D%22Author%22+content%3D%22TJ+AIR%2C+www.tjair1.com%22%3E%0D%0A%3CMETA+name%3D%22robots%22+content%3D%22index%2C+follow%22%3E%0D%0A%3CMETA+name%3D%22Rating%22+content%3D%22General%22%3E%0D%0A%3CMETA+name%3D%22Robots%22+content%3D%22All%22%3E%0D%0A%3CMeta+name%3D%22Googlebot%22+content%3D%22noarchive%22%3E%0D%0A%3CMeta+name%3D%22Googlebot%22+content%3D%22index%2Cfollow%22%3E%0D%0A%3C%2Fhead%3E%0D%0A';
var metaContents  = 'Macomb+Heating+and+Cooling+Contractors%2C+Michigan+Heating+and+Cooling+Contractors%2C+Michigan+Heating+and+Cooling+Service%2C+Michigan+Heating+and+Cooling+Repair%2C+Residential+Air+Conditioning+Service%2C+air+conditioning+contractors%2C+Macomb+air+conditioning+contractors%2C+Macomb+County+air+conditioning+contractors%2C+Oakland+air+conditioning+contractors%2C+Oakland+County+air+conditioning+contractors%2C+Oakland+County+air+conditioning+service+and+repair%2Cair+conditioning%2C+Macomb+air+conditioning%2C+Macomb+County+air+conditioning%2C+Oakland+County+air+conditioning%2C+air+conditioning+service%2C+Michigan+air+conditioning+service%2C+Macomb+air+conditioning+service%2C+Macomb+County+air+conditioning+service%2C+Oakland+County+air+conditioning+service%2C+Oakland+air+conditioning+service%2C%0D%0A%0D%0A%0D%0A%0D%0Aair+conditioning+repair%2C+Michigan+air+conditioning+repair%2C+Macomb+Township+air+conditioning+repair%2C%0D%0A%0D%0A%0D%0A%0D%0AMacomb+air+conditioning+repair%2C+Macomb+County+air+conditioning+repair%2C+Macomb+air+conditioning+contractor%2C+Oakland+air+conditioning+repair%2C+Oakland+County+air+conditioning+repair%2C+Macomb+air+conditioning+service+and+repair%2C+Macomb+Township+air+conditioning+service+and+repair%2C+Michigan+air+conditioning+service+and+repair%2C+Macomb+air%2C+Macomb+A%2FC+repair%2C+Macomb+Heating+and+Cooling%2C+air%2C+central+air+conditioning%2C+residential+air+conditioning%2C+Heating+and+cooling%2C+Macomb+heating+and+cooling%2C+Oakland+heating+and+cooling%2C+heating%2C+heating+contractors%2C+heating+and+air%2C%0D%0A%0D%0A%0D%0A%0D%0Aheating+and+air+service+and+repair%2C+heating+and+air+conditioning%2C+heating+and+air+conditioning+service+and+repair%2C+HVAC+systems%2C+Residential+HVAC+Installations%2C+air+conditioning+equipment%2C%0D%0A%0D%0A%0D%0A%0D%0Aheating+and+cooling%2C+contractor%2C+cooling%2C+heating+equipment%2C';
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();
};

