/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],''],
	['PAGE','7901',jdecode('Our+History'),jdecode(''),'/7901.html','true',[],''],
	['PAGE','373',jdecode('About+our+Pastor'),jdecode(''),'/373.html','true',[],''],
	['PAGE','53501',jdecode('From+the+Bulletin'),jdecode(''),'/53501.html','true',[],''],
	['PAGE','51701',jdecode('Health+Fair'),jdecode(''),'/51701.html','true',[],''],
	['PAGE','42801',jdecode('Summer+Day+Camp'),jdecode(''),'/42801/index.html','true',[ 
		['PAGE','43101',jdecode('Camp+Information'),jdecode(''),'/42801/43101.html','true',[],''],
		['PAGE','43122',jdecode('Camp+Payments'),jdecode(''),'/42801/43122.html','true',[],''],
		['PAGE','42101',jdecode('Camp+Registration'),jdecode(''),'/42801/42101.html','true',[],''],
		['PAGE','52601',jdecode('Camp+Questions'),jdecode(''),'/42801/52601.html','true',[],''],
		['PAGE','5701',jdecode('Read+Guestbook'),jdecode(''),'/42801/5701.html','false',[],'']
	],''],
	['PAGE','29101',jdecode('Scholarship+Program'),jdecode(''),'/29101/index.html','true',[ 
		['PAGE','47701',jdecode('Scholarship+Luncheon'),jdecode(''),'/29101/47701.html','true',[],'']
	],''],
	['PAGE','415',jdecode('Ministries'),jdecode(''),'/415/index.html','true',[ 
		['PAGE','457',jdecode('Adults'),jdecode(''),'/415/457.html','true',[],''],
		['PAGE','478',jdecode('Children+%26+Youth'),jdecode(''),'/415/478.html','true',[],''],
		['PAGE','436',jdecode('Music+Department'),jdecode(''),'/415/436.html','true',[],''],
		['PAGE','499',jdecode('Community+and+Outreach'),jdecode(''),'/415/499.html','true',[],'']
	],''],
	['PAGE','7301',jdecode('FNC+CDC'),jdecode(''),'/7301.html','true',[],''],
	['PAGE','562',jdecode('Contact+Us'),jdecode(''),'/562.html','true',[],''],
	['PAGE','5706',jdecode('Guestbook'),jdecode(''),'/5706.html','true',[],'']];
var siteelementCount=21;
theSitetree.topTemplateName='Trend';
theSitetree.paletteFamily='3F70CF';
theSitetree.keyvisualId='7972';
theSitetree.keyvisualName='kv_7972.jpg';
theSitetree.fontsetId='16910';
theSitetree.graphicsetId='12323';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Trend',
				paletteFamily: 	'3F70CF',
				keyvisualId: 	'7972',
				keyvisualName: 	'kv_7972.jpg',
				fontsetId: 		'16910',
				graphicsetId: 	'12323',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42801',
internalId:  '',
customField: '20090630-154138'
};
webappMappings['1002']=webappMappings['1002-5706avec10inpn79']={
webappId:    '1002',
documentId:  '5706',
internalId:  '5706avec10inpn79',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52601',
internalId:  '',
customField: '20090630-152301'
};
webappMappings['7008']=webappMappings['7008-1936']={
webappId:    '7008',
documentId:  '301',
internalId:  '1936',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47701',
internalId:  '',
customField: '20090623-152454'
};
webappMappings['7008']=webappMappings['7008-1937']={
webappId:    '7008',
documentId:  '562',
internalId:  '1937',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51701',
internalId:  '',
customField: '20090729-150727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20090701-125516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20090217-134457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '373',
internalId:  '',
customField: '20081222-153833'
};
webappMappings['7008']=webappMappings['7008-7655']={
webappId:    '7008',
documentId:  '42101',
internalId:  '7655',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29101',
internalId:  '',
customField: '20090407-123224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '415',
internalId:  '',
customField: '20080915-175818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '457',
internalId:  '',
customField: '20080915-174537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '478',
internalId:  '',
customField: '20080915-174507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '436',
internalId:  '',
customField: '20081222-154758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '499',
internalId:  '',
customField: '20080915-173947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20090630-154616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42101',
internalId:  '',
customField: '20090528-190049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '562',
internalId:  '',
customField: '20090611-115835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5706',
internalId:  '',
customField: '20081206-163315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20080915-172001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43122',
internalId:  '',
customField: '20090611-122246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43101',
internalId:  '',
customField: '20090626-152522'
};
webappMappings['7008']=webappMappings['7008-8961']={
webappId:    '7008',
documentId:  '52601',
internalId:  '8961',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53501',
internalId:  '',
customField: '20090727-153304'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPN79';
var companyName   = 'First+New+Christian+Fellowship+MBC';
var htmlTitle	  = 'First+New+Christian';
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();
};
