/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','1852',jdecode('Who+We+Are'),jdecode(''),'/1852.html','true',[],''],
	['PAGE','1873',jdecode('Schedule%5CCalendar'),jdecode(''),'/1873/index.html','true',[ 
		['PAGE','9301',jdecode('Sunday+Schedule'),jdecode(''),'/1873/9301.html','true',[],''],
		['PAGE','9322',jdecode('Weekly+Calendar'),jdecode(''),'/1873/9322.html','true',[],'']
	],''],
	['PAGE','1936',jdecode('Location'),jdecode(''),'/1936.html','true',[],''],
	['PAGE','1957',jdecode('Leadership'),jdecode(''),'/1957.html','true',[],''],
	['PAGE','1978',jdecode('Ministries'),jdecode(''),'/1978/index.html','true',[ 
		['PAGE','1999',jdecode('Children%26%23x27%3Bs+Ministries'),jdecode(''),'/1978/1999.html','true',[],''],
		['PAGE','6701',jdecode('Youth+Ministries'),jdecode(''),'/1978/6701.html','true',[],''],
		['PAGE','6722',jdecode('Women%26%23x27%3Bs+Ministries'),jdecode(''),'/1978/6722.html','true',[],''],
		['PAGE','9343',jdecode('Men%26%23x27%3Bs+Ministries'),jdecode(''),'/1978/9343.html','true',[],''],
		['PAGE','9364',jdecode('Senior+Adult+Activities'),jdecode(''),'/1978/9364.html','true',[],''],
		['PAGE','9385',jdecode('Worship+Ministries'),jdecode(''),'/1978/9385.html','true',[],''],
		['PAGE','9406',jdecode('Care+Ministries'),jdecode(''),'/1978/9406.html','true',[],''],
		['PAGE','9427',jdecode('Prayer+Ministries'),jdecode(''),'/1978/9427.html','true',[],''],
		['PAGE','9448',jdecode('Adult+Bible+Fellowships'),jdecode(''),'/1978/9448.html','true',[],''],
		['PAGE','9469',jdecode('Small+Group+Ministries'),jdecode(''),'/1978/9469.html','true',[],'']
	],''],
	['PAGE','9490',jdecode('Resources'),jdecode(''),'/9490.html','true',[],''],
	['PAGE','9511',jdecode('Communication'),jdecode(''),'/9511/index.html','true',[ 
		['PAGE','9532',jdecode('The+Communicator'),jdecode(''),'/9511/9532.html','true',[],''],
		['PAGE','9553',jdecode('Current+Events'),jdecode(''),'/9511/9553.html','false',[],''],
		['PAGE','9574',jdecode('Wikispaces'),jdecode(''),'/9511/9574.html','true',[],'']
	],''],
	['PAGE','9595',jdecode('Prayer+Requests'),jdecode(''),'/9595.html','true',[],''],
	['PAGE','9616',jdecode('Prophetic'),jdecode(''),'/9616.html','false',[],''],
	['PAGE','9637',jdecode('Membership'),jdecode(''),'/9637.html','true',[],''],
	['PAGE','9658',jdecode('Getting+Connected'),jdecode(''),'/9658.html','true',[],''],
	['PAGE','63701',jdecode('Emergency+Response'),jdecode(''),'/63701.html','false',[],''],
	['PAGE','138001',jdecode('Testimonies'),jdecode(''),'/138001.html','true',[],'']];
var siteelementCount=29;
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 theTemplate={
				name: 			'Gaudy',
				paletteFamily: 	'5C5D96',
				keyvisualId: 	'5976',
				keyvisualName: 	'kv_5976.jpg',
				fontsetId: 		'11113',
				graphicsetId: 	'11905',
				contentColor: 	'FFFFFF',
				contentBGColor: '6E8BCE',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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: '20100218-233028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20080524-154245'
};
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: '20080930-114324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1957',
internalId:  '',
customField: '20091104-182240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20080507-213543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9322',
internalId:  '',
customField: '20080402-003201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9658',
internalId:  '',
customField: '20081202-204236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1936',
internalId:  '',
customField: '20080402-002458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1999',
internalId:  '',
customField: '20100224-143200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6722',
internalId:  '',
customField: '20080401-233115'
};
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: '20090819-192610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9448',
internalId:  '',
customField: '20090813-001433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9469',
internalId:  '',
customField: '20081209-201715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9490',
internalId:  '',
customField: '20091209-232923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9511',
internalId:  '',
customField: '20081202-204447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9532',
internalId:  '',
customField: '20100202-010322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9553',
internalId:  '',
customField: '20090809-185900'
};
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:  '138001',
internalId:  '',
customField: '20091209-232205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63701',
internalId:  '',
customField: '20080820-223450'
};
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();
};
