/* [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','52166',jdecode('SEASONS'),jdecode(''),'/52166.html','true',[],''],
	['PAGE','12701',jdecode('Home'),jdecode(''),'/12701.html','true',[],''],
	['PAGE','23127',jdecode('PRAYER'),jdecode(''),'/23127.html','true',[],''],
	['PAGE','23106',jdecode('MISSION'),jdecode(''),'/23106.html','true',[],''],
	['PAGE','15601',jdecode('links'),jdecode(''),'/15601.html','true',[],''],
	['PAGE','12901',jdecode('Contact'),jdecode(''),'/12901.html','true',[],''],
	['PAGE','12943',jdecode('RESOURCES'),jdecode(''),'/12943/index.html','true',[ 
		['PAGE','12964',jdecode('HISTORY'),jdecode(''),'/12943/12964.html','true',[],'']
	],''],
	['PAGE','30151',jdecode('MEMORIALS'),jdecode(''),'/30151.html','true',[],''],
	['PAGE','14201',jdecode('TIM+1965-2000'),jdecode(''),'/14201.html','true',[],''],
	['PAGE','52145',jdecode('FAMILY+NEWS'),jdecode(''),'/52145.html','true',[],''],
	['PAGE','30230',jdecode('EDUCATION'),jdecode(''),'/30230.html','true',[],''],
	['PAGE','30251',jdecode('FAMILY+EVENTS'),jdecode(''),'/30251.html','true',[],''],
	['PAGE','12922',jdecode('JOIN'),jdecode(''),'/12922.html','true',[],''],
	['PAGE','30130',jdecode('History'),jdecode(''),'/30130.html','true',[],''],
	['PAGE','52645',jdecode('FAMILY+LINEAGE'),jdecode(''),'/52645.html','true',[],''],
	['PAGE','61864',jdecode('CAUSES'),jdecode(''),'/61864.html','true',[],''],
	['PAGE','83675',jdecode('FRIENDS'),jdecode(''),'/83675.html','true',[],''],
	['PAGE','89497',jdecode('TJWS+LINKS'),jdecode(''),'/89497.html','true',[],''],
	['PAGE','90497',jdecode('PENAL+SYSTEM'),jdecode(''),'/90497.html','true',[],''],
	['PAGE','105397',jdecode('PRAYER+LINKS'),jdecode(''),'/105397.html','true',[],''],
	['PAGE','133111',jdecode('NEWS'),jdecode(''),'/133111.html','true',[],''],
	['PAGE','140211',jdecode('Concept'),jdecode(''),'/140211.html','true',[],'']];
var siteelementCount=23;
theSitetree.topTemplateName='Clipping';
theSitetree.paletteFamily='5D2767';
theSitetree.keyvisualId='4524';
theSitetree.keyvisualName='kv_4524.jpg';
theSitetree.fontsetId='10822';
theSitetree.graphicsetId='11273';
theSitetree.contentColor='E5C8EB';
theSitetree.contentBGColor='5D2767';
var theTemplate={
				name: 			'Clipping',
				paletteFamily: 	'5D2767',
				keyvisualId: 	'4524',
				keyvisualName: 	'kv_4524.jpg',
				fontsetId: 		'10822',
				graphicsetId: 	'11273',
				contentColor: 	'E5C8EB',
				contentBGColor: '5D2767',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20091213-061920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20091120-123229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12922',
internalId:  '',
customField: '20091213-044241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12943',
internalId:  '',
customField: '20091213-045141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12964',
internalId:  '',
customField: '20091112-200446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30151',
internalId:  '',
customField: '20091213-045018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23127',
internalId:  '',
customField: '20091115-161137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23106',
internalId:  '',
customField: '20091213-060552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20091213-061050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133111',
internalId:  '',
customField: '20091213-043049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30251',
internalId:  '',
customField: '20091213-044343'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '52166',
internalId:  '1501',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '52166',
internalId:  '1006',
customField: '1006'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '12701',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-14201ahw050inll0s']={
webappId:    '1002',
documentId:  '14201',
internalId:  '14201ahw050inll0s',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30230',
internalId:  '',
customField: '20091117-204145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20091118-195603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30130',
internalId:  '',
customField: '20091117-203443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52145',
internalId:  '',
customField: '20091207-224704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52645',
internalId:  '',
customField: '20091213-043930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52166',
internalId:  '',
customField: '20091213-053502'
};
webappMappings['1501']=webappMappings['1501-6164497']={
webappId:    '1501',
documentId:  '52166',
internalId:  '6164497',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61864',
internalId:  '',
customField: '20091213-043711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83675',
internalId:  '',
customField: '20091213-043519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89497',
internalId:  '',
customField: '20091213-043344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90497',
internalId:  '',
customField: '20091213-040051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105397',
internalId:  '',
customField: '20091120-120522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '140211',
internalId:  '',
customField: '20091213-042800'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INLL0S';
var companyName   = 'TJWSFOUNDATION.+INC';
var htmlTitle	  = 'http%3A%2F%2Fwww.tjwsfoundation.com';
var metaKeywords  = 'WWW.TJWSFOUNDATION.COM';
var metaContents  = 'www.tjwsfoundation.com';
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();
};
