/* [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','1701',jdecode('Home'),jdecode(''),'/1701.html','true',[],''],
	['PAGE','1752',jdecode('Worship+Times'),jdecode(''),'/1752.html','true',[],''],
	['PAGE','81459',jdecode('Advent+Activities+%26+Schedule'),jdecode(''),'/81459.html','false',[],''],
	['PAGE','6601',jdecode('Location%2FDirections'),jdecode(''),'/6601.html','true',[],''],
	['PAGE','1794',jdecode('Parish+Calendar%2FSchedules'),jdecode(''),'/1794.html','false',[],''],
	['PAGE','33001',jdecode('Newsletter'),jdecode(''),'/33001.html','true',[],''],
	['PAGE','84559',jdecode('Links'),jdecode(''),'/84559.html','true',[],''],
	['PAGE','13101',jdecode('Wednesdays+at+Hope'),jdecode(''),'/13101.html','true',[],''],
	['PAGE','1773',jdecode('Ministries'),jdecode(''),'/1773.html','false',[],''],
	['PAGE','53701',jdecode('Parish+Profile'),jdecode(''),'/53701.html','false',[],''],
	['PAGE','21801',jdecode('Lay+Ministry+Opportunities'),jdecode(''),'/21801/index.html','true',[ 
		['PAGE','24101',jdecode('Ministries+for+Men'),jdecode(''),'/21801/24101.html','true',[],''],
		['PAGE','24201',jdecode('Ministries+for+Women'),jdecode(''),'/21801/24201.html','true',[],'']
	],''],
	['PAGE','14901',jdecode('Ministries+for+Youth+%26+Children'),jdecode(''),'/14901/index.html','true',[ 
		['PAGE','2101',jdecode('Ministries+for+Youth'),jdecode(''),'/14901/2101.html','true',[],''],
		['PAGE','50201',jdecode('Youth+News'),jdecode(''),'/14901/50201.html','true',[],''],
		['PAGE','16801',jdecode('Ministries+for+Children'),jdecode(''),'/14901/16801.html','true',[],'']
	],''],
	['PAGE','56301',jdecode('Mothers+of+Preschoolers'),jdecode(''),'/56301.html','true',[],''],
	['PAGE','8501',jdecode('Stewardship'),jdecode(''),'/8501.html','false',[],''],
	['PAGE','1857',jdecode('Christianity'),jdecode(''),'/1857/index.html','false',[ 
		['PAGE','1878',jdecode('New+Believers'),jdecode(''),'/1857/1878.html','true',[],'']
	],''],
	['PAGE','27901',jdecode('Special+Features'),jdecode(''),'/27901/index.html','false',[ 
		['PAGE','1836',jdecode('Hospitality+at+Hope'),jdecode(''),'/27901/1836.html','true',[],''],
		['PAGE','29101',jdecode('Creative+Crafts+for+all+Ages'),jdecode(''),'/27901/29101.html','true',[],'']
	],''],
	['PAGE','1899',jdecode('Resources'),jdecode(''),'/1899.html','true',[],''],
	['PAGE','6901',jdecode('Photo+Album'),jdecode(''),'/6901/index.html','true',[ 
		['PAGE','65731',jdecode('New+Ministry+Celebration+-+1%2F10%2F09'),jdecode(''),'/6901/65731.html','true',[],''],
		['PAGE','13701',jdecode('Christmas+Eve+-+2008'),jdecode(''),'/6901/13701.html','true',[],''],
		['PAGE','63719',jdecode('VBS+Photos+-+2009'),jdecode(''),'/6901/63719.html','true',[],'']
	],''],
	['PAGE','71023',jdecode('Contact'),jdecode(''),'/71023.html','true',[],''],
	['PAGE','7301',jdecode('Hope+Guest+Book'),jdecode(''),'/7301.html','true',[],''],
	['PAGE','1920',jdecode('Contact+Us'),jdecode(''),'/1920.html','true',[],'']];
var siteelementCount=32;
theSitetree.topTemplateName='Blossom';
theSitetree.paletteFamily='364EB6';
theSitetree.keyvisualId='7153';
theSitetree.keyvisualName='kv_7153.jpg';
theSitetree.fontsetId='16396';
theSitetree.graphicsetId='12129';
theSitetree.contentColor='364EB6';
theSitetree.contentBGColor='E5E2E2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Blossom',
				paletteFamily: 	'364EB6',
				keyvisualId: 	'7153',
				keyvisualName: 	'kv_7153.jpg',
				fontsetId: 		'16396',
				graphicsetId: 	'12129',
				contentColor: 	'364EB6',
				contentBGColor: 'E5E2E2',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20100115-221206'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1752',
internalId:  '',
customField: '20100115-221554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1773',
internalId:  '',
customField: '20090211-101347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1794',
internalId:  '',
customField: '20091120-123401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20090609-103936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20091208-184651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1836',
internalId:  '',
customField: '20090114-134427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1857',
internalId:  '',
customField: '20090211-103055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1878',
internalId:  '',
customField: '20081023-111025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1899',
internalId:  '',
customField: '20091208-190559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1920',
internalId:  '',
customField: '20090114-134718'
};
webappMappings['7008']=webappMappings['7008-8235']={
webappId:    '7008',
documentId:  '1920',
internalId:  '8235',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6601',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20091106-095830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20090910-122812'
};
webappMappings['1002']=webappMappings['1002-7301aendu0inewae']={
webappId:    '1002',
documentId:  '7301',
internalId:  '7301aendu0inewae',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20081229-084158'
};
webappMappings['7008']=webappMappings['7008-8703']={
webappId:    '7008',
documentId:  '8501',
internalId:  '8703',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20080918-195045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20100115-222801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20090618-213619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20091208-184459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24201',
internalId:  '',
customField: '20090114-123246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20090731-115300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24101',
internalId:  '',
customField: '20090731-115353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27901',
internalId:  '',
customField: '20090114-131155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29101',
internalId:  '',
customField: '20090114-134540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33001',
internalId:  '',
customField: '20091120-123701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50201',
internalId:  '',
customField: '20091106-095245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81459',
internalId:  '',
customField: '20091208-174813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53701',
internalId:  '',
customField: '20090515-122009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56301',
internalId:  '',
customField: '20090731-115134'
};
webappMappings['7060']=webappMappings['7060-0cdd80823ed39ebfd8e8573aaea282cd']={
webappId:    '7060',
documentId:  '13701',
internalId:  '0cdd80823ed39ebfd8e8573aaea282cd',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-a6e0a1162c9c91658a9636b870fca63f']={
webappId:    '7060',
documentId:  '63719',
internalId:  'a6e0a1162c9c91658a9636b870fca63f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63719',
internalId:  '',
customField: '20090910-122452'
};
webappMappings['7060']=webappMappings['7060-d24387fb395187a4d2040872c00da80c']={
webappId:    '7060',
documentId:  '65731',
internalId:  'd24387fb395187a4d2040872c00da80c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65731',
internalId:  '',
customField: '20090807-105649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71023',
internalId:  '',
customField: '20090619-143343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84559',
internalId:  '',
customField: '20100221-083005'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INEWAE';
var companyName   = 'Hope+Episcopal+Church';
var htmlTitle	  = '';
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();
};
