/* [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','2822',jdecode('Home'),jdecode(''), jdecode('%2F2822.html'), 'true',[],'',''],
	['PAGE','90723',jdecode('Our+Ministries'),jdecode(''), jdecode('%2F90723%2Findex.html'), 'true',[ 
		['PAGE','94439',jdecode('Nursery'),jdecode(''), jdecode('%2F90723%2F94439.html'), 'true',[],'',''],
		['PAGE','44012',jdecode('School+%26+Child+Care'),jdecode(''), jdecode('%2F90723%2F44012.html'), 'true',[],'',''],
		['PAGE','94739',jdecode('Children'),jdecode(''), jdecode('%2F90723%2F94739.html'), 'true',[],'',''],
		['PAGE','90660',jdecode('Youth'),jdecode(''), jdecode('%2F90723%2F90660.html'), 'true',[],'',''],
		['PAGE','130379',jdecode('Adults'),jdecode(''), jdecode('%2F90723%2F130379.html'), 'true',[],'',''],
		['PAGE','91839',jdecode('Older+Adults'),jdecode(''), jdecode('%2F90723%2F91839.html'), 'true',[],'',''],
		['PAGE','90702',jdecode('Methodist+Women'),jdecode(''), jdecode('%2F90723%2F90702.html'), 'true',[],'',''],
		['PAGE','90681',jdecode('Methodist+Men'),jdecode(''), jdecode('%2F90723%2F90681.html'), 'true',[],'',''],
		['PAGE','29401',jdecode('Music+Ministry'),jdecode(''), jdecode('%2F90723%2F29401.html'), 'true',[],'',''],
		['PAGE','100039',jdecode('Small+Groups'),jdecode(''), jdecode('%2F90723%2F100039.html'), 'true',[],'',''],
		['PAGE','98439',jdecode('Cub+Scouts'),jdecode(''), jdecode('%2F90723%2F98439.html'), 'true',[],'',''],
		['PAGE','87939',jdecode('Wesley+Nurse'),jdecode(''), jdecode('%2F90723%2F87939.html'), 'true',[],'',''],
		['PAGE','104039',jdecode('Emmaus'),jdecode(''), jdecode('%2F90723%2F104039.html'), 'true',[],'',''],
		['PAGE','291398',jdecode('July+Jubilee+BBQ'),jdecode(''), jdecode('%2F90723%2F291398.html'), 'true',[],'',''],
		['PAGE','87339',jdecode('VBS'),jdecode(''), jdecode('%2F90723%2F87339.html'), 'true',[],'',''],
		['PAGE','434753',jdecode('Laity+Empowerment'),jdecode(''), jdecode('%2F90723%2F434753.html'), 'false',[],'',''],
		['PAGE','429053',jdecode('Christmas+Cantata'),jdecode(''), jdecode('%2F90723%2F429053.html'), 'false',[],'','']
	],'',''],
	['PAGE','25901',jdecode('Sermons'),jdecode(''), jdecode('%2F25901.html'), 'true',[],'',''],
	['PAGE','96439',jdecode('Member+Profiles'),jdecode(''), jdecode('%2F96439%2Findex.html'), 'false',[ 
		['PAGE','304727',jdecode('February+2010'),jdecode(''), jdecode('%2F96439%2F304727.html'), 'true',[],'',''],
		['PAGE','318842',jdecode('March+2010'),jdecode(''), jdecode('%2F96439%2F318842.html'), 'true',[],'',''],
		['PAGE','96460',jdecode('April+2010'),jdecode(''), jdecode('%2F96439%2F96460.html'), 'true',[],'',''],
		['PAGE','144879',jdecode('May+2010'),jdecode(''), jdecode('%2F96439%2F144879.html'), 'true',[],'',''],
		['PAGE','236949',jdecode('September+2009'),jdecode(''), jdecode('%2F96439%2F236949.html'), 'true',[],'',''],
		['PAGE','253668',jdecode('October+2009'),jdecode(''), jdecode('%2F96439%2F253668.html'), 'true',[],'',''],
		['PAGE','265684',jdecode('November+2009'),jdecode(''), jdecode('%2F96439%2F265684.html'), 'true',[],'',''],
		['PAGE','278398',jdecode('December+2009'),jdecode(''), jdecode('%2F96439%2F278398.html'), 'true',[],'','']
	],'',''],
	['PAGE','259684',jdecode('Calendar'),jdecode(''), jdecode('%2F259684.html'), 'true',[],'',''],
	['PAGE','15201',jdecode('Contacts'),jdecode(''), jdecode('%2F15201%2Findex.html'), 'true',[ 
		['PAGE','266184',jdecode('Administration'),jdecode(''), jdecode('%2F15201%2F266184.html'), 'true',[],'','']
	],'',''],
	['PAGE','194779',jdecode('Photo+Gallery'),jdecode(''), jdecode('%2F194779%2Findex.html'), 'true',[ 
		['PAGE','513753',jdecode('Open+Hearts+%26%23x27%3B11-%26%23x27%3B12'),jdecode(''), jdecode('%2F194779%2F513753.html'), 'true',[],'',''],
		['PAGE','205523',jdecode('Open+Hearts+%26%23x27%3B10-%26%23x27%3B11'),jdecode(''), jdecode('%2F194779%2F205523.html'), 'true',[],'',''],
		['PAGE','299427',jdecode('Our+Newest+Members'),jdecode(''), jdecode('%2F194779%2F299427.html'), 'true',[],'',''],
		['PAGE','358842',jdecode('Youth+-+Various+Photos'),jdecode(''), jdecode('%2F194779%2F358842.html'), 'true',[],'',''],
		['PAGE','368442',jdecode('Youth+-+After+School'),jdecode(''), jdecode('%2F194779%2F368442.html'), 'true',[],'',''],
		['PAGE','401642',jdecode('Youth+Kick-off+2010'),jdecode(''), jdecode('%2F194779%2F401642.html'), 'false',[],'',''],
		['PAGE','427453',jdecode('Hanging+Greens'),jdecode(''), jdecode('%2F194779%2F427453.html'), 'false',[],'',''],
		['PAGE','459053',jdecode('Ski+2011'),jdecode(''), jdecode('%2F194779%2F459053.html'), 'true',[],'',''],
		['PAGE','465453',jdecode('Pine+Wood+Derby'),jdecode(''), jdecode('%2F194779%2F465453.html'), 'true',[],'',''],
		['PAGE','468353',jdecode('Maundy+Thursday'),jdecode(''), jdecode('%2F194779%2F468353.html'), 'true',[],'',''],
		['PAGE','403942',jdecode('VBS+2011'),jdecode(''), jdecode('%2F194779%2F403942.html'), 'true',[],'','']
	],'',''],
	['PAGE','232749',jdecode('The+Brady+Beacon'),jdecode(''), jdecode('%2F232749.html'), 'true',[],'',''],
	['PAGE','155679',jdecode('...Rethink+Church'),jdecode(''), jdecode('%2F155679.html'), 'true',[],'','']];
var siteelementCount=46;
theSitetree.topTemplateName='Common';
theSitetree.paletteFamily='D40202';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='26633';
theSitetree.graphicsetId='13449';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Common',
				paletteFamily: 	'D40202',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'26633',
				graphicsetId: 	'13449',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2822',
internalId:  '',
customField: '20120206-223954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20120201-230633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '459053',
internalId:  '',
customField: '20110406-191850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25901',
internalId:  '',
customField: '20120129-211534'
};
webappMappings['7060']=webappMappings['7060-c8888390611711fd7e08fc45ec16cd42']={
webappId:    '7060',
documentId:  '25901',
internalId:  'c8888390611711fd7e08fc45ec16cd42',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-4fd1437b57ee8122780d8d53beddfd5d']={
webappId:    '7060',
documentId:  '25901',
internalId:  '4fd1437b57ee8122780d8d53beddfd5d',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20120124-171318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91839',
internalId:  '',
customField: '20110518-191642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44012',
internalId:  '',
customField: '20120116-215752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '434753',
internalId:  '',
customField: '20110121-001756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130379',
internalId:  '',
customField: '20101121-153342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '236949',
internalId:  '',
customField: '20100327-211200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87339',
internalId:  '',
customField: '20120111-201708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87939',
internalId:  '',
customField: '20120124-171634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104039',
internalId:  '',
customField: '20120124-171810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90660',
internalId:  '',
customField: '20111201-222257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90702',
internalId:  '',
customField: '20111201-154401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90681',
internalId:  '',
customField: '20111127-174909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90723',
internalId:  '',
customField: '20110417-152626'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2822',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94439',
internalId:  '',
customField: '20110518-191506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94739',
internalId:  '',
customField: '20110522-143222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96439',
internalId:  '',
customField: '20100830-141339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96460',
internalId:  '',
customField: '20100808-104128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98439',
internalId:  '',
customField: '20120124-171529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100039',
internalId:  '',
customField: '20100327-205739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '403942',
internalId:  '',
customField: '20110730-090349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144879',
internalId:  '',
customField: '20100502-161147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '155679',
internalId:  '',
customField: '20110524-231202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '513753',
internalId:  '',
customField: '20120109-194935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '278398',
internalId:  '',
customField: '20100327-211248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '259684',
internalId:  '',
customField: '20120206-221453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '232749',
internalId:  '',
customField: '20120125-210547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '427453',
internalId:  '',
customField: '20110328-234458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '194779',
internalId:  '',
customField: '20120109-194829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '205523',
internalId:  '',
customField: '20110615-214911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401642',
internalId:  '',
customField: '20100920-142738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '299427',
internalId:  '',
customField: '20110522-001419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '291398',
internalId:  '',
customField: '20111127-174209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '266184',
internalId:  '',
customField: '20120110-193630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '265684',
internalId:  '',
customField: '20100327-211046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '253668',
internalId:  '',
customField: '20100327-211219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '304727',
internalId:  '',
customField: '20100327-211310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '318842',
internalId:  '',
customField: '20100327-211340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '429053',
internalId:  '',
customField: '20101130-121323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '368442',
internalId:  '',
customField: '20100920-135143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '358842',
internalId:  '',
customField: '20110522-001618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '465453',
internalId:  '',
customField: '20110417-155925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '468353',
internalId:  '',
customField: '20110502-205050'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN23FP';
var companyName   = 'First+United+Methodist+Church+-+Brady';
var htmlTitle	  = 'First+United+Methodist+Church+-+Brady';
var metaKeywords  = 'Brady+TX+Brady+Texas+Heart+of+Texas+First+United+Methodist+Church+Methodist+Hill+Country+Goat+Cook-off+Alan+Delafield+July+4th+BBQ+Miss+Heart+of+Texas+Fish+Fry+Pumpkin+Patch+Fourth+of+July+John+Alsbrooks';
var metaContents  = 'First+United+Methodist+Church%2C+Brady+Texas+Pastor%3A++John+Alsbrooks+-+Services%3A++Sunday+8%3A30a+%26+10%3A30a+Sunday+School%3A++Sunday+9%3A30a+See+Website+for+additional+information+%26+opportunities.';
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();
};

