/* [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','4201',jdecode('Home'),jdecode(''), jdecode('%2F4201.html'), 'true',[],'',''],
	['PAGE','5401',jdecode('Schedule+A+Call'),jdecode(''), jdecode('%2F5401.html'), 'true',[],'',''],
	['PAGE','40501',jdecode('Pests+to+Look+Out+for'),jdecode(''), jdecode('%2F40501.html'), 'false',[],'',''],
	['PAGE','5422',jdecode('Termite+Protection'),jdecode(''), jdecode('%2F5422.html'), 'true',[],'',''],
	['PAGE','5443',jdecode('Pest+Control'),jdecode(''), jdecode('%2F5443.html'), 'true',[],'',''],
	['PAGE','12901',jdecode('Real+Estate+Reports'),jdecode(''), jdecode('%2F12901.html'), 'true',[],'',''],
	['PAGE','5464',jdecode('Home+Maintenance'),jdecode(''), jdecode('%2F5464.html'), 'true',[],'',''],
	['PAGE','15301',jdecode('Customers+Letters'),jdecode(''), jdecode('%2F15301.html'), 'true',[],'',''],
	['PAGE','5506',jdecode('Press+Release'),jdecode(''), jdecode('%2F5506.html'), 'true',[],'',''],
	['PAGE','5548',jdecode('Affiliates'),jdecode(''), jdecode('%2F5548.html'), 'true',[],'',''],
	['PAGE','19501',jdecode('Ask+an+Expert'),jdecode(''), jdecode('%2F19501.html'), 'false',[],'',''],
	['PAGE','29101',jdecode('Customer'),jdecode(''), jdecode('%2F29101.html'), 'false',[],'',''],
	['PAGE','5485',jdecode('Holiday+Lighting'),jdecode(''), jdecode('%2F5485.html'), 'true',[],'',''],
	['PAGE','22601',jdecode('Products'),jdecode(''), jdecode('%2F22601%2Findex.html'), 'false',[ 
		['PAGE','22622',jdecode('Current+offers'),jdecode(''), jdecode('%2F22601%2F22622.html'), 'true',[],'','']
	],'',''],
	['PAGE','21722',jdecode('Just+for+Fun'),jdecode(''), jdecode('%2F21722.html'), 'false',[],'',''],
	['PAGE','42801',jdecode('Christmas+Store'),jdecode(''), jdecode('%2F42801.html'), 'false',[],'',''],
	['PAGE','15501',jdecode('Pests+to+Look+Out+For'),jdecode(''), jdecode('%2F15501.html'), 'true',[],'',''],
	['PAGE','21701',jdecode('Special+Offer'),jdecode(''), jdecode('%2F21701.html'), 'true',[],'',''],
	['PAGE','5527',jdecode('Contact'),jdecode(''), jdecode('%2F5527.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Concise';
theSitetree.paletteFamily='E11923';
theSitetree.keyvisualId='7262';
theSitetree.keyvisualName='kv_7262.jpg';
theSitetree.fontsetId='16441';
theSitetree.graphicsetId='12140';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLY0XNM4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Concise',
				paletteFamily: 	'E11923',
				keyvisualId: 	'7262',
				keyvisualName: 	'kv_7262.jpg',
				fontsetId: 		'16441',
				graphicsetId: 	'12140',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20111101-112238'
};
webappMappings['7008']=webappMappings['7008-6895']={
webappId:    '7008',
documentId:  '5401',
internalId:  '6895',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20110214-205842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5422',
internalId:  '',
customField: '20110214-210034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5443',
internalId:  '',
customField: '20111101-100225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5548',
internalId:  '',
customField: '20110222-084113'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20111101-100313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5527',
internalId:  '',
customField: '20110214-220736'
};
webappMappings['1002']=webappMappings['1002-19501ahw050inzjqw']={
webappId:    '1002',
documentId:  '19501',
internalId:  '19501ahw050inzjqw',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15301',
internalId:  '',
customField: '20110311-110109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20111101-110258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5506',
internalId:  '',
customField: '20100314-114053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5485',
internalId:  '',
customField: '20111102-113331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5464',
internalId:  '',
customField: '20100826-143705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20100314-114808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21701',
internalId:  '',
customField: '20110214-220033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21722',
internalId:  '',
customField: '20100314-114924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20100314-130214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22622',
internalId:  '',
customField: '20100314-130214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29101',
internalId:  '',
customField: '20100720-110116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40501',
internalId:  '',
customField: '20110621-174540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42801',
internalId:  '',
customField: '20111102-112822'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INZJQW';
var companyName   = 'Reverse+the+EEK+%26+call+KEE+today+%28901%29366-7378%21';
var htmlTitle	  = 'Kee+Pest+Control%2C+Inc.';
var metaKeywords  = 'control+pests%2C+termites%2C+termite%2C+moisture%2C+fungus%2C+wasps%2C+wasp%2C+yellow+jacket%2C+yellow+jackets%2C+ant%2C+ants%2C+spider%2C+spiders%2C+silverfish%2C+flea%2C+fleas%2C+earwigs%2C+earwig%2C+beetles%2C+beetle%2C+roach%2C+roaches%2C+rat%2C+rats%2C+mouse%2C+mice%2C+black+widow%2C+black+widows%2C+brown+recluse%2C+brown+widow%2C+brown+widows%2C+bed+bug%2C+bed+bugs%2C+fly%2C+flies%2C+floor+jack%2C+floor+jacks%2C+ventilation%2C+vent%2C+vents%2C+tempvent%2C+tempvents%2C+moisture+barrier%2C+moisture+barriers%2C+same+day+service%2C+gaurantee%2C+gauranteed%2C+warranty%2C+damage+repalcement+warranty%2C+warranties%2C+friendly%2C+all+natural+products%2C+green+products%2C+odor+control%2C+terminix%2C+orkin%2C+cook%27s%2C+wdi%2C+clearance+letter%2C+key+pest+control%2C+bed+bug%2C+bed+bugs%2C+mosquito%2C+mosquitos%2C+damage';
var metaContents  = 'Kee+can+control+all+bugs%2C+termites%2C+moisture%2C+fungus%2C+wasps%2C+yellow+jackets%2C+ants%2C+spiders%2C+silverfish%2C+fleas%2C+earwigs%2C+beetles%2C+roaches%2C+rats%2C+mice%2C+black+widows%2C+brown+recluse%2C+brown+widows%2C+bed+bugs%2C+mold%2C+and+flies.+Kee+Pest+Control+is+licensed%2C+bonded%2C+and+chartered.+Qualified+to+work+in+Tennessee+and+Mississippi.+Memphis%2C+Collierville%2C+Orange+Mound%2C+Whitehaven%2C+Southaven%2C+Byhalia%2C+Nesbitt%2C+Millington%2C+midtown%2C+Atoka%2C+Munford%2C+Oakland%2C+Lakeland%2C+Arlington%2C+Raliegh%2C+Horn+Lake%2C+Walls%2C+Frayser%2C+Olive+Branch%2C+Germantown%2C+Cordova%2C+Bartlett%2C+Berclair.+Our+technicians+are+trustworthy%2C+dependable%2C+and+good+at+what+they+do.+If+we+don%27t+take+care+of+your+pest+problem+we%27ll+try+again+for+free.bed+bugs%2C+mosquito%2C+mosquitos%2C+mosquitoes%2C+bed+bug%2C+damage';
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();
};

