/* [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','5201',jdecode('Home'),jdecode(''),'/5201.html','true',[],''],
	['PAGE','24601',jdecode('WNA+Sponsors'),jdecode(''),'/24601.html','true',[],''],
	['PAGE','40201',jdecode('News+Letter'),jdecode(''),'/40201.html','true',[],''],
	['PAGE','14143',jdecode('The+Board'),jdecode(''),'/14143.html','true',[],''],
	['PAGE','12201',jdecode('+Board+Links'),jdecode(''),'/12201.html','true',[],''],
	['PAGE','87712',jdecode('Join+the+WNA'),jdecode(''),'/87712.html','true',[],''],
	['PAGE','24685',jdecode('Crime+Watch'),jdecode(''),'/24685.html','true',[],''],
	['PAGE','24769',jdecode('Pawt+Contacts'),jdecode(''),'/24769.html','true',[],''],
	['PAGE','24748',jdecode('Resource+Links'),jdecode(''),'/24748.html','true',[],''],
	['PAGE','24706',jdecode('News'),jdecode(''),'/24706.html','true',[],''],
	['PAGE','24727',jdecode('Sports'),jdecode(''),'/24727.html','true',[],''],
	['PAGE','40301',jdecode('Weather'),jdecode(''),'/40301.html','true',[],''],
	['PAGE','51701',jdecode('Volunteer'),jdecode(''),'/51701.html','true',[],''],
	['PAGE','24811',jdecode('State+of+RI'),jdecode(''),'/24811.html','true',[],''],
	['PAGE','24832',jdecode('RIPTA+Sched'),jdecode(''),'/24832.html','true',[],''],
	['PAGE','24622',jdecode('Mission+Statement'),jdecode(''),'/24622.html','false',[],''],
	['PAGE','89312',jdecode('Opinion+Poll+Question'),jdecode(''),'/89312.html','false',[],''],
	['PAGE','69401',jdecode('Domestic+Violence+Resource+Page'),jdecode(''),'/69401.html','false',[],''],
	['PAGE','115734',jdecode('Computer+Help'),jdecode(''),'/115734.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='1243CC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10588';
theSitetree.graphicsetId='10562';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var theTemplate={
				name: 			'Circulation',
				paletteFamily: 	'1243CC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10588',
				graphicsetId: 	'10562',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100222-202345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24601',
internalId:  '',
customField: '20100218-212726'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '5201',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14143',
internalId:  '',
customField: '20100218-212949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24622',
internalId:  '',
customField: '20090502-084710'
};
webappMappings['1501']=webappMappings['1501-3431004']={
webappId:    '1501',
documentId:  '5201',
internalId:  '3431004',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20100111-192746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24685',
internalId:  '',
customField: '20090824-183210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51701',
internalId:  '',
customField: '20090502-083821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24769',
internalId:  '',
customField: '20091205-120556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115734',
internalId:  '',
customField: '20090913-092413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24727',
internalId:  '',
customField: '20090824-192946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40201',
internalId:  '',
customField: '20100202-183140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24706',
internalId:  '',
customField: '20090824-191341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40301',
internalId:  '',
customField: '20090824-193108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24748',
internalId:  '',
customField: '20090824-185732'
};
webappMappings['7008']=webappMappings['7008-3357']={
webappId:    '7008',
documentId:  '87712',
internalId:  '3357',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24832',
internalId:  '',
customField: '20090824-193348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24811',
internalId:  '',
customField: '20090824-224014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69401',
internalId:  '',
customField: '20090824-182920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89312',
internalId:  '',
customField: '20090830-130125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87712',
internalId:  '',
customField: '20090519-185750'
};
webappMappings['7005']=webappMappings['7005-350']={
webappId:    '7005',
documentId:  '89312',
internalId:  '350',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INV2WY';
var companyName   = 'Pawtucket+WNA';
var htmlTitle	  = 'www.wnapawtucket.com';
var metaKeywords  = 'Woodlawn+Pawtucket+%2C+Neighborhood+Association%2C+WNA%2C+Woodlawn+Neighborhood+Association%2C+Pawtucket+RI%2C+Pawtucket+WNA%2C+Pawtucket+neighborhood+Association%2C+Pawtucket+WNA%2CPawtucket';
var metaContents  = 'The+Woodlawn+Neighborhood+Association+of+Pawtucket+R.I.WNA%2C+Woodlawn%2C+Woodlawn+Pawtucket%2CPawtucket';
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();
};
