/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','17201',jdecode('About+Us'),jdecode(''),'/17201.html','true',[],'',''],
	['PAGE','1852',jdecode('Church+History'),jdecode(''),'/1852.html','true',[],'',''],
	['PAGE','1873',jdecode('Pastor%26%23x27%3Bs+Page'),jdecode(''),'/1873.html','true',[],'',''],
	['PAGE','13701',jdecode('Our+First+Lady'),jdecode(''),'/13701.html','true',[],'',''],
	['PAGE','1894',jdecode('News'),jdecode(''),'/1894.html','true',[],'',''],
	['PAGE','31879',jdecode('Black+History+365'),jdecode(''),'/31879.html','true',[],'',''],
	['PAGE','1915',jdecode('Contact'),jdecode(''),'/1915.html','true',[],'',''],
	['PAGE','2201',jdecode('Calendar+of+Events'),jdecode(''),'/2201.html','true',[],'',''],
	['PAGE','3001',jdecode('Bible+Study'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','23568',jdecode('Wed.+Bible+Study+Notes'),jdecode(''),'/23568.html','true',[],'',''],
	['PAGE','23589',jdecode('Sat.+Bible+Study+Notes'),jdecode(''),'/23589/index.html','true',[ 
		['PAGE','24979',jdecode('The+Works+of+the+Flesh.'),jdecode(''),'/23589/24979.html','true',[],'',''],
		['PAGE','25679',jdecode('The+Struggles+of+The+Two+Natures+'),jdecode(''),'/23589/25679.html','true',[],'','']
	],'',''],
	['PAGE','2222',jdecode('Ministries'),jdecode(''),'/2222/index.html','true',[ 
		['PAGE','29579',jdecode('Health+Ministries'),jdecode(''),'/2222/29579.html','true',[],'',''],
		['PAGE','32679',jdecode('Womens+Fellowship'),jdecode(''),'/2222/32679.html','true',[],'',''],
		['PAGE','40393',jdecode('Sunday+School'),jdecode(''),'/2222/40393.html','true',[],'','']
	],'',''],
	['PAGE','16501',jdecode('Directions'),jdecode(''),'/16501.html','true',[],'',''],
	['PAGE','23468',jdecode('Photo+Gallery'),jdecode(''),'/23468.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Blossom';
theSitetree.paletteFamily='AC2E53';
theSitetree.keyvisualId='7113';
theSitetree.keyvisualName='kv_7113.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: 	'7113',
				keyvisualName: 	'kv_7113.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:  '1801',
internalId:  '',
customField: '20110906-133854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2222',
internalId:  '',
customField: '20081122-221828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20081030-224301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20081104-060457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20090510-195401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1915',
internalId:  '',
customField: '20081107-225728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20090510-195550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20081109-182303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20081102-175927'
};
webappMappings['1501']=webappMappings['1501-12556779']={
webappId:    '1501',
documentId:  '1801',
internalId:  '12556779',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23568',
internalId:  '',
customField: '20100429-074914'
};
webappMappings['7060']=webappMappings['7060-e79a9aef9e2da7c2d59c0331ee5dff83']={
webappId:    '7060',
documentId:  '23468',
internalId:  'e79a9aef9e2da7c2d59c0331ee5dff83',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20081030-041144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20081030-172702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23589',
internalId:  '',
customField: '20081109-182652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23468',
internalId:  '',
customField: '20081104-064253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24979',
internalId:  '',
customField: '20081107-142306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25679',
internalId:  '',
customField: '20081107-153143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29579',
internalId:  '',
customField: '20081117-192053'
};
webappMappings['7060']=webappMappings['7060-69880b5d77ca5748496dd9f4c66ada13']={
webappId:    '7060',
documentId:  '32679',
internalId:  '69880b5d77ca5748496dd9f4c66ada13',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31879',
internalId:  '',
customField: '20090222-211804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32679',
internalId:  '',
customField: '20090510-005814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40393',
internalId:  '',
customField: '20100207-194946'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEDJV';
var companyName   = 'New+Hope+Baptist+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();
};

