/* [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','53',jdecode('Home'),jdecode(''), jdecode('%2F53%2Findex.html'), 'true',[ 
		['PAGE','74',jdecode('Our+Purpose'),jdecode(''), jdecode('%2F53%2F74.html'), 'true',[],'','']
	],'',''],
	['PAGE','83',jdecode('Our+Pastor'),jdecode(''), jdecode('%2F83.html'), 'true',[],'',''],
	['PAGE','11001',jdecode('Church+Services'),jdecode(''), jdecode('%2F11001%2Findex.html'), 'true',[ 
		['PAGE','9501',jdecode('Sunday+Morning+Worship+Service'),jdecode(''), jdecode('%2F11001%2F9501.html'), 'true',[],'',''],
		['PAGE','173',jdecode('Tuesday+Night+Prayer+Service'),jdecode(''), jdecode('%2F11001%2F173.html'), 'true',[],'',''],
		['PAGE','9543',jdecode('Wednesday+Night+Bible+Study'),jdecode(''), jdecode('%2F11001%2F9543.html'), 'true',[],'','']
	],'',''],
	['PAGE','13001',jdecode('Media'),jdecode(''), jdecode('%2F13001.html'), 'true',[],'',''],
	['PAGE','14405',jdecode('In+The+News'),jdecode(''), jdecode('%2F14405.html'), 'true',[],'',''],
	['PAGE','23069',jdecode('Up+Coming+Events'),jdecode(''), jdecode('%2F23069%2Findex.html'), 'true',[ 
		['PAGE','2397',jdecode('Register'),jdecode(''), jdecode('%2F23069%2F2397.html'), 'false',[],'','']
	],'',''],
	['PAGE','92',jdecode('Church+Groups'),jdecode(''), jdecode('%2F92%2Findex.html'), 'true',[ 
		['PAGE','110',jdecode('Men%26%23x27%3Bs+Group'),jdecode(''), jdecode('%2F92%2F110.html'), 'true',[],'',''],
		['PAGE','119',jdecode('Woman%26%23x27%3Bs+Group'),jdecode(''), jdecode('%2F92%2F119.html'), 'true',[],'',''],
		['PAGE','137',jdecode('Youth+Group'),jdecode(''), jdecode('%2F92%2F137.html'), 'true',[],'',''],
		['PAGE','128',jdecode('Children%26%23x27%3Bs+Programs'),jdecode(''), jdecode('%2F92%2F128.html'), 'true',[],'','']
	],'',''],
	['PAGE','191',jdecode('Contact+Us'),jdecode(''), jdecode('%2F191%2Findex.html'), 'true',[ 
		['PAGE','1798',jdecode('Contact+Us+%28follow+up+page%29'),jdecode(''), jdecode('%2F191%2F1798.html'), 'false',[],'','']
	],'',''],
	['PAGE','2150',jdecode('Directions'),jdecode(''), jdecode('%2F2150.html'), 'true',[],'',''],
	['PAGE','2359',jdecode('Church+Photos'),jdecode(''), jdecode('%2F2359.html'), 'true',[],'',''],
	['PAGE','1924',jdecode('Guestbook'),jdecode(''), jdecode('%2F1924%2Findex.html'), 'true',[ 
		['PAGE','1923',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F1924%2F1923.html'), 'false',[],'','']
	],'',''],
	['PAGE','15805',jdecode('Pastor%26%23x27%3Bs+Blog'),jdecode(''), jdecode('%2F15805.html'), 'true',[],'',''],
	['PAGE','182',jdecode('Links'),jdecode(''), jdecode('%2F182.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Billy';
theSitetree.paletteFamily='8D7C50';
theSitetree.keyvisualId='7078';
theSitetree.keyvisualName='kv_7078.jpg';
theSitetree.fontsetId='16379';
theSitetree.graphicsetId='12126';
theSitetree.contentColor='534625';
theSitetree.contentBGColor='8D7C50';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Billy',
				paletteFamily: 	'8D7C50',
				keyvisualId: 	'7078',
				keyvisualName: 	'kv_7078.jpg',
				fontsetId: 		'16379',
				graphicsetId: 	'12126',
				contentColor: 	'534625',
				contentBGColor: '8D7C50',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14405',
internalId:  '',
customField: '20090723-190802'
};
webappMappings['7050']=webappMappings['7050-963']={
webappId:    '7050',
documentId:  '15805',
internalId:  '963',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '53',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2772']={
webappId:    '1501',
documentId:  '53',
internalId:  '2772',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-1924AHW050INXSGU']={
webappId:    '1002',
documentId:  '1924',
internalId:  '1924AHW050INXSGU',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20100721-125711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9543',
internalId:  '',
customField: '20111103-131153'
};
webappMappings['7008']=webappMappings['7008-8965']={
webappId:    '7008',
documentId:  '191',
internalId:  '8965',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-8e5fe62e264b06dbd41fd77bb171372f']={
webappId:    '7060',
documentId:  '2359',
internalId:  '8e5fe62e264b06dbd41fd77bb171372f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20111103-130315'
};
webappMappings['7008']=webappMappings['7008-3040']={
webappId:    '7008',
documentId:  '2397',
internalId:  '3040',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-3041']={
webappId:    '7008',
documentId:  '173',
internalId:  '3041',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20111109-123738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74',
internalId:  '',
customField: '20090514-101729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2397',
internalId:  '',
customField: '20090608-114324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110',
internalId:  '',
customField: '20111103-132150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '137',
internalId:  '',
customField: '20111103-132441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15805',
internalId:  '',
customField: '20111103-125931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92',
internalId:  '',
customField: '20111103-132046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83',
internalId:  '',
customField: '20111103-125737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119',
internalId:  '',
customField: '20111103-132309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128',
internalId:  '',
customField: '20111103-132653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173',
internalId:  '',
customField: '20111103-130730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '182',
internalId:  '',
customField: '20070903-021301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191',
internalId:  '',
customField: '20111103-132725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1798',
internalId:  '',
customField: '20060904-181211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1924',
internalId:  '',
customField: '20060904-190738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1923',
internalId:  '',
customField: '20060904-190738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23069',
internalId:  '',
customField: '20111103-131302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2150',
internalId:  '',
customField: '20091005-065237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20111103-144115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2359',
internalId:  '',
customField: '20070903-224110'
};
webappMappings['7060']=webappMappings['7060-10e88562105a0f0a3ddbbea458bd8226']={
webappId:    '7060',
documentId:  '13001',
internalId:  '10e88562105a0f0a3ddbbea458bd8226',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INXSGU';
var companyName   = 'Wading+River+Assembly++of+God+';
var htmlTitle	  = 'Wading+River+Assembly+of+God';
var metaKeywords  = 'Assembly++Wading+River++A%2FG+VBS+Vacation+Bible+School+Hoop+Camp+Basketball+Camp+Spiritual+Discipline+Assembly+of+God+Church++Wading+River+Assembly+of+God++Pentacostal+Church++Full+Gospel+Church+VBS+Vacation+Bible+School+Hoop+Camp+Basketball+Camp+Spiritual+Discipline+Kids+Camp+Evangelist+Community+The+Way+of+the+Master+Fine+Arts+Festival+Youth+Group+';
var metaContents  = 'Assembly+of+God+Church++Wading+River+Assembly+of+God++Pentacostal+Church++Full+Gospel+Church+VBS+Vacation+Bible+School+Hoop+Camp+Basketball+Camp+Spiritual+Discipline+Kids+Camp+Evangelist+Community';
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();
};

