/* [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','181',jdecode('HOME'),jdecode(''),'/181/index.html','true',[ 
		['PAGE','53122',jdecode('OUR+PASTOR'),jdecode(''),'/181/53122.html','true',[],''],
		['PAGE','5006',jdecode('GUESTBOOK'),jdecode(''),'/181/5006.html','true',[],''],
		['PAGE','548',jdecode('RESOURCES'),jdecode(''),'/181/548.html','false',[],''],
		['PAGE','205812',jdecode('SERMONS+%26+TEACHINGS'),jdecode(''),'/181/205812.html','true',[],''],
		['PAGE','229419',jdecode('SERMONS+%5BII%5D'),jdecode(''),'/181/229419.html','false',[],''],
		['PAGE','260619',jdecode('SERMONS+%5BI%5D'),jdecode(''),'/181/260619.html','false',[],''],
		['PAGE','5001',jdecode('READ+GUESTBOOK'),jdecode(''),'/181/5001.html','false',[],''],
		['PAGE','205833',jdecode('UPCOMING+EVENTS'),jdecode(''),'/181/205833.html','true',[],''],
		['PAGE','209912',jdecode('BULLETIN+BOARD'),jdecode(''),'/181/209912.html','true',[],''],
		['PAGE','256019',jdecode('CLASSIFIEDS'),jdecode(''),'/181/256019.html','false',[],''],
		['PAGE','234619',jdecode('NOTICES'),jdecode(''),'/181/234619.html','false',[],''],
		['PAGE','224219',jdecode('RESOURCE+LINKS'),jdecode(''),'/181/224219.html','true',[],''],
		['PAGE','220619',jdecode('USEFUL+LINKS'),jdecode(''),'/181/220619.html','false',[],'']
	],''],
	['PAGE','53101',jdecode('ABOUT+US'),jdecode(''),'/53101/index.html','true',[ 
		['PAGE','204812',jdecode('SESSION'),jdecode(''),'/53101/204812.html','true',[],''],
		['PAGE','204612',jdecode('COMMITTEES+%26+BOARDS'),jdecode(''),'/53101/204612.html','true',[],''],
		['PAGE','60501',jdecode('PHOTO+GALLERY'),jdecode(''),'/53101/60501.html','true',[],'']
	],''],
	['PAGE','464',jdecode('WEEKLY+SCHEDULE'),jdecode(''),'/464.html','true',[],''],
	['PAGE','485',jdecode('MINISTRIES'),jdecode(''),'/485/index.html','true',[ 
		['PAGE','195012',jdecode('Church+Choir'),jdecode(''),'/485/195012.html','true',[],''],
		['PAGE','195033',jdecode('Women%26%23x27%3Bs+Fellowship'),jdecode(''),'/485/195033.html','true',[],''],
		['PAGE','195054',jdecode('Men%26%23x27%3Bs+Fellowship'),jdecode(''),'/485/195054.html','true',[],''],
		['PAGE','195075',jdecode('Praise+%26+Worship+'),jdecode(''),'/485/195075.html','true',[],''],
		['PAGE','195096',jdecode('Youth+Ministry'),jdecode(''),'/485/195096.html','true',[],''],
		['PAGE','195117',jdecode('Junior+Youth+'),jdecode(''),'/485/195117.html','true',[],''],
		['PAGE','195138',jdecode('Children%26%23x27%3Bs+Ministry'),jdecode(''),'/485/195138.html','true',[],''],
		['PAGE','195159',jdecode('+Prayer+Team'),jdecode(''),'/485/195159.html','true',[],''],
		['PAGE','195180',jdecode('Healing+%26+Deliverance+'),jdecode(''),'/485/195180.html','true',[],'']
	],''],
	['PAGE','141712',jdecode('RECENT+EVENTS'),jdecode(''),'/141712/index.html','true',[ 
		['PAGE','143912',jdecode('Choir+Inauguration'),jdecode(''),'/141712/143912.html','true',[],''],
		['PAGE','144412',jdecode('Summer+Renovation'),jdecode(''),'/141712/144412.html','true',[],''],
		['PAGE','144433',jdecode('EPRC+Inauguration'),jdecode(''),'/141712/144433.html','true',[],''],
		['PAGE','144454',jdecode('Youth+Camp+2007'),jdecode(''),'/141712/144454.html','true',[],'']
	],''],
	['PAGE','195201',jdecode('DIRECTIONS'),jdecode(''),'/195201/index.html','true',[ 
		['PAGE','35301',jdecode('MAP'),jdecode(''),'/195201/35301.html','true',[],''],
		['PAGE','35401',jdecode('DRIVING+DIRECTIONS'),jdecode(''),'/195201/35401.html','true',[],''],
		['PAGE','64701',jdecode('PUBLIC+TRANSPORT'),jdecode(''),'/195201/64701.html','true',[],'']
	],''],
	['PAGE','590',jdecode('CONTACT+US'),jdecode(''),'/590.html','true',[],'']];
var siteelementCount=39;
theSitetree.topTemplateName='Cuy';
theSitetree.paletteFamily='F3FAFB';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='386';
theSitetree.graphicsetId='437';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F3FAFB';
var theTemplate={
				name: 			'Cuy',
				paletteFamily: 	'F3FAFB',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'386',
				graphicsetId: 	'437',
				contentColor: 	'000000',
				contentBGColor: 'F3FAFB',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'F3FAFB',
				b_color: 		'A9C9CD',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '181',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-5006ahw050inxsth']={
webappId:    '1002',
documentId:  '5006',
internalId:  '5006ahw050inxsth',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '35301',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['7060']=webappMappings['7060-31c52824efb9ae1043828306736f6a11']={
webappId:    '7060',
documentId:  '143912',
internalId:  '31c52824efb9ae1043828306736f6a11',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-10701']={
webappId:    '1501',
documentId:  '181',
internalId:  '10701',
customField: '1501'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '35401',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['7060']=webappMappings['7060-691d59c5ab07b577fb14d1c45bc4700e']={
webappId:    '7060',
documentId:  '60501',
internalId:  '691d59c5ab07b577fb14d1c45bc4700e',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-223fbbd7955409785e312133d687d25f']={
webappId:    '7060',
documentId:  '143912',
internalId:  '223fbbd7955409785e312133d687d25f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181',
internalId:  '',
customField: '20100227-003021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53101',
internalId:  '',
customField: '20090208-055219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53122',
internalId:  '',
customField: '20090801-212746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '464',
internalId:  '',
customField: '20090127-082558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '485',
internalId:  '',
customField: '20090127-082643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '548',
internalId:  '',
customField: '20090206-151437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195180',
internalId:  '',
customField: '20081107-005805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141712',
internalId:  '',
customField: '20090206-151834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143912',
internalId:  '',
customField: '20090206-151854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144412',
internalId:  '',
customField: '20090206-151918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144433',
internalId:  '',
customField: '20090206-151936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144454',
internalId:  '',
customField: '20090206-151952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60501',
internalId:  '',
customField: '20081107-014015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5006',
internalId:  '',
customField: '20090701-104343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20080821-153709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35301',
internalId:  '',
customField: '20081215-142947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20081215-142747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64701',
internalId:  '',
customField: '20080920-024507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '590',
internalId:  '',
customField: '20081207-000438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195033',
internalId:  '',
customField: '20081113-104611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195012',
internalId:  '',
customField: '20090115-053923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195075',
internalId:  '',
customField: '20081111-153036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195054',
internalId:  '',
customField: '20081107-010518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195096',
internalId:  '',
customField: '20081117-113440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195117',
internalId:  '',
customField: '20081117-233252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195138',
internalId:  '',
customField: '20081111-153805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195159',
internalId:  '',
customField: '20081111-153750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195201',
internalId:  '',
customField: '20081215-142655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204612',
internalId:  '',
customField: '20090208-061101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204812',
internalId:  '',
customField: '20090208-060357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '205812',
internalId:  '',
customField: '20090701-104313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '205833',
internalId:  '',
customField: '20090828-134139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '260619',
internalId:  '',
customField: '20090202-163255'
};
webappMappings['7050']=webappMappings['7050-136']={
webappId:    '7050',
documentId:  '234619',
internalId:  '136',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '209912',
internalId:  '',
customField: '20090828-134203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '220619',
internalId:  '',
customField: '20081113-171241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '224219',
internalId:  '',
customField: '20090715-203244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '229419',
internalId:  '',
customField: '20090202-181547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '234619',
internalId:  '',
customField: '20081207-083320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '256019',
internalId:  '',
customField: '20090208-055212'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INXSTH';
var companyName   = 'EMMANUEL+PRESBYTERIAN+REFORMED+CHURCH';
var htmlTitle	  = 'Emmanuel+Presbyterian+Reformed+Church%2C+Bronx%2C+New+York.';
var metaKeywords  = 'Emmanuel+Presbyterian+Reformed+Church.';
var metaContents  = 'Ghanaian+Presbyterian+Church+in+the+Bronx%2C+New+York%2C+PCG+in+the+Bronx%2C+New+York.+Rev.+Dr.+Kwame+Amoah-Kuma-Organizing+Minister%2FPastor%2C+Emmanuel+Presbyterian+Reformed+Church-Bronx%2CNew+York.Presbyterian+Church+USA%2C+PC%28USA%29';
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();
};
