/* [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(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','1852',jdecode('Who+We+Are'),jdecode(''), jdecode('%2F1852.html'), 'true',[],'',''],
	['PAGE','1873',jdecode('Schedule%5CCalendar'),jdecode(''), jdecode('%2F1873%2Findex.html'), 'true',[ 
		['PAGE','9301',jdecode('Sunday+Schedule'),jdecode(''), jdecode('%2F1873%2F9301.html'), 'true',[],'',''],
		['PAGE','9322',jdecode('Weekly+Calendar'),jdecode(''), jdecode('%2F1873%2F9322.html'), 'true',[],'',''],
		['PAGE','166234',jdecode('Reserve+Facilities'),jdecode(''), jdecode('%2F1873%2F166234.html'), 'true',[],'',''],
		['PAGE','172467',jdecode('Special+Event+Registration'),jdecode(''), jdecode('%2F1873%2F172467.html'), 'true',[],'','']
	],'',''],
	['PAGE','1936',jdecode('Location'),jdecode(''), jdecode('%2F1936.html'), 'true',[],'',''],
	['PAGE','1957',jdecode('Leadership'),jdecode(''), jdecode('%2F1957.html'), 'true',[],'',''],
	['PAGE','1978',jdecode('Ministries'),jdecode(''), jdecode('%2F1978%2Findex.html'), 'true',[ 
		['PAGE','1999',jdecode('Children%26%23x27%3Bs+Ministries'),jdecode(''), jdecode('%2F1978%2F1999.html'), 'true',[],'',''],
		['PAGE','6701',jdecode('Youth+Ministries'),jdecode(''), jdecode('%2F1978%2F6701.html'), 'true',[],'',''],
		['PAGE','6722',jdecode('Women%26%23x27%3Bs+Ministries'),jdecode(''), jdecode('%2F1978%2F6722.html'), 'true',[],'',''],
		['PAGE','9343',jdecode('Men%26%23x27%3Bs+Ministries'),jdecode(''), jdecode('%2F1978%2F9343.html'), 'true',[],'',''],
		['PAGE','9364',jdecode('Senior+Adult+Activities'),jdecode(''), jdecode('%2F1978%2F9364.html'), 'true',[],'',''],
		['PAGE','9385',jdecode('Worship+Ministries'),jdecode(''), jdecode('%2F1978%2F9385.html'), 'true',[],'',''],
		['PAGE','9406',jdecode('Care+Ministries'),jdecode(''), jdecode('%2F1978%2F9406.html'), 'true',[],'',''],
		['PAGE','9427',jdecode('Prayer+Ministries'),jdecode(''), jdecode('%2F1978%2F9427.html'), 'true',[],'',''],
		['PAGE','9448',jdecode('Adult+Bible+Fellowships'),jdecode(''), jdecode('%2F1978%2F9448.html'), 'true',[],'',''],
		['PAGE','9469',jdecode('Small+Group+Ministries'),jdecode(''), jdecode('%2F1978%2F9469.html'), 'true',[],'','']
	],'',''],
	['PAGE','9490',jdecode('Resources'),jdecode(''), jdecode('%2F9490.html'), 'true',[],'',''],
	['PAGE','147601',jdecode('Podcast'),jdecode(''), jdecode('%2F147601.html'), 'true',[],'',''],
	['PAGE','9511',jdecode('Communication'),jdecode(''), jdecode('%2F9511%2Findex.html'), 'true',[ 
		['PAGE','9532',jdecode('The+Communicator'),jdecode(''), jdecode('%2F9511%2F9532.html'), 'true',[],'',''],
		['PAGE','9553',jdecode('Current+Events'),jdecode(''), jdecode('%2F9511%2F9553.html'), 'false',[],'',''],
		['PAGE','9574',jdecode('Wikispaces'),jdecode(''), jdecode('%2F9511%2F9574.html'), 'true',[],'','']
	],'',''],
	['PAGE','9595',jdecode('Prayer+Requests'),jdecode(''), jdecode('%2F9595.html'), 'true',[],'',''],
	['PAGE','9616',jdecode('Prophetic'),jdecode(''), jdecode('%2F9616.html'), 'false',[],'',''],
	['PAGE','9637',jdecode('Membership'),jdecode(''), jdecode('%2F9637.html'), 'true',[],'',''],
	['PAGE','9658',jdecode('Getting+Connected'),jdecode(''), jdecode('%2F9658.html'), 'true',[],'',''],
	['PAGE','63701',jdecode('Emergency+Response'),jdecode(''), jdecode('%2F63701.html'), 'false',[],'',''],
	['PAGE','138001',jdecode('Testimonies'),jdecode(''), jdecode('%2F138001.html'), 'false',[],'',''],
	['PAGE','148412',jdecode('Willow%40work'),jdecode(''), jdecode('%2F148412.html'), 'false',[],'',''],
	['PAGE','153523',jdecode('Donation'),jdecode(''), jdecode('%2F153523.html'), 'true',[],'',''],
	['PAGE','164334',jdecode('WEE+Place+Preschool'),jdecode(''), jdecode('%2F164334.html'), 'true',[],'','']];
var siteelementCount=35;
theSitetree.topTemplateName='Gaudy';
theSitetree.paletteFamily='5C5D96';
theSitetree.keyvisualId='5976';
theSitetree.keyvisualName='kv_5976.jpg';
theSitetree.fontsetId='11113';
theSitetree.graphicsetId='11905';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6E8BCE';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNU'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Gaudy',
				paletteFamily: 	'5C5D96',
				keyvisualId: 	'5976',
				keyvisualName: 	'kv_5976.jpg',
				fontsetId: 		'11113',
				graphicsetId: 	'11905',
				contentColor: 	'FFFFFF',
				contentBGColor: '6E8BCE',
				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:  '1801',
internalId:  '',
customField: '20120204-014943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20110908-110917'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '1936',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1978',
internalId:  '',
customField: '20080524-155429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20081209-202304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100311-224519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1957',
internalId:  '',
customField: '20101014-205515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20080507-213543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9322',
internalId:  '',
customField: '20110427-000050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9658',
internalId:  '',
customField: '20081202-204236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1936',
internalId:  '',
customField: '20100808-182541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1999',
internalId:  '',
customField: '20120123-121617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6722',
internalId:  '',
customField: '20100421-225731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9343',
internalId:  '',
customField: '20081209-201830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9364',
internalId:  '',
customField: '20080401-233934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9385',
internalId:  '',
customField: '20081202-204140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9406',
internalId:  '',
customField: '20080401-234622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9427',
internalId:  '',
customField: '20100728-220615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9448',
internalId:  '',
customField: '20100421-225907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9469',
internalId:  '',
customField: '20100826-203942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9490',
internalId:  '',
customField: '20110922-213315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9511',
internalId:  '',
customField: '20081202-204447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9532',
internalId:  '',
customField: '20120204-015205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9553',
internalId:  '',
customField: '20100506-000957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9574',
internalId:  '',
customField: '20080402-003048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9595',
internalId:  '',
customField: '20090729-005546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9616',
internalId:  '',
customField: '20090502-134815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9637',
internalId:  '',
customField: '20080401-212558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147601',
internalId:  '',
customField: '20100506-001924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138001',
internalId:  '',
customField: '20100429-225900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63701',
internalId:  '',
customField: '20080820-223450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '164334',
internalId:  '',
customField: '20110418-201648'
};
webappMappings['7008']=webappMappings['7008-36173']={
webappId:    '7008',
documentId:  '166234',
internalId:  '36173',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148412',
internalId:  '',
customField: '20100519-004227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '153523',
internalId:  '',
customField: '20100722-232226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166234',
internalId:  '',
customField: '20110621-220942'
};
webappMappings['7008']=webappMappings['7008-5201']={
webappId:    '7008',
documentId:  '172467',
internalId:  '5201',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '172467',
internalId:  '',
customField: '20110908-110959'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2QZR';
var companyName   = 'WDBC';
var htmlTitle	  = 'Willow+Drive+Baptist+Church+-+Lake+Jackson%2C+TX';
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();
};

