/* [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','1601',jdecode('Home'),jdecode(''),'/1601.html','true',[],'',''],
	['PAGE','35439',jdecode('Email+Us'),jdecode(''),'/35439.html','true',[],'',''],
	['PAGE','1652',jdecode('News'),jdecode(''),'/1652.html','true',[],'',''],
	['PAGE','1673',jdecode('Events+%26+Calendar'),jdecode(''),'/1673/index.html','true',[ 
		['PAGE','1694',jdecode('Calendar'),jdecode(''),'/1673/1694.html','true',[],'','']
	],'',''],
	['PAGE','5201',jdecode('Pastors+Page'),jdecode(''),'/5201.html','true',[],'',''],
	['PAGE','1778',jdecode('Angel+Food+Ministry+Info'),jdecode(''),'/1778.html','true',[],'',''],
	['PAGE','1757',jdecode('Z+I+O+N+'),jdecode(''),'/1757.html','true',[],'',''],
	['PAGE','1715',jdecode('Links'),jdecode(''),'/1715.html','true',[],'',''],
	['PAGE','1736',jdecode('About+us'),jdecode(''),'/1736.html','true',[],'',''],
	['PAGE','1799',jdecode('Contact'),jdecode(''),'/1799.html','true',[],'',''],
	['PAGE','1841',jdecode('How+to+find+us'),jdecode(''),'/1841.html','true',[],'',''],
	['PAGE','33681',jdecode('Map'),jdecode(''),'/33681.html','true',[],'',''],
	['PAGE','34360',jdecode('Help+For+Addictions'),jdecode(''),'/34360.html','true',[],'',''],
	['PAGE','35448',jdecode('Photos'),jdecode(''),'/35448.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Nurseries';
theSitetree.paletteFamily='93B9F3';
theSitetree.keyvisualId='7911';
theSitetree.keyvisualName='kv_7911.jpg';
theSitetree.fontsetId='16879';
theSitetree.graphicsetId='12317';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='93B9F3';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'true',
				name: 			'Nurseries',
				paletteFamily: 	'93B9F3',
				keyvisualId: 	'7911',
				keyvisualName: 	'kv_7911.jpg',
				fontsetId: 		'16879',
				graphicsetId: 	'12317',
				contentColor: 	'000000',
				contentBGColor: '93B9F3',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1673',
internalId:  '',
customField: '20100712-095000'
};
webappMappings['7008']=webappMappings['7008-6847']={
webappId:    '7008',
documentId:  '35439',
internalId:  '6847',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1694',
internalId:  '',
customField: '20090128-221747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100513-141325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20100712-095445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1652',
internalId:  '',
customField: '20100712-101609'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '33681',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1778',
internalId:  '',
customField: '20100712-115404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1757',
internalId:  '',
customField: '20091022-151756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1715',
internalId:  '',
customField: '20090128-222257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1736',
internalId:  '',
customField: '20090122-234141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1799',
internalId:  '',
customField: '20090128-222525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1841',
internalId:  '',
customField: '20090128-222615'
};
webappMappings['1501']=webappMappings['1501-2285558']={
webappId:    '1501',
documentId:  '1601',
internalId:  '2285558',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34360',
internalId:  '',
customField: '20090122-232309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33681',
internalId:  '',
customField: '20090122-234610'
};
webappMappings['7060']=webappMappings['7060-6c10845b53f257a4112509454ff5b283']={
webappId:    '7060',
documentId:  '35448',
internalId:  '6c10845b53f257a4112509454ff5b283',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35439',
internalId:  '',
customField: '20100223-132328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35448',
internalId:  '',
customField: '20100223-132328'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INXEWY';
var companyName   = 'New+Beginnings+Worship+Center';
var htmlTitle	  = 'New+Beginnings+Worship+Center+Church';
var metaKeywords  = '%2FNew+Beginnings+Worship+Center%2C+New+Beginnings+Worship+Center+Church%2C+New+Beginnings%2C+Worship+Center%2C+Worship%2C+Church%2C+new+beginning%2C+are+you+ready+for+a+new+beginning+in+your+life%2C+come+worship+the+Lord+with+us%2C+Jesus%2C+The+Lord%2C+where+new+beginnings+happen%2C+new+hope%2C+new+beginnings%2C+Host+Site+for+Angel+Food+Ministries%2C+save+money+on+your+grocery+bill+with+Angel+Food%2C+Angel+Food%2C+save+money%2C+cheap%2C+groceries%2C+cheap+groceries%2C+food%2C+save+on+food%2C+cheap+food%2C+peace%2C+salvation%2C+love+of+God%2C+find+God%2C';
var metaContents  = '%2FNew+Beginnings+Worship+Center%2C+New+Beginnings+Worship+Center+Church%2C+New+Beginnings%2C+Worship+Center%2C+Worship%2C+Church%2C+new+beginning%2C+are+you+ready+for+a+new+beginning+in+your+life%2C+come+worship+the+Lord+with+us%2C+Jesus%2C+The+Lord%2C+where+new+beginnings+happen%2C+new+hope%2C+new+beginnings%2C+Host+Site+for+Angel+Food+Ministries%2C+save+money+on+your+grocery+bill+with+Angel+Food%2C+Angel+Food%2C+save+money%2C+cheap%2C+groceries%2C+cheap+groceries%2C+food%2C+save+on+food%2C+cheap+food%2C+peace%2C+salvation%2C+love+of+God%2C+find+God%2C';
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();
};
