/* [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 theSitetree=[ 
	['PAGE','192',jdecode('Home'),jdecode(''),'/192.html','true',[],''],
	['PAGE','285',jdecode('What+We+Believe'),jdecode(''),'/285.html','true',[],''],
	['PAGE','15305',jdecode('__The+Truth+About+Christ'),jdecode(''),'/15305.html','true',[],''],
	['PAGE','18194',jdecode('__The+Truth+About+God'),jdecode(''),'/18194.html','true',[],''],
	['PAGE','18236',jdecode('__What+Salvation+Requires'),jdecode(''),'/18236.html','true',[],''],
	['PAGE','18215',jdecode('__Life%2C+Death+%26+Salvation'),jdecode(''),'/18215.html','true',[],''],
	['PAGE','18257',jdecode('__The+Prologue+of+John'),jdecode(''),'/18257.html','true',[],''],
	['PAGE','18678',jdecode('__Basis+of+Scripture'),jdecode(''),'/18678.html','true',[],''],
	['PAGE','327',jdecode('References+%2F+Books'),jdecode(''),'/327.html','true',[],''],
	['PAGE','51094',jdecode('About+Us'),jdecode(''),'/51094.html','true',[],''],
	['PAGE','18594',jdecode('__In+Love%2C+Truth+%26+Spirit'),jdecode(''),'/18594.html','true',[],''],
	['PAGE','18615',jdecode('__Ministries+of+the+Church'),jdecode(''),'/18615/index.html','true',[ 
		['PAGE','40894',jdecode('To+One+God+and+Father'),jdecode(''),'/18615/40894.html','true',[],''],
		['PAGE','40915',jdecode('To+One+Lord+Jesus+'),jdecode(''),'/18615/40915.html','true',[],''],
		['PAGE','40936',jdecode('To+The+Church+Body'),jdecode(''),'/18615/40936.html','true',[],''],
		['PAGE','40957',jdecode('To+Other+Christians'),jdecode(''),'/18615/40957.html','true',[],''],
		['PAGE','40978',jdecode('To+Patrons+of+Abraham'),jdecode(''),'/18615/40978.html','true',[],''],
		['PAGE','40999',jdecode('To+All+The+World'),jdecode(''),'/18615/40999.html','true',[],'']
	],''],
	['PAGE','52794',jdecode('Bethany+Children%26%23x27%3Bs+Home'),jdecode(''),'/52794.html','true',[],''],
	['PAGE','369',jdecode('Contact+Us'),jdecode(''),'/369.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Aroundtheworld';
theSitetree.paletteFamily='7FACDC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10790';
theSitetree.graphicsetId='11215';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='7FACDC';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Aroundtheworld',
				paletteFamily: 	'7FACDC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10790',
				graphicsetId: 	'11215',
				contentColor: 	'000000',
				contentBGColor: '7FACDC',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '192',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192',
internalId:  '',
customField: '20090307-135846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15305',
internalId:  '',
customField: '20090413-004022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '285',
internalId:  '',
customField: '20090308-003822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18194',
internalId:  '',
customField: '20080803-160508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18236',
internalId:  '',
customField: '20080803-160553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18215',
internalId:  '',
customField: '20090413-004640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18257',
internalId:  '',
customField: '20060203-231450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18678',
internalId:  '',
customField: '20080803-160627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '327',
internalId:  '',
customField: '20090308-004444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51094',
internalId:  '',
customField: '20090308-004726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18594',
internalId:  '',
customField: '20080803-160051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18615',
internalId:  '',
customField: '20090308-004859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40894',
internalId:  '',
customField: '20080803-160136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40915',
internalId:  '',
customField: '20090308-005539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40936',
internalId:  '',
customField: '20080803-160236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40957',
internalId:  '',
customField: '20080803-160323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40978',
internalId:  '',
customField: '20090308-005551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40999',
internalId:  '',
customField: '20080803-160418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52794',
internalId:  '',
customField: '20090308-005828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '369',
internalId:  '',
customField: '20090305-222749'
};
var canonHostname = 'cm4all.aplus.net';
var accountId     = 'AAPLU0INXENG';
var companyName   = 'The+Christian+Church+of+God+';
var htmlTitle	  = 'WFTR+Christian+Church+of+God';
var metaKeywords  = 'Water+From+The+Rock+Christian+Church+of+God%2C+biblical+unitarian%2C++Josiah+Verkaik%2C+christian+reform%2C+reformation%2C+revival+CCOG.net%2C+doctrine%2C+bible+based%2C+Is+Jesus+God%2C+mortality%2C+Spirit+filled%2C+Acts+2%3A38%2C+pentacostal%2C+%2C+baptism+in+Jesus+name%2C+conditionalist%2C+apostles+creed%2C+Corruption+of+scripture%2C+resurrection+of+the+dead%2C+free+will%2C+The+truth+about+Christ%2C+the+truth+about+God%2C+The+truth+about+life+and+death%2C+what+salvation+requires+of+us%2C+Goleta%2C+Santa+Barbara';
var metaContents  = 'In+the+spirit+of+revival+and+reformation+-+free+from+the+traditions+of+men+-++we+are+Water+From+The+Rock+Christian+Church+of+God.+We+proclam+the+coming+Kingdom+of+the+Messiah+and+eternal+life+through+Jesus%2C+the+Anointed%2C+Biblical+Unitarian%2C+pentacostal%2C+spirit+filled.+';
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();
};
