/* [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','3001',jdecode('HOME'),jdecode(''), jdecode('%2F3001.html'), 'true',[],'',''],
	['PAGE','26601',jdecode('ABOUT+US'),jdecode(''), jdecode('%2F26601%2Findex.html'), 'true',[ 
		['PAGE','4001',jdecode('Greetings'),jdecode(''), jdecode('%2F26601%2F4001.html'), 'true',[],'',''],
		['PAGE','16501',jdecode('Tenets+of+Faith'),jdecode(''), jdecode('%2F26601%2F16501.html'), 'true',[],'',''],
		['PAGE','4401',jdecode('Pastoral+Staff'),jdecode(''), jdecode('%2F26601%2F4401.html'), 'true',[],'',''],
		['PAGE','26622',jdecode('Office+Staff'),jdecode(''), jdecode('%2F26601%2F26622.html'), 'true',[],'',''],
		['PAGE','26643',jdecode('Directions'),jdecode(''), jdecode('%2F26601%2F26643.html'), 'true',[],'',''],
		['PAGE','3052',jdecode('Contact'),jdecode(''), jdecode('%2F26601%2F3052.html'), 'true',[],'','']
	],'',''],
	['PAGE','22701',jdecode('MINISTRIES'),jdecode(''), jdecode('%2F22701%2Findex.html'), 'true',[ 
		['PAGE','22722',jdecode('Men%26%23x27%3Bs'),jdecode(''), jdecode('%2F22701%2F22722.html'), 'true',[],'',''],
		['PAGE','22743',jdecode('Women%26%23x27%3Bs'),jdecode(''), jdecode('%2F22701%2F22743.html'), 'true',[],'',''],
		['PAGE','30201',jdecode('Ladies+Bible+Brunch'),jdecode(''), jdecode('%2F22701%2F30201.html'), 'true',[],'',''],
		['PAGE','22764',jdecode('Youth'),jdecode(''), jdecode('%2F22701%2F22764.html'), 'true',[],'',''],
		['PAGE','130712',jdecode('Special+Needs+Youth+Group'),jdecode(''), jdecode('%2F22701%2F130712.html'), 'true',[],'',''],
		['PAGE','22785',jdecode('Children%26%23x27%3Bs'),jdecode(''), jdecode('%2F22701%2F22785.html'), 'true',[],'',''],
		['PAGE','22806',jdecode('Music'),jdecode(''), jdecode('%2F22701%2F22806.html'), 'true',[],'',''],
		['PAGE','28901',jdecode('World+Missions'),jdecode(''), jdecode('%2F22701%2F28901.html'), 'true',[],'',''],
		['PAGE','29601',jdecode('Good+News+Club'),jdecode(''), jdecode('%2F22701%2F29601.html'), 'true',[],'',''],
		['PAGE','135512',jdecode('Love+Escalon'),jdecode(''), jdecode('%2F22701%2F135512.html'), 'true',[],'',''],
		['PAGE','29622',jdecode('Fellowship+Group'),jdecode(''), jdecode('%2F22701%2F29622.html'), 'true',[],'','']
	],'',''],
	['PAGE','3115',jdecode('CALENDAR+%26+EVENTS'),jdecode(''), jdecode('%2F3115.html'), 'true',[],'',''],
	['PAGE','16801',jdecode('WEEKLY+BULLETINS+%26+SERMONS'),jdecode(''), jdecode('%2F16801.html'), 'true',[],'',''],
	['PAGE','3094',jdecode('MONTHLY+NEWSLETTERS'),jdecode(''), jdecode('%2F3094.html'), 'true',[],'',''],
	['PAGE','26301',jdecode('HOW+TO+FOLLOW+CHRIST'),jdecode(''), jdecode('%2F26301.html'), 'true',[],'',''],
	['PAGE','33501',jdecode('PHOTO+ALBUM'),jdecode(''), jdecode('%2F33501.html'), 'true',[],'',''],
	['ITEM','86401',jdecode('ThrivingFamily.com'),jdecode(''), jdecode('http%3A%2F%2Fwww.thrivingfamily.com%2F'), 'true',[],'','_blank']];
var siteelementCount=26;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'291',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20110617-175538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3052',
internalId:  '',
customField: '20110615-141759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22743',
internalId:  '',
customField: '20110617-175646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3094',
internalId:  '',
customField: '20120131-153049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3115',
internalId:  '',
customField: '20120215-185011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20100301-163452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20110611-192347'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20090721-224701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20120221-153539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20110615-172011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22722',
internalId:  '',
customField: '20110611-183946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22764',
internalId:  '',
customField: '20110615-162852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22785',
internalId:  '',
customField: '20110611-185825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22806',
internalId:  '',
customField: '20110611-191734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130712',
internalId:  '',
customField: '20110615-165655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26301',
internalId:  '',
customField: '20100126-191747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26601',
internalId:  '',
customField: '20110611-192457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26622',
internalId:  '',
customField: '20090815-025425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26643',
internalId:  '',
customField: '20091104-114616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28901',
internalId:  '',
customField: '20110615-164241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29601',
internalId:  '',
customField: '20110611-172241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20110611-183747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29622',
internalId:  '',
customField: '20110611-172439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33501',
internalId:  '',
customField: '20110615-140942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135512',
internalId:  '',
customField: '20110615-140659'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHN4Y';
var companyName   = 'Trinity+Church+Assembly+of+God';
var htmlTitle	  = 'Trinity+Church+Assembly+of+God';
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();
};

