/* [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','2201',jdecode('Home'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','85301',jdecode('Who+We+Are'),jdecode(''), jdecode('%2F85301.html'), 'true',[],'',''],
	['PAGE','103001',jdecode('Advent+Christmas+Epiphany'),jdecode(''), jdecode('%2F103001.html'), 'false',[],'',''],
	['PAGE','76801',jdecode('A+Letter+From+Pastor+Jeff'),jdecode(''), jdecode('%2F76801.html'), 'true',[],'',''],
	['PAGE','100201',jdecode('Worship+%26+Faith+Basics'),jdecode(''), jdecode('%2F100201.html'), 'true',[],'',''],
	['PAGE','8701',jdecode('Faith+Formation'),jdecode(''), jdecode('%2F8701.html'), 'true',[],'',''],
	['PAGE','73701',jdecode('Feb.+Lectionary+Readings'),jdecode(''), jdecode('%2F73701.html'), 'true',[],'',''],
	['PAGE','83601',jdecode('Community+Garden+'),jdecode(''), jdecode('%2F83601.html'), 'true',[],'',''],
	['PAGE','102101',jdecode('Community+Involvement'),jdecode(''), jdecode('%2F102101.html'), 'true',[],'',''],
	['PAGE','13001',jdecode('Hospitality%2FPublic+Presence'),jdecode(''), jdecode('%2F13001.html'), 'true',[],'',''],
	['PAGE','99701',jdecode('HPP--Basics'),jdecode(''), jdecode('%2F99701%2Findex.html'), 'true',[ 
		['PAGE','90401',jdecode('Scriptures+%26+Sermons+'),jdecode(''), jdecode('%2F99701%2F90401.html'), 'false',[],'','']
	],'',''],
	['PAGE','91901',jdecode('Deacons+Food+Pantry'),jdecode(''), jdecode('%2F91901.html'), 'true',[],'',''],
	['PAGE','76822',jdecode('Worship+Notes'),jdecode(''), jdecode('%2F76822.html'), 'false',[],'',''],
	['PAGE','91401',jdecode('Certificate+of+Appreciation'),jdecode(''), jdecode('%2F91401.html'), 'true',[],'',''],
	['PAGE','96822',jdecode('Activities--All+Church+Retreat'),jdecode(''), jdecode('%2F96822.html'), 'true',[],'',''],
	['PAGE','38901',jdecode('Activities-Church+Bazaar'),jdecode(''), jdecode('%2F38901.html'), 'true',[],'',''],
	['PAGE','80101',jdecode('Presbyterian+Disaster+Assist.'),jdecode(''), jdecode('%2F80101.html'), 'true',[],'',''],
	['PAGE','60101',jdecode('About+the+Pres.+Church'),jdecode(''), jdecode('%2F60101.html'), 'true',[],'',''],
	['PAGE','92501',jdecode('FAQs'),jdecode(''), jdecode('%2F92501.html'), 'true',[],'',''],
	['PAGE','39401',jdecode('Youth+Group'),jdecode(''), jdecode('%2F39401.html'), 'false',[],'',''],
	['PAGE','89501',jdecode('Sabbatical+Information'),jdecode(''), jdecode('%2F89501.html'), 'false',[],'',''],
	['PAGE','58401',jdecode('Vacation+Bible+School'),jdecode(''), jdecode('%2F58401.html'), 'false',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Dispose';
theSitetree.paletteFamily='E99C2E';
theSitetree.keyvisualId='9683';
theSitetree.keyvisualName='kv_9683.gif';
theSitetree.fontsetId='10658';
theSitetree.graphicsetId='11182';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCCACA';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'comcast',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Dispose',
				paletteFamily: 	'E99C2E',
				keyvisualId: 	'9683',
				keyvisualName: 	'kv_9683.gif',
				fontsetId: 		'10658',
				graphicsetId: 	'11182',
				contentColor: 	'000000',
				contentBGColor: 'CCCACA',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20120202-215855'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20120202-213633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20120202-214424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20111120-202744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39401',
internalId:  '',
customField: '20101004-215034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58401',
internalId:  '',
customField: '20110724-200234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60101',
internalId:  '',
customField: '20110530-192434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73701',
internalId:  '',
customField: '20120202-213841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76801',
internalId:  '',
customField: '20120202-212837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76822',
internalId:  '',
customField: '20110724-204435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80101',
internalId:  '',
customField: '20120202-215425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83601',
internalId:  '',
customField: '20120202-214621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85301',
internalId:  '',
customField: '20120202-215929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89501',
internalId:  '',
customField: '20110927-082743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90401',
internalId:  '',
customField: '20110831-221241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91401',
internalId:  '',
customField: '20110724-201132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91901',
internalId:  '',
customField: '20120202-214908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92501',
internalId:  '',
customField: '20110831-214834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96822',
internalId:  '',
customField: '20111102-222504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99701',
internalId:  '',
customField: '20111102-220824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100201',
internalId:  '',
customField: '20111102-222157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102101',
internalId:  '',
customField: '20111122-084135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103001',
internalId:  '',
customField: '20111130-224231'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INV2OQ';
var companyName   = 'Reedville+Presbyterian+Church';
var htmlTitle	  = 'Reedville+Presbyterian+Church%2C+Aloha%2C+Oregon';
var metaKeywords  = 'worship%2C+God%2C+christian%2C+hospitality%2C+community%2C+hope%2C+jesus+christ%2C+justice%2C++education%2C+invites%2C+strengthens%2C+faith%2C+cares%2C+connects%2C+wholeness%2C+service%2C+worked%2C+individually%2C+collectively%2C+pray%2C+sing%2C+give%2C+weclome%2C+seek%2C+truth%2C+scripture%2C+liturgical%2C+holy%2C+sacrament%2C+presbyterian+church+USA%2C+missionaries%2C+strong%2C+casual%2C+faithful%2C+AA+Meetings%2C+Boy+Scout+Meetings%2C+historical%2C+camp+adair%2C+surplus+army+chapel%2C+1907%2C+jeffery+sievert%2C+reedville%2C+hillsboro%2C+church%2C+aloha%2C+beaverton%2C+';
var metaContents  = 'Reedville+Presbyterian+Church+-+Intergenerational+worship+in+the+Reformed+tradition+at+9%3A30+am+every+Sunday%2C+located+in+Aloha+easily+accessible+from+Hillsboro+and+Beaverton.+Part+of+Presbyterian+Church+USA%2C+a+community+gathering+place+for+many+groups.+We+are+a+church+that+worships+God%2C+extends+hospitality%2C+seeks+justice%2C+and+cultivates+transformed+lives+through+worship%2C+education%2C+care+and+service.+Check+us+out%21';
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();
};

