/* [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','701',jdecode('FROM+THE+PASTOR'),jdecode(''),'/701.html','true',[],''],
	['PAGE','752',jdecode('About+Us'),jdecode(''),'/752.html','true',[],''],
	['PAGE','33401',jdecode('CrossWay+Staff'),jdecode(''),'/33401.html','true',[],''],
	['PAGE','8701',jdecode('Worship+Times'),jdecode(''),'/8701.html','true',[],''],
	['PAGE','6901',jdecode('Sunday+School+'),jdecode(''),'/6901/index.html','true',[ 
		['PAGE','21101',jdecode('Classes'),jdecode(''),'/6901/21101.html','true',[],'']
	],''],
	['PAGE','773',jdecode('Contact'),jdecode(''),'/773/index.html','true',[ 
		['PAGE','5322',jdecode('How+to+find+us'),jdecode(''),'/773/5322.html','true',[],'']
	],''],
	['PAGE','794',jdecode('Events%2FNews'),jdecode(''),'/794.html','true',[],''],
	['PAGE','134912',jdecode('Crossway+Yellow+Pages'),jdecode(''),'/134912.html','true',[],''],
	['PAGE','39401',jdecode('Calendar'),jdecode(''),'/39401/index.html','true',[ 
		['PAGE','73001',jdecode('This+Month%26%23x27%3Bs+Helpers'),jdecode(''),'/39401/73001.html','true',[],'']
	],''],
	['PAGE','815',jdecode('Bulletins'),jdecode(''),'/815.html','true',[],''],
	['PAGE','14201',jdecode('CrossWay+Ministries'),jdecode(''),'/14201/index.html','true',[ 
		['PAGE','14222',jdecode('Children%26%23x27%3Bs+'),jdecode(''),'/14201/14222.html','true',[],''],
		['PAGE','14243',jdecode('Women%26%23x27%3Bs'),jdecode(''),'/14201/14243.html','true',[],''],
		['PAGE','20601',jdecode('Men%26%23x27%3Bs'),jdecode(''),'/14201/20601.html','true',[],''],
		['PAGE','14264',jdecode('theMILL+'),jdecode(''),'/14201/14264.html','true',[],''],
		['PAGE','20622',jdecode('Music'),jdecode(''),'/14201/20622.html','true',[],''],
		['PAGE','20643',jdecode('Missions'),jdecode(''),'/14201/20643.html','true',[],''],
		['PAGE','20706',jdecode('Hands+of+Grace'),jdecode(''),'/14201/20706.html','true',[],''],
		['PAGE','20727',jdecode('Senior+Adults'),jdecode(''),'/14201/20727.html','true',[],'']
	],''],
	['PAGE','20685',jdecode('Mother%26%23x27%3Bs+Day+Out'),jdecode(''),'/20685/index.html','true',[ 
		['PAGE','80085',jdecode('Background+Check'),jdecode(''),'/20685/80085.html','true',[],'']
	],''],
	['PAGE','80022',jdecode('Ministry+Opportunities'),jdecode(''),'/80022/index.html','true',[ 
		['PAGE','80043',jdecode('Student+Ministry+App'),jdecode(''),'/80022/80043.html','true',[],''],
		['PAGE','80064',jdecode('Nursery+Application'),jdecode(''),'/80022/80064.html','true',[],'']
	],''],
	['PAGE','5406',jdecode('New+Members'),jdecode(''),'/5406.html','true',[],''],
	['PAGE','134641',jdecode('Divorce+Care+-+Adults'),jdecode(''),'/134641.html','true',[],''],
	['PAGE','137670',jdecode('Divorce+Care+for+Kids'),jdecode(''),'/137670.html','true',[],''],
	['PAGE','5427',jdecode('Links'),jdecode(''),'/5427.html','true',[],''],
	['PAGE','118701',jdecode('Event+Scheduler'),jdecode(''),'/118701.html','true',[],''],
	['PAGE','133700',jdecode('Car+Show+2010'),jdecode(''),'/133700.html','true',[],''],
	['PAGE','52501',jdecode('Gospel+Music+Tour'),jdecode(''),'/52501.html','false',[],'']];
var siteelementCount=34;
theSitetree.topTemplateName='Canvas';
theSitetree.paletteFamily='FFB11A';
theSitetree.keyvisualId='3693';
theSitetree.keyvisualName='kv_3693.jpg';
theSitetree.fontsetId='10577';
theSitetree.graphicsetId='10936';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FCF6E5';
var theTemplate={
				name: 			'Canvas',
				paletteFamily: 	'FFB11A',
				keyvisualId: 	'3693',
				keyvisualName: 	'kv_3693.jpg',
				fontsetId: 		'10577',
				graphicsetId: 	'10936',
				contentColor: 	'000000',
				contentBGColor: 'FCF6E5',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'AF7A13',
				e_color: 		'AF7A13',
				f_color: 		'AF7A13',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-122286']={
webappId:    '1501',
documentId:  '701',
internalId:  '122286',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-82da533bb4f310c94e8fec7a579a8f93']={
webappId:    '7060',
documentId:  '52501',
internalId:  '82da533bb4f310c94e8fec7a579a8f93',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100225-190807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20091119-132320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33401',
internalId:  '',
customField: '20091119-132336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20091119-132425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20091119-132446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20091119-132614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20100108-172718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5322',
internalId:  '',
customField: '20091119-133140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20100225-191818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39401',
internalId:  '',
customField: '20100225-192201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73001',
internalId:  '',
customField: '20100225-192326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '815',
internalId:  '',
customField: '20100225-192430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20091119-133501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14222',
internalId:  '',
customField: '20091119-133527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14243',
internalId:  '',
customField: '20091119-133557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20091119-133615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14264',
internalId:  '',
customField: '20091119-133633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20622',
internalId:  '',
customField: '20091119-133651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20643',
internalId:  '',
customField: '20091119-134003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20706',
internalId:  '',
customField: '20091119-134026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20727',
internalId:  '',
customField: '20091119-134054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20685',
internalId:  '',
customField: '20100224-170048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80085',
internalId:  '',
customField: '20091119-134215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80022',
internalId:  '',
customField: '20091119-134246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80043',
internalId:  '',
customField: '20091119-134328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80064',
internalId:  '',
customField: '20091119-134527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52501',
internalId:  '',
customField: '20070922-141435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5406',
internalId:  '',
customField: '20100225-192525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5427',
internalId:  '',
customField: '20091119-134614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118701',
internalId:  '',
customField: '20091119-134728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133700',
internalId:  '',
customField: '20100211-233728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134912',
internalId:  '',
customField: '20091119-133218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134641',
internalId:  '',
customField: '20091119-134555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '137670',
internalId:  '',
customField: '20100225-180057'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2QJ';
var companyName   = 'CROSSWAY+BAPTIST+CHURCH';
var htmlTitle	  = 'CrossWay+Baptist+Church';
var metaKeywords  = 'Crossway+BaptistMurfreesboroCrossway+Baptist+Church';
var metaContents  = 'Crossway+Baptist+Church';
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();
};
