/* [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','5201',jdecode('Home'),jdecode(''),'/5201.html','true',[],''],
	['PAGE','5252',jdecode('About+us'),jdecode(''),'/5252.html','true',[],''],
	['PAGE','5315',jdecode('General+Information'),jdecode(''),'/5315.html','true',[],''],
	['PAGE','9801',jdecode('Meet+Our+Staff'),jdecode(''),'/9801.html','true',[],''],
	['PAGE','14285',jdecode('Ministries+of+FBC'),jdecode(''),'/14285/index.html','true',[ 
		['PAGE','14306',jdecode('Music'),jdecode(''),'/14285/14306.html','true',[],''],
		['PAGE','14327',jdecode('Youth'),jdecode(''),'/14285/14327.html','true',[],''],
		['PAGE','14348',jdecode('Children'),jdecode(''),'/14285/14348.html','true',[],''],
		['PAGE','19101',jdecode('Missions+and+Outreach'),jdecode(''),'/14285/19101.html','true',[],''],
		['PAGE','14369',jdecode('Senior+Adult+Ministry'),jdecode(''),'/14285/14369.html','true',[],'']
	],''],
	['PAGE','24401',jdecode('The+ShanPu+Refugee+Family'),jdecode(''),'/24401.html','true',[],''],
	['PAGE','14201',jdecode('News'),jdecode(''),'/14201/index.html','true',[ 
		['PAGE','14222',jdecode('Calendar+of+Events'),jdecode(''),'/14201/14222.html','true',[],'']
	],''],
	['PAGE','12701',jdecode('Contact+Us'),jdecode(''),'/12701.html','true',[],''],
	['PAGE','5294',jdecode('Acceptance'),jdecode(''),'/5294.html','true',[],''],
	['PAGE','7001',jdecode('Our+Mission'),jdecode(''),'/7001.html','true',[],''],
	['PAGE','9401',jdecode('Our+Core+Values'),jdecode(''),'/9401.html','true',[],''],
	['PAGE','9201',jdecode('Our+Location'),jdecode(''),'/9201.html','true',[],''],
	['PAGE','12501',jdecode('Sign+Up+%26+Get+Involved'),jdecode(''),'/12501.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Symmetry';
theSitetree.paletteFamily='5EAA8E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10457';
theSitetree.graphicsetId='10872';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='5EAA8E';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Symmetry',
				paletteFamily: 	'5EAA8E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10457',
				graphicsetId: 	'10872',
				contentColor: 	'000000',
				contentBGColor: '5EAA8E',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'5EAA8E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100211-110700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5252',
internalId:  '',
customField: '20080715-105915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14306',
internalId:  '',
customField: '20090910-113102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5294',
internalId:  '',
customField: '20080715-110008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5315',
internalId:  '',
customField: '20080715-110106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20080506-130330'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20080506-130415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20080506-130615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20100126-120322'
};
webappMappings['7008']=webappMappings['7008-3848']={
webappId:    '7008',
documentId:  '12701',
internalId:  '3848',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-3847']={
webappId:    '7008',
documentId:  '12501',
internalId:  '3847',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20100118-145828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20090910-114849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20090118-230752'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '9201',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20100126-115250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14222',
internalId:  '',
customField: '20100126-115317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14285',
internalId:  '',
customField: '20100126-114259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14327',
internalId:  '',
customField: '20090910-113630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14348',
internalId:  '',
customField: '20090910-113914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14369',
internalId:  '',
customField: '20100126-121513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24401',
internalId:  '',
customField: '20100126-115706'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2NRW';
var companyName   = 'First+Baptist+Church+of+Shepherdsville%2C+KY';
var htmlTitle	  = 'First+Baptist+Church+Shepherdsville+KY';
var metaKeywords  = 'first+baptist+church+shepherdsville+ky+churches+shepherdsville+baptist';
var metaContents  = 'First+Baptist+Church+Shepherdsville+KY%2C+fbc+shepherdsville%2C+shepherdsville+fbc%2C+shepfbc';
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();
};
