/* [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','1901',jdecode('Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','1952',jdecode('Beliefs'),jdecode(''), jdecode('%2F1952.html'), 'true',[],'',''],
	['PAGE','5501',jdecode('Schedule'),jdecode(''), jdecode('%2F5501.html'), 'true',[],'',''],
	['PAGE','1973',jdecode('Ministry'),jdecode(''), jdecode('%2F1973%2Findex.html'), 'true',[ 
		['PAGE','4601',jdecode('P.I.C.A.'),jdecode(''), jdecode('%2F1973%2F4601.html'), 'true',[],'',''],
		['PAGE','4622',jdecode('Youth+Ministries'),jdecode(''), jdecode('%2F1973%2F4622.html'), 'true',[],'',''],
		['PAGE','4643',jdecode('Children%26%23x27%3Bs+Ministry'),jdecode(''), jdecode('%2F1973%2F4643.html'), 'true',[],'',''],
		['PAGE','4664',jdecode('Visitation+Team+Ministry'),jdecode(''), jdecode('%2F1973%2F4664.html'), 'true',[],'',''],
		['PAGE','4685',jdecode('Adult+%26+Family'),jdecode(''), jdecode('%2F1973%2F4685.html'), 'true',[],'',''],
		['PAGE','4706',jdecode('Evangelism'),jdecode(''), jdecode('%2F1973%2F4706.html'), 'true',[],'',''],
		['PAGE','4727',jdecode('Praxis'),jdecode(''), jdecode('%2F1973%2F4727.html'), 'true',[],'',''],
		['PAGE','4748',jdecode('Missions'),jdecode(''), jdecode('%2F1973%2F4748.html'), 'true',[],'',''],
		['PAGE','18501',jdecode('Food+Pantry'),jdecode(''), jdecode('%2F1973%2F18501.html'), 'true',[],'',''],
		['PAGE','4769',jdecode('Grounds'),jdecode(''), jdecode('%2F1973%2F4769.html'), 'true',[],'',''],
		['PAGE','4790',jdecode('Music'),jdecode(''), jdecode('%2F1973%2F4790.html'), 'true',[],'',''],
		['PAGE','4811',jdecode('Drama'),jdecode(''), jdecode('%2F1973%2F4811.html'), 'true',[],'','']
	],'',''],
	['PAGE','1994',jdecode('Insight'),jdecode(''), jdecode('%2F1994%2Findex.html'), 'true',[ 
		['PAGE','4832',jdecode('Baptism'),jdecode(''), jdecode('%2F1994%2F4832.html'), 'true',[],'',''],
		['PAGE','4853',jdecode('Membership'),jdecode(''), jdecode('%2F1994%2F4853.html'), 'true',[],'',''],
		['PAGE','4874',jdecode('Weddings'),jdecode(''), jdecode('%2F1994%2F4874.html'), 'true',[],'',''],
		['PAGE','4895',jdecode('Giving'),jdecode(''), jdecode('%2F1994%2F4895.html'), 'true',[],'','']
	],'',''],
	['PAGE','2015',jdecode('Contact+Us'),jdecode(''), jdecode('%2F2015.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Vienna';
theSitetree.paletteFamily='CBE1FC';
theSitetree.keyvisualId='11874';
theSitetree.keyvisualName='kv_11874.jpg';
theSitetree.fontsetId='33180';
theSitetree.graphicsetId='14091';
theSitetree.contentColor='223144';
theSitetree.contentBGColor='d6e7fe';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vienna',
				paletteFamily: 	'CBE1FC',
				keyvisualId: 	'11874',
				keyvisualName: 	'kv_11874.jpg',
				fontsetId: 		'33180',
				graphicsetId: 	'14091',
				contentColor: 	'223144',
				contentBGColor: 'd6e7fe',
				a_color: 		'D6E7FE',
				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:  '1901',
internalId:  '',
customField: '20100610-173505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20110805-155358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1973',
internalId:  '',
customField: '20100518-153430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4622',
internalId:  '',
customField: '20110805-164647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1994',
internalId:  '',
customField: '20100223-212933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4832',
internalId:  '',
customField: '20100223-212827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4853',
internalId:  '',
customField: '20100223-213344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4895',
internalId:  '',
customField: '20100427-152544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2015',
internalId:  '',
customField: '20110908-173902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20111024-161544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4664',
internalId:  '',
customField: '20110908-175247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20111004-165526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4874',
internalId:  '',
customField: '20100317-174640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4643',
internalId:  '',
customField: '20110805-165023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4769',
internalId:  '',
customField: '20100427-160549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20100423-162901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4685',
internalId:  '',
customField: '20110524-135855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4706',
internalId:  '',
customField: '20100819-152349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4727',
internalId:  '',
customField: '20100427-152846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4748',
internalId:  '',
customField: '20101026-160426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4790',
internalId:  '',
customField: '20100427-155626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4811',
internalId:  '',
customField: '20100518-162933'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH7TR';
var companyName   = 'FIRST+BAPTIST+CHURCH';
var htmlTitle	  = '';
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();
};

