/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','4801',jdecode('Testimonials'),jdecode(''),'/4801.html','true',[],'',''],
	['PAGE','352',jdecode('About+us'),jdecode(''),'/352.html','true',[],'',''],
	['PAGE','394',jdecode('Foundation+Crack+Repair'),jdecode(''),'/394.html','true',[],'',''],
	['PAGE','8422',jdecode('Sump+Pumps'),jdecode(''),'/8422.html','true',[],'',''],
	['PAGE','47101',jdecode('Basement+Waterproofing'),jdecode(''),'/47101/index.html','true',[ 
		['PAGE','47122',jdecode('Interior+Drain+Tile+'),jdecode(''),'/47101/47122.html','true',[],'',''],
		['PAGE','47143',jdecode('Exterior+Drain+Tile'),jdecode(''),'/47101/47143.html','true',[],'','']
	],'',''],
	['PAGE','51401',jdecode('NexPump+Battery+Backup'),jdecode(''),'/51401.html','true',[],'',''],
	['PAGE','8401',jdecode('Dual+Pump+Backup+System'),jdecode(''),'/8401.html','true',[],'',''],
	['PAGE','47164',jdecode('Yard+Drainage+Solutions'),jdecode(''),'/47164.html','true',[],'',''],
	['PAGE','48101',jdecode('Healthy+Crawlspace+'),jdecode(''),'/48101.html','true',[],'',''],
	['PAGE','47501',jdecode('Egress+Windows'),jdecode(''),'/47501.html','true',[],'',''],
	['PAGE','8464',jdecode('Santa+Fe+Dehumidifier+'),jdecode(''),'/8464.html','true',[],'',''],
	['PAGE','5101',jdecode('Bowing+Basement+Walls'),jdecode(''),'/5101.html','true',[],'',''],
	['PAGE','97401',jdecode('Flood+Advice'),jdecode(''),'/97401.html','true',[],'',''],
	['PAGE','3801',jdecode('Contact+us'),jdecode(''),'/3801.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Easylife';
theSitetree.paletteFamily='41912E';
theSitetree.keyvisualId='5812';
theSitetree.keyvisualName='kv_5812.jpg';
theSitetree.fontsetId='11095';
theSitetree.graphicsetId='11872';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Easylife',
				paletteFamily: 	'41912E',
				keyvisualId: 	'5812',
				keyvisualName: 	'kv_5812.jpg',
				fontsetId: 		'11095',
				graphicsetId: 	'11872',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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['1501']=webappMappings['1501-2485786']={
webappId:    '1501',
documentId:  '301',
internalId:  '2485786',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100629-053819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '352',
internalId:  '',
customField: '20100425-195127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20100419-211300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8422',
internalId:  '',
customField: '20100509-210348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '394',
internalId:  '',
customField: '20100509-210219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47101',
internalId:  '',
customField: '20100420-205039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97401',
internalId:  '',
customField: '20100123-204338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8464',
internalId:  '',
customField: '20100110-103931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20100425-184054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20091112-214727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20100110-104045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47122',
internalId:  '',
customField: '20100110-103236'
};
webappMappings['7008']=webappMappings['7008-298']={
webappId:    '7008',
documentId:  '3801',
internalId:  '298',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47143',
internalId:  '',
customField: '20100110-103332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47164',
internalId:  '',
customField: '20100416-205921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47501',
internalId:  '',
customField: '20100213-112339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48101',
internalId:  '',
customField: '20100123-151742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51401',
internalId:  '',
customField: '20100419-211141'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVY31';
var companyName   = 'Reliable+Basement+Services%2C+LLC';
var htmlTitle	  = 'Basement+Waterproofing%2C+Sump+Pumps%2C+Drain+Tile+Systems%2C+Naperville%2C+Aurora%2C+Joliet%2C+Oswego';
var metaKeywords  = 'Basement+Waterproofing%2C+Crack+Repair%2C+Drain+Tile%2C+Sump+Pumps%2C+Battery+Backup+Sump+Pumps%2C+basement+remodeling%2C+crawl+space%2C+Naperville%2C+Oswego%2C+Plainfield%2C+Aurora%2C+Batavia';
var metaContents  = 'Offering+competitive+rates+for+installing+sump+pumps%2C+battery+back-ups%2C+basement+waterproofing%2C+crack+repair%2C+foundation+repair%2C+basement+finishing.+Naperville%2C+Aurora';
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();
};
