/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],'',''],
	['PAGE','53',jdecode('Our+History'),jdecode(''),'/53.html','true',[],'',''],
	['PAGE','8601',jdecode('Associates-Friends'),jdecode(''),'/8601.html','true',[],'',''],
	['PAGE','146606',jdecode('Authorized+Brands'),jdecode(''),'/146606.html','true',[],'',''],
	['PAGE','140206',jdecode('Furnace+Installs'),jdecode(''),'/140206.html','true',[],'',''],
	['PAGE','140227',jdecode('Installation+Services'),jdecode(''),'/140227.html','true',[],'',''],
	['PAGE','8622',jdecode('Coupon+Offers'),jdecode(''),'/8622.html','true',[],'',''],
	['PAGE','140248',jdecode('Jobs'),jdecode(''),'/140248.html','true',[],'',''],
	['PAGE','8643',jdecode('Contact+US'),jdecode(''),'/8643.html','true',[],'',''],
	['PAGE','147006',jdecode('Zip+Codes+Covered'),jdecode(''),'/147006.html','true',[],'',''],
	['PAGE','151006',jdecode('General+Background+'),jdecode(''),'/151006.html','false',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='936251';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10450';
theSitetree.contentColor='2d1e19';
theSitetree.contentBGColor='936251';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Akropolis',
				paletteFamily: 	'936251',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				graphicsetId: 	'10450',
				contentColor: 	'2d1e19',
				contentBGColor: '936251',
				a_color: 		'936251',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8643',
internalId:  '',
customField: '20100722-112625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '140206',
internalId:  '',
customField: '20100722-112504'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8622',
internalId:  '',
customField: '20100722-112544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20100722-112418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20100722-113558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '140227',
internalId:  '',
customField: '20100722-113245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20100722-113502'
};
webappMappings['7008']=webappMappings['7008-2028']={
webappId:    '7008',
documentId:  '8643',
internalId:  '2028',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '140248',
internalId:  '',
customField: '20100722-112604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146606',
internalId:  '',
customField: '20100722-112229'
};
webappMappings['1501']=webappMappings['1501-7079573']={
webappId:    '1501',
documentId:  '32',
internalId:  '7079573',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147006',
internalId:  '',
customField: '20100722-113024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151006',
internalId:  '',
customField: '20100331-095715'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3QGO';
var companyName   = 'Appliance+Repairs++Chicago+Southside';
var htmlTitle	  = 'Appliance+Doctor+%3C%3E+appliance+repairs+Chicago+area++30+years++reliable+service';
var metaKeywords  = 'appliance+doctor%2Cappliancedoctor%2C+chicago+appliance+repair%2C+appliance%2Cmedics%2Cdoctor%2Crepair%2Cappliance+repair+chicago%2Cappliance+repairs%2Cappliancerepairs%2Cappliancemedics%2Cappliancemedic%2Cappliance+medic%2C+appliance+doctor+hvac%2Capplaince%2C+applaince+doctor%2C+kitchenaid%2Cwhirlpool%2Csubzero+repair%2Cviking+repair%2Cdacor+repair%2C+heating%2C+airconditioning%2C+central+air+repair%2Clg%2Cwasher%2Cdryer%2Crange%2Crefrigerator%2Cmicrowave%2Cfreezer%2Coven%2Cstove%2Cchicagoland%2Cfurnace%2Cair+conditioning%2C+installation%2C+high+end%2Cpremier+brands%2C+furnace+repair%2Chvac%2Cinstallation%2C';
var metaContents  = 'Appliance+Doctor+-+Appliance+Repair++Chicago+Areas+Servicer+of+High+End+Appliances+and+HVAC+';
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();
};
