/* [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','34801',jdecode('Homepage'),jdecode(''), jdecode('%2F34801.html'), 'true',[],'',''],
	['PAGE','7043',jdecode('4th+Episcopal+Bishop'),jdecode(''), jdecode('%2F7043.html'), 'true',[],'',''],
	['PAGE','145001',jdecode('4th+Episcopal+First+Lady'),jdecode(''), jdecode('%2F145001.html'), 'true',[],'',''],
	['PAGE','7064',jdecode('Presiding+Elder'),jdecode(''), jdecode('%2F7064.html'), 'true',[],'',''],
	['PAGE','7106',jdecode('Churches%2FPastors'),jdecode(''), jdecode('%2F7106%2Findex.html'), 'true',[ 
		['PAGE','37001',jdecode('Reeves+Temple'),jdecode(''), jdecode('%2F7106%2F37001.html'), 'true',[],'',''],
		['PAGE','112601',jdecode('Bethel'),jdecode(''), jdecode('%2F7106%2F112601.html'), 'true',[],'',''],
		['PAGE','104201',jdecode('New+Hope'),jdecode(''), jdecode('%2F7106%2F104201.html'), 'true',[],'',''],
		['PAGE','67901',jdecode('Mt.+Nebo%2FSt.+Paul'),jdecode(''), jdecode('%2F7106%2F67901.html'), 'true',[],'',''],
		['PAGE','136101',jdecode('Williams+Chapel'),jdecode(''), jdecode('%2F7106%2F136101.html'), 'true',[],'',''],
		['PAGE','30501',jdecode('Merrick+Chapel'),jdecode(''), jdecode('%2F7106%2F30501.html'), 'true',[],'',''],
		['PAGE','152301',jdecode('Cross+Memorial'),jdecode(''), jdecode('%2F7106%2F152301.html'), 'true',[],'','']
	],'',''],
	['PAGE','7148',jdecode('Officers'),jdecode(''), jdecode('%2F7148.html'), 'true',[],'',''],
	['PAGE','172801',jdecode('SLR+Annual+Conf+2011'),jdecode(''), jdecode('%2F172801.html'), 'true',[],'',''],
	['PAGE','7001',jdecode('Calendar+of+Events'),jdecode(''), jdecode('%2F7001.html'), 'true',[],'',''],
	['PAGE','25801',jdecode('Announcements'),jdecode(''), jdecode('%2F25801.html'), 'true',[],'',''],
	['PAGE','111501',jdecode('Community+Services'),jdecode(''), jdecode('%2F111501.html'), 'true',[],'',''],
	['PAGE','31901',jdecode('Voting+Information'),jdecode(''), jdecode('%2F31901.html'), 'true',[],'',''],
	['PAGE','27122',jdecode('Pictures%2FActivities'),jdecode(''), jdecode('%2F27122.html'), 'true',[],'',''],
	['PAGE','6922',jdecode('Email%2FLinks%2FGuestbook'),jdecode(''), jdecode('%2F6922.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Orbit';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='175';
theSitetree.graphicsetId='202';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003366';
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: 			'Orbit',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'175',
				graphicsetId: 	'202',
				contentColor: 	'FFFFFF',
				contentBGColor: '003366',
				a_color: 		'003366',
				b_color: 		'336699',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6922',
internalId:  '',
customField: '20091009-200148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7043',
internalId:  '',
customField: '20110813-221007'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '34801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7064',
internalId:  '',
customField: '20111206-151144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37001',
internalId:  '',
customField: '20110907-123307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7106',
internalId:  '',
customField: '20111107-151403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31901',
internalId:  '',
customField: '20110629-093717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7148',
internalId:  '',
customField: '20110907-125549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20120118-112332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25801',
internalId:  '',
customField: '20120129-223909'
};
webappMappings['1002']=webappMappings['1002-6922aendu0inecqf']={
webappId:    '1002',
documentId:  '6922',
internalId:  '6922aendu0inecqf',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20110907-124135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27122',
internalId:  '',
customField: '20110518-204923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145001',
internalId:  '',
customField: '20100716-222802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34801',
internalId:  '',
customField: '20120128-135820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67901',
internalId:  '',
customField: '20111115-101225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104201',
internalId:  '',
customField: '20111115-130125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111501',
internalId:  '',
customField: '20110402-084159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112601',
internalId:  '',
customField: '20111212-163656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136101',
internalId:  '',
customField: '20111107-151427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152301',
internalId:  '',
customField: '20110907-124410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '172801',
internalId:  '',
customField: '20110611-111405'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INECQF';
var companyName   = 'Crowley+District+Christian+Methodist+Episcopal+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();
};

