/* [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','2010',jdecode('Home'),jdecode(''),'/2010.html','true',[],'',''],
	['PAGE','2031',jdecode('About+Us'),jdecode(''),'/2031/index.html','true',[ 
		['PAGE','15301',jdecode('Patrick+Newton+Bio'),jdecode(''),'/2031/15301.html','true',[],'','']
	],'',''],
	['PAGE','3401',jdecode('Partners'),jdecode(''),'/3401.html','true',[],'',''],
	['PAGE','2084',jdecode('Testimonies'),jdecode(''),'/2084.html','true',[],'',''],
	['PAGE','16501',jdecode('Prayer+Requests'),jdecode(''),'/16501.html','true',[],'',''],
	['PAGE','5401',jdecode('What+do+you+think%3F'),jdecode(''),'/5401.html','false',[],'',''],
	['PAGE','5901',jdecode('Donations'),jdecode(''),'/5901.html','true',[],'',''],
	['PAGE','2105',jdecode('Contact'),jdecode(''),'/2105.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Care';
theSitetree.paletteFamily='EE8240';
theSitetree.keyvisualId='226';
theSitetree.keyvisualName='studenten.jpg';
theSitetree.fontsetId='24';
theSitetree.graphicsetId='23';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Care',
				paletteFamily: 	'EE8240',
				keyvisualId: 	'226',
				keyvisualName: 	'studenten.jpg',
				fontsetId: 		'24',
				graphicsetId: 	'23',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'EE8240',
				b_color: 		'669966',
				c_color: 		'000000',
				d_color: 		'6A8493',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7005']=webappMappings['7005-561']={
webappId:    '7005',
documentId:  '5401',
internalId:  '561',
customField: 'language:en;country:US;'
};
webappMappings['7002']=webappMappings['7002-1214']={
webappId:    '7002',
documentId:  '2084',
internalId:  '1214',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-7455']={
webappId:    '7008',
documentId:  '2105',
internalId:  '7455',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2010',
internalId:  '',
customField: '20100512-122530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2031',
internalId:  '',
customField: '20100512-122551'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2010',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20100512-124037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2084',
internalId:  '',
customField: '20100408-102101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2105',
internalId:  '',
customField: '20100512-122448'
};
webappMappings['1501']=webappMappings['1501-7114265']={
webappId:    '1501',
documentId:  '2010',
internalId:  '7114265',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20100408-103726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20100408-110108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15301',
internalId:  '',
customField: '20100512-123519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20100512-121510'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INZO1Y';
var companyName   = 'Patrick+Newton+Ministries';
var htmlTitle	  = 'Patrick+Newton+Ministries';
var metaKeywords  = 'Patrick%2C+Newton%2C+Assembly+of+God+preachers+healing+miracles+spiritual+gifts';
var metaContents  = 'The+official+home+page+of+Patrick+Newton+ministries.+Reverend+Patrick+Newton+is+an+Ordained+minister+with+the+Assemblies+of+God.++With+over+two+decades+of+ministerial+experience%2C+Patrick+Newton+Ministries+is+making+great+strides+for+the+cause+of+Christ.+++Although+preaching+the+Word+is+his+passion%2C+through+the+years+his+ministry+has+expanded+to+include+various+ministries.++Some+of+these+include+co-hosting+a+radio+program%2C+song+writing%2C+producing+various+Christian+productions%2C+authoring+books%2C+speaking+at+retreats%2C+conferences%2C+and+more.+With+many+years+in+the+pastoral+ministry%2C+Patrick+and+his+wife+Jody+have+a+unique+perspective+that+allows+them+to+minister+the+Word+in+a+way+that+not+only+builds+up+the+local+church+but+also+encourages+and+empowers+the+local+pastor+as+well.++Many+who+have+experienced+his+dynamic+ministry+have+stated+that+his+ministry+is+like+a+refreshing+oasis+in+a+dry+and+thirsty+world.';
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();
};

