/* [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','62',jdecode('HOME'),jdecode(''),'/62.html','true',[],'',''],
	['PAGE','110',jdecode('THE+LEADERSHIP'),jdecode(''),'/110.html','true',[],'',''],
	['PAGE','83',jdecode('INFINITE+MOTION+IS...'),jdecode(''),'/83.html','true',[],'',''],
	['PAGE','101',jdecode('CHURCH+AFFIRMATION+'),jdecode(''),'/101.html','true',[],'',''],
	['PAGE','26701',jdecode('THE+MESSIANIC+CALL'),jdecode(''),'/26701.html','true',[],'',''],
	['PAGE','71001',jdecode('CHURCH+LOCATION'),jdecode(''),'/71001.html','true',[],'',''],
	['PAGE','26722',jdecode('BIBLE+SCHOOL'),jdecode(''),'/26722.html','true',[],'',''],
	['PAGE','92',jdecode('CALENDAR+of+EVENTS'),jdecode(''),'/92.html','true',[],'',''],
	['PAGE','6168',jdecode('CHURCH+without+WALLS'),jdecode(''),'/6168.html','true',[],'',''],
	['PAGE','3995',jdecode('SUNDAY+PRAYER'),jdecode(''),'/3995.html','true',[],'',''],
	['PAGE','137',jdecode('MINISTRIES+UNDER+IMIC'),jdecode(''),'/137.html','true',[],'',''],
	['PAGE','4072',jdecode('SWORD%26+SICKLER+MIN.+'),jdecode(''),'/4072.html','true',[],'',''],
	['PAGE','39201',jdecode('ANDREW+MINISTRY'),jdecode(''),'/39201.html','true',[],'',''],
	['PAGE','26764',jdecode('THE+POWER+OF+WORSHIP'),jdecode(''),'/26764.html','true',[],'',''],
	['PAGE','26785',jdecode('SPIRITUAL+GIFTS+%26+the+5'),jdecode(''),'/26785.html','true',[],'',''],
	['PAGE','26806',jdecode('40+DAYS+of+PRAYER+'),jdecode(''),'/26806.html','true',[],'',''],
	['PAGE','26869',jdecode('THE+DANIEL+FAST+'),jdecode(''),'/26869.html','true',[],'',''],
	['PAGE','26848',jdecode('OTHER+%22FASTS%22'),jdecode(''),'/26848.html','true',[],'',''],
	['PAGE','128',jdecode('A+LIFE+WITH+THE+KING'),jdecode(''),'/128.html','true',[],'',''],
	['PAGE','1456',jdecode('GUESTBOOK...pls+sign'),jdecode(''),'/1456/index.html','true',[ 
		['PAGE','1455',jdecode('Read+Guestbook'),jdecode(''),'/1456/1455.html','false',[],'','']
	],'',''],
	['PAGE','26911',jdecode('PROPHETIC+WORD+2010'),jdecode(''),'/26911.html','true',[],'',''],
	['PAGE','85401',jdecode('MENTORING+PROGRAM'),jdecode(''),'/85401.html','true',[],'',''],
	['PAGE','26932',jdecode('WEB+LINKS+%26+PRODUCTS'),jdecode(''),'/26932.html','true',[],'',''],
	['PAGE','39222',jdecode('CONTACT+US'),jdecode(''),'/39222.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Welcome';
theSitetree.paletteFamily='482ED0';
theSitetree.keyvisualId='9178';
theSitetree.keyvisualName='kv_9178.jpg';
theSitetree.fontsetId='10364';
theSitetree.graphicsetId='10525';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='482ED0';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Welcome',
				paletteFamily: 	'482ED0',
				keyvisualId: 	'9178',
				keyvisualName: 	'kv_9178.jpg',
				fontsetId: 		'10364',
				graphicsetId: 	'10525',
				contentColor: 	'FFFFFF',
				contentBGColor: '482ED0',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'938BBD',
				e_color: 		'B4AED6',
				f_color: 		'60E37E',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '62',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2039695']={
webappId:    '1501',
documentId:  '62',
internalId:  '2039695',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-1456AHW050IN36QA']={
webappId:    '1002',
documentId:  '1456',
internalId:  '1456AHW050IN36QA',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26785',
internalId:  '',
customField: '20090905-133032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26806',
internalId:  '',
customField: '20090905-133855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26764',
internalId:  '',
customField: '20090905-132858'
};
webappMappings['7060']=webappMappings['7060-00c1be9ac0cc621d6fa346077f3c62d7']={
webappId:    '7060',
documentId:  '3995',
internalId:  '00c1be9ac0cc621d6fa346077f3c62d7',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20100808-091353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83',
internalId:  '',
customField: '20091205-165517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92',
internalId:  '',
customField: '20100808-094916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101',
internalId:  '',
customField: '20081128-013623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110',
internalId:  '',
customField: '20100808-093152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6168',
internalId:  '',
customField: '20091205-170551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3995',
internalId:  '',
customField: '20091205-170734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128',
internalId:  '',
customField: '20090110-134158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '137',
internalId:  '',
customField: '20091205-171613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26848',
internalId:  '',
customField: '20081130-142115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1456',
internalId:  '',
customField: '20070311-034439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1455',
internalId:  '',
customField: '20070311-034439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4072',
internalId:  '',
customField: '20091205-171756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26869',
internalId:  '',
customField: '20090905-134546'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '62',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26701',
internalId:  '',
customField: '20091205-165635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26722',
internalId:  '',
customField: '20091205-165843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26911',
internalId:  '',
customField: '20091205-200046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26932',
internalId:  '',
customField: '20091205-203944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39201',
internalId:  '',
customField: '20091205-171951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39222',
internalId:  '',
customField: '20090117-173344'
};
webappMappings['7008']=webappMappings['7008-584']={
webappId:    '7008',
documentId:  '39222',
internalId:  '584',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85401',
internalId:  '',
customField: '20091205-201834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71001',
internalId:  '',
customField: '20100213-185730'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN36QA';
var companyName   = 'Infinite+Motion+in+Christ+Ministries%2C+Inc.++';
var htmlTitle	  = 'Church+of+Infinite+Motion+in+Christ+Ministries%2FWhere+lives+are+changed';
var metaKeywords  = 'PROPHETIC%0D%0ABIBLE+STUDY%0D%0APRAYER%0D%0AONLINE+BIBLE';
var metaContents  = 'END+TIME+MINISTRY%0D%0APROPHETIC%0D%0ABIBLE+STUDY%0D%0AONLINE+BIBLE';
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();
};
