/* [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','8012',jdecode('Home'),jdecode(''),'/8012/index.html','true',[ 
		['PAGE','8105',jdecode('About+Us'),jdecode(''),'/8012/8105.html','true',[],'',''],
		['PAGE','8063',jdecode('Outreach+Projects'),jdecode(''),'/8012/8063.html','true',[],'',''],
		['PAGE','8126',jdecode('Prayer'),jdecode(''),'/8012/8126.html','true',[],'','']
	],'',''],
	['PAGE','24623',jdecode('PODCASTS%2FVIDEOS'),jdecode(''),'/24623/index.html','true',[ 
		['PAGE','40144',jdecode('Photo+Album'),jdecode(''),'/24623/40144.html','true',[],'','']
	],'',''],
	['PAGE','23423',jdecode('Meetings'),jdecode(''),'/23423/index.html','true',[ 
		['PAGE','33623',jdecode('RSVP+to+Event'),jdecode(''),'/23423/33623.html','false',[],'',''],
		['PAGE','33644',jdecode('Radiant+%26+Ready'),jdecode(''),'/23423/33644.html','false',[],'',''],
		['PAGE','35323',jdecode('Radiant+%26+Ready+Mtg+Schedule'),jdecode(''),'/23423/35323.html','false',[],'',''],
		['PAGE','37023',jdecode('Lodging'),jdecode(''),'/23423/37023.html','false',[],'','']
	],'',''],
	['PAGE','24644',jdecode('Vision+and+Mission'),jdecode(''),'/24644/index.html','true',[ 
		['PAGE','22423',jdecode('Vision+Partners'),jdecode(''),'/24644/22423.html','true',[],'',''],
		['PAGE','28623',jdecode('Partner+Letters'),jdecode(''),'/24644/28623.html','true',[],'','']
	],'',''],
	['PAGE','11212',jdecode('Contact'),jdecode(''),'/11212/index.html','true',[ 
		['PAGE','11233',jdecode('Interesting+links'),jdecode(''),'/11212/11233.html','true',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Avocation';
theSitetree.paletteFamily='9590D2';
theSitetree.keyvisualId='4567';
theSitetree.keyvisualName='kv_4567.jpg';
theSitetree.fontsetId='10825';
theSitetree.graphicsetId='11277';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='9590D2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Avocation',
				paletteFamily: 	'9590D2',
				keyvisualId: 	'4567',
				keyvisualName: 	'kv_4567.jpg',
				fontsetId: 		'10825',
				graphicsetId: 	'11277',
				contentColor: 	'FFFFFF',
				contentBGColor: '9590D2',
				a_color: 		'9590D2',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'312C6A',
				e_color: 		'312C6A',
				f_color: 		'312C6A',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8012',
internalId:  '',
customField: '20100429-144347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8126',
internalId:  '',
customField: '20090324-192238'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '8012',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8063',
internalId:  '',
customField: '20090324-190607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8105',
internalId:  '',
customField: '20100321-213135'
};
webappMappings['7060']=webappMappings['7060-6943862c2ad1d4902cf29b055bdef6af']={
webappId:    '7060',
documentId:  '40144',
internalId:  '6943862c2ad1d4902cf29b055bdef6af',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11212',
internalId:  '',
customField: '20091007-092711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11233',
internalId:  '',
customField: '20100321-212415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33623',
internalId:  '',
customField: '20090808-150421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35323',
internalId:  '',
customField: '20091023-102224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37023',
internalId:  '',
customField: '20091023-101853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33644',
internalId:  '',
customField: '20091009-102634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22423',
internalId:  '',
customField: '20090324-221851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23423',
internalId:  '',
customField: '20100429-143922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28623',
internalId:  '',
customField: '20090620-142947'
};
webappMappings['7050']=webappMappings['7050-1182']={
webappId:    '7050',
documentId:  '28623',
internalId:  '1182',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24644',
internalId:  '',
customField: '20100321-205931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24623',
internalId:  '',
customField: '20100429-142506'
};
webappMappings['7008']=webappMappings['7008-4391']={
webappId:    '7008',
documentId:  '33623',
internalId:  '4391',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40144',
internalId:  '',
customField: '20100321-190837'
};
webappMappings['1501']=webappMappings['1501-7775396']={
webappId:    '1501',
documentId:  '8012',
internalId:  '7775396',
customField: '1501'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INL5UW';
var companyName   = 'Hands+for+the+Harvest+Ministries';
var htmlTitle	  = 'Hands+for+the+Harvest+Ministries+Dr.+Ray+and+Michelle+Pearson';
var metaKeywords  = 'online%2C+video%2C+health%2C+healing%2C+anointed+teaching%2C+Biblical+revelation%2C+practical+application++humor%2C+compassion%2C+testimonies%2C+Picture+of+Health%2C+devotional%2C+podcasts%2C+meetings%2C+grace%2C+diets%2C+eating+disorders%2C+disease%2C+allergies%2C+natural%2C+women%2C+weight+gain%2C+depression%2C+freedom%2C+recovery%2C+intimacy%2C+marriage%2C+emotions%2C+hormones%2C+Dr+Ray+Pearson%2C+Michelle+Pearson';
var metaContents  = 'Dr+Ray++Michelle+Pearson%2C+dynamic%2C+anointed+teaching%2C+videos+and+podcasts+with+Biblical+revelation+and+practical+application+salted+with+humor%2C+compassion%2C+and+real-life+testimonies%2C+devotional';
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();
};
