/* [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','41637',jdecode('Heart+of+Kensington'),jdecode(''),'/41637.html','true',[],''],
	['PAGE','18901',jdecode('Baumann+Book+Sale'),jdecode(''),'/18901.html','true',[],''],
	['PAGE','32401',jdecode('2009+Home+Tour'),jdecode(''),'/32401.html','true',[],''],
	['PAGE','401',jdecode('2008+Home+Tour'),jdecode(''),'/401.html','true',[],''],
	['PAGE','473',jdecode('Tour+the+2008+Homes'),jdecode(''),'/473/index.html','true',[ 
		['PAGE','21101',jdecode('Casey+House'),jdecode(''),'/473/21101.html','true',[],''],
		['PAGE','21122',jdecode('Requa+Model+House'),jdecode(''),'/473/21122.html','true',[],''],
		['PAGE','21143',jdecode('Rinehart+House'),jdecode(''),'/473/21143.html','true',[],''],
		['PAGE','34501',jdecode('Torgerson+House+'),jdecode(''),'/473/34501.html','true',[],''],
		['PAGE','21164',jdecode('General+Rubio+House'),jdecode(''),'/473/21164.html','true',[],'']
	],''],
	['PAGE','39398',jdecode('Found+Treasures'),jdecode(''),'/39398.html','true',[],''],
	['PAGE','6743',jdecode('Walking+Tour'),jdecode(''),'/6743.html','true',[],''],
	['PAGE','39906',jdecode('Historic+PROW'),jdecode(''),'/39906.html','true',[],''],
	['PAGE','40353',jdecode('Preserve+Kensington'),jdecode(''),'/40353/index.html','true',[ 
		['PAGE','40408',jdecode('The+Mills+Act'),jdecode(''),'/40353/40408.html','true',[],''],
		['PAGE','40417',jdecode('Historic+Districts'),jdecode(''),'/40353/40417.html','true',[],''],
		['PAGE','40980',jdecode('Can+we...%3F'),jdecode(''),'/40353/40980.html','true',[],''],
		['PAGE','40989',jdecode('Kensington+Park+HD'),jdecode(''),'/40353/40989.html','true',[],''],
		['PAGE','40426',jdecode('Resources'),jdecode(''),'/40353/40426.html','true',[],'']
	],''],
	['PAGE','16001',jdecode('About+Kensington'),jdecode(''),'/16001.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Letter';
theSitetree.paletteFamily='CBD7F9';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10687';
theSitetree.graphicsetId='10747';
theSitetree.contentColor='000E71';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Letter',
				paletteFamily: 	'CBD7F9',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10687',
				graphicsetId: 	'10747',
				contentColor: 	'000E71',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'706F6F',
				e_color: 		'706F6F',
				f_color: 		'706F6F',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '41637',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090122-173451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41637',
internalId:  '',
customField: '20100330-102637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20100306-150317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39398',
internalId:  '',
customField: '20090122-164410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20080519-190648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20080519-192116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21122',
internalId:  '',
customField: '20080519-190242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21143',
internalId:  '',
customField: '20080409-201823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34501',
internalId:  '',
customField: '20080515-233719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21164',
internalId:  '',
customField: '20080515-040650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32401',
internalId:  '',
customField: '20090718-191434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6743',
internalId:  '',
customField: '20100129-213300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39906',
internalId:  '',
customField: '20080724-232944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40353',
internalId:  '',
customField: '20100306-134258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40408',
internalId:  '',
customField: '20090626-140652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40417',
internalId:  '',
customField: '20080728-160102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40980',
internalId:  '',
customField: '20080728-161708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40989',
internalId:  '',
customField: '20080729-000843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40426',
internalId:  '',
customField: '20080724-234512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20080726-193219'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INE2WL';
var companyName   = 'HoK+is+AoK%21';
var htmlTitle	  = 'The+Heart+of+Kensington+-+Neighborhood+Preservation+Advocacy';
var metaKeywords  = 'Kensington+historic+neighborhood+homes+tour+Richard+Requa+Cliff+May+centennial';
var metaContents  = 'Heart+of+Kensington+fund+raising+events.+Landmarked+historic+homes+of+Kensington+tour.+Join+Kensington+residents+in+protecting+the+unique%2C+historic+identity+of+our+neighborhood.+';
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();
};

