/* [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','652',jdecode('About+Us'),jdecode(''),'/652.html','true',[],'',''],
	['PAGE','715',jdecode('Board+of+Directors'),jdecode(''),'/715.html','true',[],'',''],
	['PAGE','52843',jdecode('Advisory+Council'),jdecode(''),'/52843.html','true',[],'',''],
	['PAGE','63943',jdecode('Awards+and+Honors'),jdecode(''),'/63943.html','true',[],'',''],
	['PAGE','105671',jdecode('Upcoming+Events'),jdecode(''),'/105671/index.html','true',[ 
		['PAGE','126904',jdecode('Greencycle+Swaps'),jdecode(''),'/105671/126904.html','true',[],'',''],
		['PAGE','139104',jdecode('JUN+-+Town+Square+LIVE'),jdecode(''),'/105671/139104.html','true',[],'',''],
		['PAGE','139125',jdecode('JUL%2FAUG+-+SummerStarz+2010'),jdecode(''),'/105671/139125.html','true',[],'','']
	],'',''],
	['PAGE','130904',jdecode('Past+Events%3A+2010'),jdecode(''),'/130904/index.html','true',[ 
		['PAGE','118504',jdecode('FEB+-+Valentine+Dance'),jdecode(''),'/130904/118504.html','true',[],'',''],
		['PAGE','135804',jdecode('MAY+-+Go+Green%21+G%26%23x27%3Bpt'),jdecode(''),'/130904/135804.html','true',[],'','']
	],'',''],
	['PAGE','65443',jdecode('Past+Events%3A+2009'),jdecode(''),'/65443/index.html','true',[ 
		['PAGE','65343',jdecode('MAR+-+Spr+SchoolFEST'),jdecode(''),'/65443/65343.html','true',[],'',''],
		['PAGE','65364',jdecode('APR+-+Go+Green%21+G%26%23x27%3Bpt%21'),jdecode(''),'/65443/65364.html','true',[],'',''],
		['PAGE','64464',jdecode('MAY+-+33rd+District+Forum'),jdecode(''),'/65443/64464.html','true',[],'',''],
		['PAGE','65643',jdecode('JUL+-+SummerStarz'),jdecode(''),'/65443/65643.html','true',[],'',''],
		['PAGE','101171',jdecode('AUG+-+Forum+Receptions'),jdecode(''),'/65443/101171.html','true',[],'',''],
		['PAGE','101192',jdecode('AUG+-+Summer+Starz'),jdecode(''),'/65443/101192.html','true',[],'',''],
		['PAGE','97843',jdecode('AUG+-+Recycling%2FSwaps'),jdecode(''),'/65443/97843.html','true',[],'',''],
		['PAGE','64443',jdecode('AUG+-+SummerStarz'),jdecode(''),'/65443/64443.html','true',[],'',''],
		['PAGE','96143',jdecode('OCT+-+Pumpkin+Day'),jdecode(''),'/65443/96143.html','true',[],'',''],
		['PAGE','67864',jdecode('OCT+-+SchoolFEST'),jdecode(''),'/65443/67864.html','true',[],'',''],
		['PAGE','96164',jdecode('OCT+-+Halloween'),jdecode(''),'/65443/96164.html','true',[],'',''],
		['PAGE','106371',jdecode('DEC+-+Recycling%2FSwap'),jdecode(''),'/65443/106371.html','true',[],'',''],
		['PAGE','106392',jdecode('DEC+-+Brunch+w%2FSanta'),jdecode(''),'/65443/106392.html','true',[],'',''],
		['PAGE','121304',jdecode('DEC+-+Santa+Brunch+Pics'),jdecode(''),'/65443/121304.html','true',[],'','']
	],'',''],
	['PAGE','799',jdecode('Past+Events%3A+2008'),jdecode(''),'/799/index.html','true',[ 
		['PAGE','18322',jdecode('JAN+-+Moscow+Circus'),jdecode(''),'/799/18322.html','true',[],'',''],
		['PAGE','18301',jdecode('APR+-+Go+Green%21+G%26%23x27%3Bpt%21'),jdecode(''),'/799/18301.html','true',[],'',''],
		['PAGE','18364',jdecode('JUL+-+SummerStarz'),jdecode(''),'/799/18364.html','true',[],'',''],
		['PAGE','20543',jdecode('AUG+-+SummerStarz'),jdecode(''),'/799/20543.html','true',[],'',''],
		['PAGE','20627',jdecode('SEP+-+SummerStarz'),jdecode(''),'/799/20627.html','true',[],'',''],
		['PAGE','20669',jdecode('SEP+-+SchoolFEST'),jdecode(''),'/799/20669.html','true',[],'',''],
		['PAGE','37901',jdecode('OCT+-+Pumpkin+Day'),jdecode(''),'/799/37901.html','true',[],'',''],
		['PAGE','45401',jdecode('OCT+-+Halloween'),jdecode(''),'/799/45401.html','true',[],'',''],
		['PAGE','60643',jdecode('DEC+-+Holiday+Lights'),jdecode(''),'/799/60643.html','true',[],'','']
	],'',''],
	['PAGE','21001',jdecode('Music+Partners'),jdecode(''),'/21001.html','true',[],'',''],
	['PAGE','820',jdecode('Join+Our+Distribution'),jdecode(''),'/820.html','true',[],'',''],
	['PAGE','70143',jdecode('Get+Involved'),jdecode(''),'/70143.html','true',[],'','']];
var siteelementCount=39;
theSitetree.topTemplateName='Deepcolor';
theSitetree.paletteFamily='5583CB';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10349';
theSitetree.graphicsetId='10469';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='154186';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Deepcolor',
				paletteFamily: 	'5583CB',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10349',
				graphicsetId: 	'10469',
				contentColor: 	'000000',
				contentBGColor: '154186',
				a_color: 		'5583CB',
				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:  '652',
internalId:  '',
customField: '20090511-164849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105671',
internalId:  '',
customField: '20100726-112554'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '652',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '799',
internalId:  '',
customField: '20090731-231113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45401',
internalId:  '',
customField: '20090617-123306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20100418-010327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18322',
internalId:  '',
customField: '20090617-123004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18301',
internalId:  '',
customField: '20090617-123032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18364',
internalId:  '',
customField: '20090617-123137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20543',
internalId:  '',
customField: '20090615-122324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20627',
internalId:  '',
customField: '20081117-074523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20669',
internalId:  '',
customField: '20090617-123205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20090617-123229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20090225-150943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '820',
internalId:  '',
customField: '20100214-113534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64443',
internalId:  '',
customField: '20091202-120508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52843',
internalId:  '',
customField: '20100418-012500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65443',
internalId:  '',
customField: '20100214-115701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60643',
internalId:  '',
customField: '20090618-102102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65343',
internalId:  '',
customField: '20090618-100642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63943',
internalId:  '',
customField: '20090621-230054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65364',
internalId:  '',
customField: '20090618-100538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64464',
internalId:  '',
customField: '20090618-100508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65643',
internalId:  '',
customField: '20091202-115136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96143',
internalId:  '',
customField: '20091203-092057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118504',
internalId:  '',
customField: '20100128-065541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67864',
internalId:  '',
customField: '20091203-090812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135804',
internalId:  '',
customField: '20100424-144950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70143',
internalId:  '',
customField: '20090615-132859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96164',
internalId:  '',
customField: '20091203-092952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97843',
internalId:  '',
customField: '20090804-072322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101171',
internalId:  '',
customField: '20100102-160959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101192',
internalId:  '',
customField: '20090810-122623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106371',
internalId:  '',
customField: '20091207-092412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106392',
internalId:  '',
customField: '20100102-161310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126904',
internalId:  '',
customField: '20100603-195243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130904',
internalId:  '',
customField: '20100726-113056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121304',
internalId:  '',
customField: '20091220-193002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139125',
internalId:  '',
customField: '20100603-201115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139104',
internalId:  '',
customField: '20100603-185454'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INX3AK';
var companyName   = 'TOWN+SQUARE+INC.';
var htmlTitle	  = 'Town+Square';
var metaKeywords  = '';
var metaContents  = '';
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();
};
