/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','8043',jdecode('Service+NOW%21'),jdecode(''),'/8043/index.html','true',[ 
		['PAGE','15601',jdecode('Service+NOW%21+%28follow+up+page%29'),jdecode(''),'/8043/15601.html','false',[],'']
	],''],
	['PAGE','8001',jdecode('Installations'),jdecode(''),'/8001.html','true',[],''],
	['PAGE','452',jdecode('Service+Contracts'),jdecode(''),'/452.html','true',[],''],
	['PAGE','8064',jdecode('Request+A+Site+Visit'),jdecode(''),'/8064/index.html','true',[ 
		['PAGE','8106',jdecode('Commercial+'),jdecode(''),'/8064/8106.html','true',[],''],
		['PAGE','8127',jdecode('Residential+%26+Condominium+'),jdecode(''),'/8064/8127.html','true',[],'']
	],''],
	['PAGE','8190',jdecode('Contact'),jdecode(''),'/8190/index.html','true',[ 
		['PAGE','8211',jdecode('Adresses'),jdecode(''),'/8190/8211.html','true',[],''],
		['PAGE','8232',jdecode('How+to+find+us'),jdecode(''),'/8190/8232.html','true',[],'']
	],''],
	['PAGE','8253',jdecode('Tips+%26+Tricks'),jdecode(''),'/8253.html','true',[],''],
	['PAGE','24301',jdecode('About+us'),jdecode(''),'/24301.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='0A2447';
theSitetree.keyvisualId='2411';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='397';
theSitetree.graphicsetId='444';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='0A2447';
var theTemplate={
				name: 			'Amaze',
				paletteFamily: 	'0A2447',
				keyvisualId: 	'2411',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'397',
				graphicsetId: 	'444',
				contentColor: 	'DDDDDD',
				contentBGColor: '0A2447',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'0A2447',
				b_color: 		'081B35',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1030686']={
webappId:    '1501',
documentId:  '401',
internalId:  '1030686',
customField: '1501'
};
webappMappings['1001']=webappMappings['1001-ahw050inergb40e09f1961715990']={
webappId:    '1001',
documentId:  '8043',
internalId:  'ahw050inergb40e09f1961715990',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050inergb40e09f1961715990']={
webappId:    '1001',
documentId:  '15601',
internalId:  'ahw050inergb40e09f1961715990',
customField: 'followUp'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20080427-233519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20080314-232506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8253',
internalId:  '',
customField: '20080314-222823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8043',
internalId:  '',
customField: '20080226-035958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20080226-004600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20080209-174505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8064',
internalId:  '',
customField: '20080226-030606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8106',
internalId:  '',
customField: '20070420-013005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8127',
internalId:  '',
customField: '20080314-230037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8190',
internalId:  '',
customField: '20080226-041319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8211',
internalId:  '',
customField: '20080226-023237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8232',
internalId:  '',
customField: '20070420-013005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24301',
internalId:  '',
customField: '20080226-035433'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INERGB';
var companyName   = 'The+FRESH+AIR+COMPANY';
var htmlTitle	  = 'FreshAirNewYork';
var metaKeywords  = 'New+York++Heat++Heating++Air+Conditioning++A%2FC++Refrigeration++Fresh+Air++Fresh++Air%2C+The+Fresh+Air+Company%2C+Condominium+Service%2C++';
var metaContents  = 'Heating++Air+Conditioning++Refrigeration++Service';
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();
};
