/* [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','1701',jdecode('Home'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','18901',jdecode('Statement+of+Faith'),jdecode(''), jdecode('%2F18901.html'), 'true',[],'',''],
	['PAGE','2701',jdecode('Eufaula+Location'),jdecode(''), jdecode('%2F2701.html'), 'true',[],'',''],
	['PAGE','2722',jdecode('Cuthbert+Location'),jdecode(''), jdecode('%2F2722.html'), 'true',[],'',''],
	['PAGE','18922',jdecode('LIFE+Growth+Groups'),jdecode(''), jdecode('%2F18922.html'), 'true',[],'',''],
	['PAGE','18943',jdecode('Missions'),jdecode(''), jdecode('%2F18943.html'), 'true',[],'',''],
	['PAGE','18964',jdecode('Pastors+%26+Staff'),jdecode(''), jdecode('%2F18964.html'), 'true',[],'',''],
	['PAGE','2743',jdecode('Children%26%23x27%3Bs+Ministry'),jdecode(''), jdecode('%2F2743.html'), 'true',[],'',''],
	['PAGE','27901',jdecode('Youth+Ministry'),jdecode(''), jdecode('%2F27901.html'), 'true',[],'',''],
	['PAGE','2806',jdecode('Coming+Events'),jdecode(''), jdecode('%2F2806.html'), 'false',[],'',''],
	['PAGE','2827',jdecode('Sermons'),jdecode(''), jdecode('%2F2827.html'), 'false',[],'',''],
	['PAGE','19006',jdecode('Bookstore'),jdecode(''), jdecode('%2F19006.html'), 'false',[],'',''],
	['PAGE','19027',jdecode('Contact+Us'),jdecode(''), jdecode('%2F19027.html'), 'true',[],'',''],
	['PAGE','30401',jdecode('Guestbook'),jdecode(''), jdecode('%2F30401.html'), 'true',[],'',''],
	['PAGE','19048',jdecode('Links'),jdecode(''), jdecode('%2F19048.html'), 'false',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='9240';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17360';
theSitetree.graphicsetId='12763';
theSitetree.contentColor='660000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'660000',
				keyvisualId: 	'9240',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17360',
				graphicsetId: 	'12763',
				contentColor: 	'660000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20120117-133945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20120112-152802'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-18777150']={
webappId:    '1501',
documentId:  '1701',
internalId:  '18777150',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20120116-174246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2722',
internalId:  '',
customField: '20120116-131238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18922',
internalId:  '',
customField: '20120116-110206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18943',
internalId:  '',
customField: '20120116-174919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18964',
internalId:  '',
customField: '20120116-131859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2743',
internalId:  '',
customField: '20120116-132357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2806',
internalId:  '',
customField: '20120117-133749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2827',
internalId:  '',
customField: '20120109-131549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30401',
internalId:  '',
customField: '20120117-133703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19006',
internalId:  '',
customField: '20120110-102822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19027',
internalId:  '',
customField: '20120117-134421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19048',
internalId:  '',
customField: '20120110-102822'
};
webappMappings['7060']=webappMappings['7060-59c18fbf811d43533cbd336c4c74b15b']={
webappId:    '7060',
documentId:  '27901',
internalId:  '59c18fbf811d43533cbd336c4c74b15b',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27901',
internalId:  '',
customField: '20120117-125925'
};
webappMappings['7060']=webappMappings['7060-b76d358e3cd297a4c729e8d188151fb3']={
webappId:    '7060',
documentId:  '2743',
internalId:  'b76d358e3cd297a4c729e8d188151fb3',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-28785']={
webappId:    '7008',
documentId:  '19027',
internalId:  '28785',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-30401avf340i797ac']={
webappId:    '1002',
documentId:  '30401',
internalId:  '30401avf340i797ac',
customField: 'icq=false'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I797AC';
var companyName   = 'Christian+Life+Church';
var htmlTitle	  = '';
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();
};

