/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','8901',jdecode('Schedule+%26+Events'),jdecode(''),'/8901/index.html','true',[ 
		['PAGE','163773',jdecode('Current+Announcements'),jdecode(''),'/8901/163773.html','false',[],'',''],
		['PAGE','208073',jdecode('Calendar'),jdecode(''),'/8901/208073.html','false',[],'','']
	],'',''],
	['PAGE','1401',jdecode('Who+We+Are'),jdecode(''),'/1401/index.html','true',[ 
		['PAGE','210873',jdecode('What+We+Believe'),jdecode(''),'/1401/210873.html','true',[],'',''],
		['PAGE','211673',jdecode('The+Creeds'),jdecode(''),'/1401/211673.html','false',[],'',''],
		['PAGE','1422',jdecode('Meet+The+Staff'),jdecode(''),'/1401/1422.html','true',[],'',''],
		['PAGE','1443',jdecode('Church+Leadership'),jdecode(''),'/1401/1443.html','true',[],'',''],
		['PAGE','1464',jdecode('St.+Paul%26%23x27%3Bs+History'),jdecode(''),'/1401/1464.html','true',[],'','']
	],'',''],
	['PAGE','20101',jdecode('Worship+With+Us'),jdecode(''),'/20101/index.html','true',[ 
		['PAGE','20122',jdecode('Music+%26+Choir'),jdecode(''),'/20101/20122.html','true',[],'',''],
		['PAGE','20206',jdecode('Life+Events'),jdecode(''),'/20101/20206.html','true',[],'',''],
		['PAGE','35201',jdecode('Pray+List'),jdecode(''),'/20101/35201.html','true',[],'','']
	],'',''],
	['PAGE','20143',jdecode('Faith+Formation'),jdecode(''),'/20143/index.html','true',[ 
		['PAGE','1548',jdecode('Church+School'),jdecode(''),'/20143/1548.html','true',[],'',''],
		['PAGE','56212',jdecode('Church+School+Events'),jdecode(''),'/20143/56212.html','true',[],'',''],
		['PAGE','20164',jdecode('Adult+Formation'),jdecode(''),'/20143/20164.html','true',[],'','']
	],'',''],
	['PAGE','1590',jdecode('Faith+in+Action'),jdecode(''),'/1590/index.html','true',[ 
		['PAGE','191173',jdecode('Youth+Ministries'),jdecode(''),'/1590/191173.html','true',[],'',''],
		['PAGE','191215',jdecode('Worship+%26+Music'),jdecode(''),'/1590/191215.html','true',[],'',''],
		['PAGE','25601',jdecode('Altar+Guild'),jdecode(''),'/1590/25601.html','true',[],'',''],
		['PAGE','192673',jdecode('Outreach+Committee'),jdecode(''),'/1590/192673.html','true',[],'',''],
		['PAGE','191236',jdecode('Inreach+Committee'),jdecode(''),'/1590/191236.html','true',[],'',''],
		['PAGE','191257',jdecode('Fellowship'),jdecode(''),'/1590/191257.html','true',[],'',''],
		['PAGE','191278',jdecode('Administration'),jdecode(''),'/1590/191278.html','true',[],'','']
	],'',''],
	['PAGE','20185',jdecode('Parish+Life'),jdecode(''),'/20185.html','false',[],'',''],
	['PAGE','230984',jdecode('Sermons+%26+Newsletter'),jdecode(''),'/230984/index.html','true',[ 
		['PAGE','34901',jdecode('The+Apostle+Newsletter'),jdecode(''),'/230984/34901.html','true',[],'',''],
		['PAGE','20701',jdecode('Sermons'),jdecode(''),'/230984/20701.html','true',[],'',''],
		['PAGE','26901',jdecode('September+28%2C+2008'),jdecode(''),'/230984/26901.html','false',[],'',''],
		['PAGE','17522',jdecode('September+14%2C+2008'),jdecode(''),'/230984/17522.html','false',[],'',''],
		['PAGE','28601',jdecode('October+12%2C+2008'),jdecode(''),'/230984/28601.html','false',[],'',''],
		['PAGE','29701',jdecode('October+19%2C+2008'),jdecode(''),'/230984/29701.html','false',[],'',''],
		['PAGE','31501',jdecode('October+26%2C+2008'),jdecode(''),'/230984/31501.html','false',[],'',''],
		['PAGE','36501',jdecode('November+16%2C+2008'),jdecode(''),'/230984/36501.html','false',[],'',''],
		['PAGE','36522',jdecode('November+23%2C+2008'),jdecode(''),'/230984/36522.html','false',[],'',''],
		['PAGE','36543',jdecode('Novembr+23%2C+2008+Thanksgiving'),jdecode(''),'/230984/36543.html','false',[],'',''],
		['PAGE','38912',jdecode('November+30%2C+2008'),jdecode(''),'/230984/38912.html','false',[],'',''],
		['PAGE','39112',jdecode('December+14%2C+2008'),jdecode(''),'/230984/39112.html','false',[],'',''],
		['PAGE','39312',jdecode('December+21%2C+2008'),jdecode(''),'/230984/39312.html','false',[],'',''],
		['PAGE','41412',jdecode('December+24%2C+2008+Christmas'),jdecode(''),'/230984/41412.html','false',[],'',''],
		['PAGE','45112',jdecode('January+18%2C+2009'),jdecode(''),'/230984/45112.html','false',[],'',''],
		['PAGE','45133',jdecode('January+25%2C+2009'),jdecode(''),'/230984/45133.html','false',[],'',''],
		['PAGE','45154',jdecode('February+8%2C+2009'),jdecode(''),'/230984/45154.html','false',[],'',''],
		['PAGE','47712',jdecode('February+22%2C+2009'),jdecode(''),'/230984/47712.html','false',[],'',''],
		['PAGE','50712',jdecode('March+8%2C+2009'),jdecode(''),'/230984/50712.html','false',[],'',''],
		['PAGE','54312',jdecode('March+15%2C+2009'),jdecode(''),'/230984/54312.html','false',[],'','']
	],'',''],
	['PAGE','205073',jdecode('Links'),jdecode(''),'/205073.html','true',[],'',''],
	['PAGE','20248',jdecode('Directions-old'),jdecode(''),'/20248.html','false',[],'',''],
	['PAGE','11001',jdecode('Directions'),jdecode(''),'/11001.html','true',[],'',''],
	['PAGE','9501',jdecode('Read+Guestbook'),jdecode(''),'/9501.html','false',[],'',''],
	['PAGE','1632',jdecode('Contact+Us'),jdecode(''),'/1632.html','true',[],'',''],
	['PAGE','9506',jdecode('Guestbook'),jdecode(''),'/9506.html','false',[],'',''],
	['PAGE','67512',jdecode('LinkTest'),jdecode(''),'/67512.html','false',[],'','']];
var siteelementCount=55;
theSitetree.topTemplateName='Blossom';
theSitetree.paletteFamily='AC2E53';
theSitetree.keyvisualId='7105';
theSitetree.keyvisualName='kv_7105.jpg';
theSitetree.fontsetId='16395';
theSitetree.graphicsetId='12128';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E5E2E2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blossom',
				paletteFamily: 	'AC2E53',
				keyvisualId: 	'7105',
				keyvisualName: 	'kv_7105.jpg',
				fontsetId: 		'16395',
				graphicsetId: 	'12128',
				contentColor: 	'000000',
				contentBGColor: 'E5E2E2',
				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:  '1401',
internalId:  '',
customField: '20100527-125116'
};
webappMappings['1002']=webappMappings['1002-9506ahw050invdgi']={
webappId:    '1002',
documentId:  '9506',
internalId:  '9506ahw050invdgi',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100513-193433'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '11001',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20101',
internalId:  '',
customField: '20100704-145609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20122',
internalId:  '',
customField: '20100227-201428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20143',
internalId:  '',
customField: '20100826-194703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1548',
internalId:  '',
customField: '20100826-193317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20164',
internalId:  '',
customField: '20100509-182330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1590',
internalId:  '',
customField: '20100227-201742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25601',
internalId:  '',
customField: '20100228-193317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20100801-104201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26901',
internalId:  '',
customField: '20081001-233756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17522',
internalId:  '',
customField: '20080917-133708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28601',
internalId:  '',
customField: '20081026-212033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29701',
internalId:  '',
customField: '20081026-212238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20185',
internalId:  '',
customField: '20090703-083643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1443',
internalId:  '',
customField: '20100527-121000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20206',
internalId:  '',
customField: '20100227-201455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1422',
internalId:  '',
customField: '20100509-182053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1464',
internalId:  '',
customField: '20100227-195847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36543',
internalId:  '',
customField: '20081126-134352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20248',
internalId:  '',
customField: '20100405-205440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1632',
internalId:  '',
customField: '20100227-194052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20100827-191911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191173',
internalId:  '',
customField: '20100509-182404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9506',
internalId:  '',
customField: '20080829-213800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20080829-213800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20100405-210809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36501',
internalId:  '',
customField: '20081126-134550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36522',
internalId:  '',
customField: '20081126-134456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31501',
internalId:  '',
customField: '20081101-001931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34901',
internalId:  '',
customField: '20100827-193819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35201',
internalId:  '',
customField: '20100827-192935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38912',
internalId:  '',
customField: '20081227-101515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39112',
internalId:  '',
customField: '20081227-101807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39312',
internalId:  '',
customField: '20081227-102215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41412',
internalId:  '',
customField: '20081231-002246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45112',
internalId:  '',
customField: '20090207-203802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45133',
internalId:  '',
customField: '20090207-204005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45154',
internalId:  '',
customField: '20090207-204331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47712',
internalId:  '',
customField: '20090304-094849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50712',
internalId:  '',
customField: '20090310-094606'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54312',
internalId:  '',
customField: '20090402-104041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56212',
internalId:  '',
customField: '20100208-114744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191236',
internalId:  '',
customField: '20100509-182519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67512',
internalId:  '',
customField: '20090714-152235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191215',
internalId:  '',
customField: '20100509-182430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '163773',
internalId:  '',
customField: '20100617-185816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192673',
internalId:  '',
customField: '20100227-185747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191257',
internalId:  '',
customField: '20100228-193527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191278',
internalId:  '',
customField: '20100509-182601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '205073',
internalId:  '',
customField: '20100325-205808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '208073',
internalId:  '',
customField: '20100405-204424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '210873',
internalId:  '',
customField: '20100527-124353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '211673',
internalId:  '',
customField: '20100413-101229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '230984',
internalId:  '',
customField: '20100801-102934'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INVDGI';
var companyName   = 'St.+Paul%27s+Episcopal+Church+%E2%80%A2+North+Andover%2C+MA';
var htmlTitle	  = 'St.+Paul%27s+Episcopal+Church%2C+North+Andover%2C+MA';
var metaKeywords  = 'episcopal+pauls+church+andover+ma+north+services+christian+anglican+massachusetts+parish+';
var metaContents  = 'St.+Pauls+is+an+Episcopal+Church+located+in+North+Andover%2C+Massachusetts.';
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();
};
