/* [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','5901',jdecode('Home'),jdecode(''),'/5901.html','true',[],'',''],
	['PAGE','49501',jdecode('About+us'),jdecode(''),'/49501.html','true',[],'',''],
	['PAGE','100134',jdecode('Adult+Education'),jdecode(''),'/100134.html','true',[],'',''],
	['PAGE','7401',jdecode('Bulletin'),jdecode(''),'/7401.html','true',[],'',''],
	['PAGE','43201',jdecode('Cancellations'),jdecode(''),'/43201.html','true',[],'',''],
	['PAGE','5994',jdecode('Church+Contacts'),jdecode(''),'/5994.html','true',[],'',''],
	['PAGE','102234',jdecode('CYO+Basketball'),jdecode(''),'/102234.html','true',[],'',''],
	['PAGE','20201',jdecode('Directions'),jdecode(''),'/20201.html','true',[],'',''],
	['PAGE','7701',jdecode('Links'),jdecode(''),'/7701.html','true',[],'',''],
	['PAGE','7743',jdecode('Masses'),jdecode(''),'/7743.html','true',[],'',''],
	['PAGE','49401',jdecode('Master+Calendar'),jdecode(''),'/49401.html','true',[],'',''],
	['PAGE','7764',jdecode('Music++Ministry'),jdecode(''),'/7764.html','true',[],'',''],
	['PAGE','7827',jdecode('Parish+'),jdecode(''),'/7827/index.html','true',[ 
		['PAGE','7785',jdecode('Parish+History'),jdecode(''),'/7827/7785.html','true',[],'',''],
		['PAGE','7806',jdecode('Parish+Information'),jdecode(''),'/7827/7806.html','true',[],'','']
	],'',''],
	['PAGE','20264',jdecode('Photos'),jdecode(''),'/20264/index.html','true',[ 
		['PAGE','97834',jdecode('Opening+Day+of+School'),jdecode(''),'/20264/97834.html','true',[],'','']
	],'',''],
	['PAGE','7911',jdecode('Religious+Education'),jdecode(''),'/7911/index.html','true',[ 
		['PAGE','92634',jdecode('Announcements'),jdecode(''),'/7911/92634.html','true',[],'',''],
		['PAGE','47422',jdecode('Christian+Initiation'),jdecode(''),'/7911/47422.html','true',[],'',''],
		['PAGE','47601',jdecode('Confirmation+Preparation+'),jdecode(''),'/7911/47601.html','true',[],'','']
	],'',''],
	['PAGE','53501',jdecode('St.+Francis+Xavier+School'),jdecode(''),'/53501.html','true',[],'',''],
	['PAGE','7953',jdecode('Youth+Ministry'),jdecode(''),'/7953/index.html','true',[ 
		['PAGE','46901',jdecode('Clow'),jdecode(''),'/7953/46901.html','true',[],'',''],
		['PAGE','46922',jdecode('Peer+Ministry'),jdecode(''),'/7953/46922.html','true',[],'',''],
		['PAGE','7932',jdecode('Youth+Group'),jdecode(''),'/7953/7932.html','true',[],'','']
	],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Objects';
theSitetree.paletteFamily='154C68';
theSitetree.keyvisualId='6541';
theSitetree.keyvisualName='kv_6541.jpg';
theSitetree.fontsetId='11188';
theSitetree.graphicsetId='11992';
theSitetree.contentColor='053750';
theSitetree.contentBGColor='FFE2A7';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Objects',
				paletteFamily: 	'154C68',
				keyvisualId: 	'6541',
				keyvisualName: 	'kv_6541.jpg',
				fontsetId: 		'11188',
				graphicsetId: 	'11992',
				contentColor: 	'053750',
				contentBGColor: 'FFE2A7',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20100608-115232'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '20201',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49501',
internalId:  '',
customField: '20100608-115701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46901',
internalId:  '',
customField: '20090130-081235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43201',
internalId:  '',
customField: '20090128-125313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20100825-182631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5994',
internalId:  '',
customField: '20100818-101825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47601',
internalId:  '',
customField: '20090316-131514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20201',
internalId:  '',
customField: '20090128-085947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47422',
internalId:  '',
customField: '20090130-083457'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20100322-144635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49401',
internalId:  '',
customField: '20090130-090543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7743',
internalId:  '',
customField: '20100512-075953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7764',
internalId:  '',
customField: '20090130-093405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46922',
internalId:  '',
customField: '20090130-081340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7785',
internalId:  '',
customField: '20090306-075016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7806',
internalId:  '',
customField: '20090128-123331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7827',
internalId:  '',
customField: '20090304-072144'
};
webappMappings['7008']=webappMappings['7008-1596']={
webappId:    '7008',
documentId:  '7806',
internalId:  '1596',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20264',
internalId:  '',
customField: '20100509-140058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7911',
internalId:  '',
customField: '20090130-084703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7932',
internalId:  '',
customField: '20100224-080723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7953',
internalId:  '',
customField: '20100818-105712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53501',
internalId:  '',
customField: '20090918-171157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100134',
internalId:  '',
customField: '20100818-101257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102234',
internalId:  '',
customField: '20100121-073644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97834',
internalId:  '',
customField: '20090901-131236'
};
webappMappings['7060']=webappMappings['7060-2488751627e249e9ee042c11c238fba6']={
webappId:    '7060',
documentId:  '97834',
internalId:  '2488751627e249e9ee042c11c238fba6',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92634',
internalId:  '',
customField: '20100430-190458'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INVX9T';
var companyName   = 'St.+Francis+Xavier+Parish';
var htmlTitle	  = 'Saint+Francis+Xavier+Parish';
var metaKeywords  = 'churchCatholicReligionSaint+Francis';
var metaContents  = 'We+are+a+Catholic+Church+serving+the+community.';
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();
};
