/* [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','4201',jdecode('Home'),jdecode(''),'/4201.html','true',[],''],
	['PAGE','10922',jdecode('Mission'),jdecode(''),'/10922.html','true',[],''],
	['PAGE','10985',jdecode('About+Us'),jdecode(''),'/10985.html','true',[],''],
	['PAGE','11006',jdecode('How+abou+You'),jdecode(''),'/11006.html','true',[],''],
	['PAGE','10901',jdecode('Layman%26%23x27%3Bs+Reflection'),jdecode(''),'/10901.html','true',[],''],
	['PAGE','10964',jdecode('Healing+Meditation'),jdecode(''),'/10964.html','true',[],''],
	['PAGE','4273',jdecode('Tithes+%26+Tithing'),jdecode(''),'/4273.html','true',[],''],
	['PAGE','4252',jdecode('Prosperity+or+Poverty'),jdecode(''),'/4252.html','true',[],''],
	['PAGE','10943',jdecode('On+the+TRINITY'),jdecode(''),'/10943.html','true',[],''],
	['PAGE','42901',jdecode('The+LORD+is+ONE'),jdecode(''),'/42901.html','true',[],''],
	['PAGE','38501',jdecode('On+The+NAME+of+God'),jdecode(''),'/38501.html','true',[],''],
	['PAGE','41601',jdecode('Keys+to+the+Kingdom+'),jdecode(''),'/41601.html','true',[],''],
	['PAGE','42101',jdecode('Apostolic+Succession'),jdecode(''),'/42101.html','true',[],''],
	['PAGE','41501',jdecode('Peter+in+Rome%3F'),jdecode(''),'/41501.html','true',[],''],
	['PAGE','48236',jdecode('MyNearDeathExperience'),jdecode(''),'/48236.html','true',[],''],
	['PAGE','43601',jdecode('Books+by+the+Author'),jdecode(''),'/43601.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Stars';
theSitetree.paletteFamily='3C5284';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10466';
theSitetree.graphicsetId='10913';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3C5284';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Stars',
				paletteFamily: 	'3C5284',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10466',
				graphicsetId: 	'10913',
				contentColor: 	'FFFFFF',
				contentBGColor: '3C5284',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'3C5284',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20091113-205703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4252',
internalId:  '',
customField: '20090214-201443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4273',
internalId:  '',
customField: '20090220-080232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20090214-200933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10922',
internalId:  '',
customField: '20090810-191026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10943',
internalId:  '',
customField: '20091011-071018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10964',
internalId:  '',
customField: '20090920-193455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10985',
internalId:  '',
customField: '20090214-203604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11006',
internalId:  '',
customField: '20090214-203715'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-13818208']={
webappId:    '1501',
documentId:  '4201',
internalId:  '13818208',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38501',
internalId:  '',
customField: '20091011-060233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41501',
internalId:  '',
customField: '20091011-063331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20091011-063219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42101',
internalId:  '',
customField: '20091011-061603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42901',
internalId:  '',
customField: '20091012-222215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43601',
internalId:  '',
customField: '20091009-202940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48236',
internalId:  '',
customField: '20091117-223227'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2N03';
var companyName   = 'Lay+Advocacy+for+Christian+Unity';
var htmlTitle	  = 'Christian+unity';
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();
};
