/* [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','5801',jdecode('Home'),jdecode(''), jdecode('%2F5801%2Findex.html'), 'true',[ 
		['PAGE','25701',jdecode('Clergy+%26+Staff'),jdecode(''), jdecode('%2F5801%2F25701.html'), 'true',[],'',''],
		['PAGE','25722',jdecode('Directions'),jdecode(''), jdecode('%2F5801%2F25722.html'), 'true',[],'','']
	],'',''],
	['PAGE','108601',jdecode('Online+Pledge+Form'),jdecode(''), jdecode('%2F108601.html'), 'true',[],'',''],
	['PAGE','25743',jdecode('Welcome'),jdecode(''), jdecode('%2F25743%2Findex.html'), 'true',[ 
		['PAGE','25764',jdecode('Rector%26%23x27%3Bs+Welcome'),jdecode(''), jdecode('%2F25743%2F25764.html'), 'true',[],'',''],
		['PAGE','25785',jdecode('First+Time+Visitors'),jdecode(''), jdecode('%2F25743%2F25785.html'), 'true',[],'','']
	],'',''],
	['PAGE','23622',jdecode('Worship'),jdecode(''), jdecode('%2F23622%2Findex.html'), 'true',[ 
		['PAGE','25501',jdecode('Weekly+Worship+Schedule'),jdecode(''), jdecode('%2F23622%2F25501.html'), 'true',[],'',''],
		['PAGE','25522',jdecode('Holiday+Services'),jdecode(''), jdecode('%2F23622%2F25522.html'), 'true',[],'',''],
		['PAGE','47401',jdecode('Celtic+Night+Prayer'),jdecode(''), jdecode('%2F23622%2F47401.html'), 'true',[],'',''],
		['PAGE','25543',jdecode('Sunday+Readings'),jdecode(''), jdecode('%2F23622%2F25543.html'), 'true',[],'','']
	],'',''],
	['PAGE','25806',jdecode('Church+School'),jdecode(''), jdecode('%2F25806.html'), 'true',[],'',''],
	['PAGE','25932',jdecode('Adult+Formation'),jdecode(''), jdecode('%2F25932%2Findex.html'), 'true',[ 
		['PAGE','101701',jdecode('In+the+News'),jdecode(''), jdecode('%2F25932%2F101701.html'), 'true',[],'','']
	],'',''],
	['PAGE','25911',jdecode('Ministries'),jdecode(''), jdecode('%2F25911%2Findex.html'), 'true',[ 
		['PAGE','25974',jdecode('Liturgical'),jdecode(''), jdecode('%2F25911%2F25974.html'), 'true',[],'',''],
		['PAGE','25995',jdecode('Outreach'),jdecode(''), jdecode('%2F25911%2F25995.html'), 'true',[],'',''],
		['PAGE','57301',jdecode('Other+groups'),jdecode(''), jdecode('%2F25911%2F57301.html'), 'true',[],'','']
	],'',''],
	['PAGE','25848',jdecode('Baptism'),jdecode(''), jdecode('%2F25848%2Findex.html'), 'true',[ 
		['PAGE','44601',jdecode('Frequently+asked+questions+about+Baptism'),jdecode(''), jdecode('%2F25848%2F44601.html'), 'true',[],'',''],
		['PAGE','44801',jdecode('Confirmation+and+Reception'),jdecode(''), jdecode('%2F25848%2F44801.html'), 'true',[],'','']
	],'',''],
	['PAGE','45201',jdecode('What+we+believe'),jdecode(''), jdecode('%2F45201%2Findex.html'), 'true',[ 
		['PAGE','48401',jdecode('Apostles+Creed'),jdecode(''), jdecode('%2F45201%2F48401.html'), 'true',[],'',''],
		['PAGE','48422',jdecode('Nicene+Creed'),jdecode(''), jdecode('%2F45201%2F48422.html'), 'true',[],'',''],
		['PAGE','48443',jdecode('The+Baptismal+Covenant'),jdecode(''), jdecode('%2F45201%2F48443.html'), 'true',[],'','']
	],'',''],
	['PAGE','44201',jdecode('How+do+I+join+St+John%26%23x27%3Bs+++'),jdecode(''), jdecode('%2F44201.html'), 'true',[],'',''],
	['PAGE','44401',jdecode('Membership'),jdecode(''), jdecode('%2F44401%2Findex.html'), 'true',[ 
		['PAGE','25827',jdecode('Member%26%23x27%3Bs+Expectations'),jdecode(''), jdecode('%2F44401%2F25827.html'), 'true',[],'','']
	],'',''],
	['PAGE','25869',jdecode('Weddings'),jdecode(''), jdecode('%2F25869.html'), 'true',[],'',''],
	['PAGE','26016',jdecode('Pastoral+Care'),jdecode(''), jdecode('%2F26016.html'), 'true',[],'',''],
	['PAGE','25890',jdecode('Funerals'),jdecode(''), jdecode('%2F25890.html'), 'true',[],'',''],
	['PAGE','26037',jdecode('Music'),jdecode(''), jdecode('%2F26037%2Findex.html'), 'true',[ 
		['PAGE','26058',jdecode('Nevin+Pipe+Organ'),jdecode(''), jdecode('%2F26037%2F26058.html'), 'true',[],'',''],
		['PAGE','26100',jdecode('Our+Choirs'),jdecode(''), jdecode('%2F26037%2F26100.html'), 'true',[],'','']
	],'',''],
	['PAGE','26121',jdecode('News'),jdecode(''), jdecode('%2F26121%2Findex.html'), 'true',[ 
		['PAGE','26142',jdecode('This+Week+at+St.+John%26%23x27%3Bs'),jdecode(''), jdecode('%2F26121%2F26142.html'), 'true',[],'',''],
		['PAGE','26163',jdecode('The+Eagle'),jdecode(''), jdecode('%2F26121%2F26163.html'), 'true',[],'',''],
		['PAGE','26184',jdecode('The+Calendar'),jdecode(''), jdecode('%2F26121%2F26184.html'), 'true',[],'',''],
		['PAGE','26205',jdecode('Ongoing+Events'),jdecode(''), jdecode('%2F26121%2F26205.html'), 'true',[],'','']
	],'',''],
	['PAGE','55601',jdecode('Interesting+links'),jdecode(''), jdecode('%2F55601.html'), 'true',[],'',''],
	['PAGE','6201',jdecode('Contact+Us'),jdecode(''), jdecode('%2F6201.html'), 'true',[],'',''],
	['PAGE','96701',jdecode('Confirmation'),jdecode(''), jdecode('%2F96701.html'), 'false',[],'','']];
var siteelementCount=43;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='6683B6';
theSitetree.keyvisualId='2454';
theSitetree.keyvisualName='generationen.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='461';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'6683B6',
				keyvisualId: 	'2454',
				keyvisualName: 	'generationen.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'461',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'6683B6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20120105-085230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20110329-100526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25911',
internalId:  '',
customField: '20110322-093344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20110826-102223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25743',
internalId:  '',
customField: '20100714-121037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23622',
internalId:  '',
customField: '20120217-095142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25722',
internalId:  '',
customField: '20110906-082733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25764',
internalId:  '',
customField: '20110322-092900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25785',
internalId:  '',
customField: '20100707-092222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25806',
internalId:  '',
customField: '20110322-093021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25827',
internalId:  '',
customField: '20110329-100358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25848',
internalId:  '',
customField: '20100707-092936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25869',
internalId:  '',
customField: '20110329-100437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25890',
internalId:  '',
customField: '20100826-101520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25932',
internalId:  '',
customField: '20120109-142928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48401',
internalId:  '',
customField: '20100706-161652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25974',
internalId:  '',
customField: '20100706-151855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25995',
internalId:  '',
customField: '20110322-093434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26016',
internalId:  '',
customField: '20110329-100504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26037',
internalId:  '',
customField: '20111019-093915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26058',
internalId:  '',
customField: '20100707-125012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57301',
internalId:  '',
customField: '20100712-143240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26100',
internalId:  '',
customField: '20100707-141634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26121',
internalId:  '',
customField: '20111019-094505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26142',
internalId:  '',
customField: '20120217-095520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26163',
internalId:  '',
customField: '20120203-122409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26184',
internalId:  '',
customField: '20120203-122518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26205',
internalId:  '',
customField: '20100707-121944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47401',
internalId:  '',
customField: '20110322-092945'
};
webappMappings['7060']=webappMappings['7060-85d24e18d8bf446edb992486fc0002f9']={
webappId:    '7060',
documentId:  '25743',
internalId:  '85d24e18d8bf446edb992486fc0002f9',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20110826-100125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25522',
internalId:  '',
customField: '20111201-101400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25543',
internalId:  '',
customField: '20120217-095233'
};
webappMappings['7008']=webappMappings['7008-8756']={
webappId:    '7008',
documentId:  '44201',
internalId:  '8756',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44201',
internalId:  '',
customField: '20100701-095515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44401',
internalId:  '',
customField: '20100707-091639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44601',
internalId:  '',
customField: '20100701-103714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44801',
internalId:  '',
customField: '20111005-112404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45201',
internalId:  '',
customField: '20110322-093508'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '25722',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['7060']=webappMappings['7060-ea64da6d454d032ef862e9b3d2065814']={
webappId:    '7060',
documentId:  '25743',
internalId:  'ea64da6d454d032ef862e9b3d2065814',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48422',
internalId:  '',
customField: '20110322-093536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48443',
internalId:  '',
customField: '20100706-163353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55601',
internalId:  '',
customField: '20111006-171852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108601',
internalId:  '',
customField: '20111114-115751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96701',
internalId:  '',
customField: '20100831-185950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101701',
internalId:  '',
customField: '20100916-142739'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INZYUK';
var companyName   = 'St.+John%27s+Memorial+Episcopal+Church';
var htmlTitle	  = 'St.+John%27s+Memorial+Episcopal+Church%2C+Ramsey+NJ';
var metaKeywords  = 'St+John%27s%2C+Ramsey%2C+Episcopal%2C+Anglican%2C+Progressive%2C+Celtic%2CChristian%2C+Inclusive%2C+';
var metaContents  = 'St+John%27s%2C+a+progressive%2C+inclusive%2C+engaged+Episcopal+Church+located+at+East+Main+and+Franklin+Turnpike';
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();
};

