/* [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','901',jdecode('Home'),jdecode(''),'/901.html','true',[],''],
	['PAGE','952',jdecode('About+us'),jdecode(''),'/952/index.html','true',[ 
		['PAGE','973',jdecode('The+team'),jdecode(''),'/952/973.html','true',[],'']
	],''],
	['PAGE','12681',jdecode('Service'),jdecode(''),'/12681.html','true',[],''],
	['PAGE','994',jdecode('Products'),jdecode(''),'/994/index.html','true',[ 
		['PAGE','1015',jdecode('First+Product'),jdecode(''),'/994/1015.html','true',[],''],
		['PAGE','1036',jdecode('Second+Product'),jdecode(''),'/994/1036.html','true',[],''],
		['PAGE','1057',jdecode('Third+Product'),jdecode(''),'/994/1057.html','true',[],'']
	],''],
	['PAGE','1078',jdecode('Contact'),jdecode(''),'/1078/index.html','true',[ 
		['PAGE','1099',jdecode('Adresses'),jdecode(''),'/1078/1099.html','true',[],''],
		['PAGE','1120',jdecode('How+to+find+us'),jdecode(''),'/1078/1120.html','true',[],'']
	],''],
	['PAGE','5943',jdecode('Jobs'),jdecode(''),'/5943.html','true',[],''],
	['PAGE','1162',jdecode('Tips+and+tricks'),jdecode(''),'/1162.html','true',[],''],
	['PAGE','1141',jdecode('References'),jdecode(''),'/1141.html','true',[],''],
	['PAGE','5922',jdecode('Offers'),jdecode(''),'/5922.html','true',[],''],
	['PAGE','6401',jdecode('How+to+find+us'),jdecode(''),'/6401.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='6683B6';
theSitetree.keyvisualId='2458';
theSitetree.keyvisualName='immobilien.jpg';
theSitetree.fontsetId='406';
theSitetree.graphicsetId='461';
theSitetree.contentColor='2F325F';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Collage',
				paletteFamily: 	'6683B6',
				keyvisualId: 	'2458',
				keyvisualName: 	'immobilien.jpg',
				fontsetId: 		'406',
				graphicsetId: 	'461',
				contentColor: 	'2F325F',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'6683B6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20080424-165655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20080424-163411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1099',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1120',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1141',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1162',
internalId:  '',
customField: '20071205-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5922',
internalId:  '',
customField: '20080229-171306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5943',
internalId:  '',
customField: '20080229-171306'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INE2NU';
var companyName   = 'HUSH+AIR+Heating+%26+Air+Conditioning';
var htmlTitle	  = 'Heating++Air+Conditioning';
var metaKeywords  = 'Air+Conditioning++Heating++Trane++Tankless+Water+Heaters++Installation+HVAC';
var metaContents  = 'Riverside+Heating++Air+Conditioning++Service+Repair+HVAC++Installation+Central+Heating++Air+ConditioningRiversideHeatingAir+ConditioningHotColdWinterSummerAir+Conditioning+ContractorsHeating+ContractorsTraneWhole+house+fansinstall+air+conditioningHVACRiverside+Air+Conditioning';
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();
};
