/* [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','3001',jdecode('Home'),jdecode(''), jdecode('%2F3001.html'), 'true',[],'',''],
	['PAGE','3765',jdecode('About+us'),jdecode(''), jdecode('%2F3765%2Findex.html'), 'true',[ 
		['PAGE','42001',jdecode('Staff'),jdecode(''), jdecode('%2F3765%2F42001.html'), 'true',[],'',''],
		['PAGE','3912',jdecode('Contact+Us'),jdecode(''), jdecode('%2F3765%2F3912.html'), 'true',[],'',''],
		['PAGE','82262',jdecode('Grapevine+%28Newsletter%29'),jdecode(''), jdecode('%2F3765%2F82262.html'), 'true',[],'',''],
		['PAGE','126486',jdecode('Directions'),jdecode(''), jdecode('%2F3765%2F126486.html'), 'true',[],'',''],
		['PAGE','22843',jdecode('Leadership'),jdecode(''), jdecode('%2F3765%2F22843.html'), 'true',[],'',''],
		['PAGE','132106',jdecode('RPC+outings+%26+activities'),jdecode(''), jdecode('%2F3765%2F132106.html'), 'true',[],'','']
	],'',''],
	['PAGE','22822',jdecode('Logistics'),jdecode(''), jdecode('%2F22822.html'), 'true',[],'',''],
	['PAGE','3786',jdecode('Discipleship'),jdecode(''), jdecode('%2F3786%2Findex.html'), 'true',[ 
		['PAGE','25101',jdecode('Christian+Education'),jdecode(''), jdecode('%2F3786%2F25101.html'), 'true',[],'',''],
		['PAGE','25122',jdecode('Children+and+Youth+'),jdecode(''), jdecode('%2F3786%2F25122.html'), 'true',[],'',''],
		['PAGE','25901',jdecode('Sunday+School'),jdecode(''), jdecode('%2F3786%2F25901.html'), 'true',[],'',''],
		['PAGE','25164',jdecode('Worship'),jdecode(''), jdecode('%2F3786%2F25164.html'), 'true',[],'',''],
		['PAGE','27201',jdecode('Adult+Choir'),jdecode(''), jdecode('%2F3786%2F27201.html'), 'true',[],'',''],
		['PAGE','25143',jdecode('Missions'),jdecode(''), jdecode('%2F3786%2F25143.html'), 'true',[],'','']
	],'',''],
	['PAGE','22801',jdecode('Congregational+Life'),jdecode(''), jdecode('%2F22801%2Findex.html'), 'true',[ 
		['PAGE','23001',jdecode('Fellowship'),jdecode(''), jdecode('%2F22801%2F23001.html'), 'true',[],'',''],
		['PAGE','126886',jdecode('Member+Care'),jdecode(''), jdecode('%2F22801%2F126886.html'), 'true',[],'',''],
		['PAGE','127186',jdecode('Presbyterian+Women'),jdecode(''), jdecode('%2F22801%2F127186.html'), 'true',[],'','']
	],'',''],
	['PAGE','3891',jdecode('Calendar'),jdecode(''), jdecode('%2F3891.html'), 'true',[],'',''],
	['PAGE','128286',jdecode('Links'),jdecode(''), jdecode('%2F128286.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1737';
theSitetree.keyvisualName='blumen.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLYTC2ZA'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1737',
				keyvisualName: 	'blumen.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20120105-142456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3912',
internalId:  '',
customField: '20110609-122756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23001',
internalId:  '',
customField: '20091117-102407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3765',
internalId:  '',
customField: '20110609-120633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3891',
internalId:  '',
customField: '20111206-143249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3786',
internalId:  '',
customField: '20110224-143945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20110224-144033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22822',
internalId:  '',
customField: '20110224-143859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25164',
internalId:  '',
customField: '20091105-141941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22843',
internalId:  '',
customField: '20110616-130938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25101',
internalId:  '',
customField: '20091119-142712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25901',
internalId:  '',
customField: '20091118-105823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25122',
internalId:  '',
customField: '20091103-122135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25143',
internalId:  '',
customField: '20091117-150115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20091112-140246'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42001',
internalId:  '',
customField: '20111215-131434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126486',
internalId:  '',
customField: '20091117-113645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82262',
internalId:  '',
customField: '20111206-143340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126886',
internalId:  '',
customField: '20091117-101340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127186',
internalId:  '',
customField: '20091118-113008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128286',
internalId:  '',
customField: '20111215-132131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132106',
internalId:  '',
customField: '20110630-142606'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHPI0';
var companyName   = 'Riverchase+Presbyterian+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();
};

