/* [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','4558',jdecode('Willkommen...'),jdecode(''), jdecode('%2F4558.html'), 'true',[],'',''],
	['PAGE','5974',jdecode('Portrait'),jdecode(''), jdecode('%2F5974%2Findex.html'), 'true',[ 
		['PAGE','8201',jdecode('Geschichte'),jdecode(''), jdecode('%2F5974%2F8201.html'), 'true',[],'',''],
		['PAGE','8228',jdecode('Kirchenpatron'),jdecode(''), jdecode('%2F5974%2F8228.html'), 'true',[],'','']
	],'',''],
	['PAGE','6001',jdecode('Pfarramt'),jdecode(''), jdecode('%2F6001%2Findex.html'), 'true',[ 
		['PAGE','6601',jdecode('Gemeindeleitung'),jdecode(''), jdecode('%2F6001%2F6601.html'), 'true',[],'',''],
		['PAGE','6628',jdecode('Sekretariat'),jdecode(''), jdecode('%2F6001%2F6628.html'), 'true',[],'',''],
		['PAGE','8282',jdecode('Sakristaninnen'),jdecode(''), jdecode('%2F6001%2F8282.html'), 'true',[],'',''],
		['PAGE','51701',jdecode('Abwart'),jdecode(''), jdecode('%2F6001%2F51701.html'), 'true',[],'','']
	],'',''],
	['PAGE','6028',jdecode('R%C3%A4te'),jdecode(''), jdecode('%2F6028%2Findex.html'), 'true',[ 
		['PAGE','15401',jdecode('Kirchgemeinderat'),jdecode(''), jdecode('%2F6028%2F15401.html'), 'true',[],'',''],
		['PAGE','7101',jdecode('Pfarreirat'),jdecode(''), jdecode('%2F6028%2F7101.html'), 'true',[],'','']
	],'',''],
	['PAGE','6655',jdecode('Seelsorgliche+Dienste'),jdecode(''), jdecode('%2F6655%2Findex.html'), 'true',[ 
		['PAGE','7155',jdecode('Taufe'),jdecode(''), jdecode('%2F6655%2F7155.html'), 'true',[],'',''],
		['PAGE','7182',jdecode('Kommunion'),jdecode(''), jdecode('%2F6655%2F7182.html'), 'true',[],'',''],
		['PAGE','7209',jdecode('Firmung'),jdecode(''), jdecode('%2F6655%2F7209.html'), 'true',[],'',''],
		['PAGE','7236',jdecode('Trauung'),jdecode(''), jdecode('%2F6655%2F7236.html'), 'true',[],'',''],
		['PAGE','8309',jdecode('Krankensalbung'),jdecode(''), jdecode('%2F6655%2F8309.html'), 'true',[],'',''],
		['PAGE','8336',jdecode('Vers%C3%B6hn.+%28Busse%2FBeichte%29'),jdecode(''), jdecode('%2F6655%2F8336.html'), 'true',[],'',''],
		['PAGE','8363',jdecode('Krankenkommunion'),jdecode(''), jdecode('%2F6655%2F8363.html'), 'true',[],'',''],
		['PAGE','8390',jdecode('Hausbesuche'),jdecode(''), jdecode('%2F6655%2F8390.html'), 'true',[],'',''],
		['PAGE','8417',jdecode('Spitalbesuche'),jdecode(''), jdecode('%2F6655%2F8417.html'), 'true',[],'',''],
		['PAGE','7263',jdecode('Todesfall%2FGed%C3%A4chtnisf.'),jdecode(''), jdecode('%2F6655%2F7263.html'), 'true',[],'','']
	],'',''],
	['PAGE','6682',jdecode('Vereine+%2F+Gruppen'),jdecode(''), jdecode('%2F6682%2Findex.html'), 'true',[ 
		['PAGE','7518',jdecode('Kirchenchor'),jdecode(''), jdecode('%2F6682%2F7518.html'), 'true',[],'',''],
		['PAGE','8711',jdecode('Liturgiegruppe'),jdecode(''), jdecode('%2F6682%2F8711.html'), 'true',[],'',''],
		['PAGE','8738',jdecode('Ministrantenschar'),jdecode(''), jdecode('%2F6682%2F8738.html'), 'true',[],'',''],
		['PAGE','8765',jdecode('Gruppe+%22Fire+m.+Chind%22'),jdecode(''), jdecode('%2F6682%2F8765.html'), 'true',[],'',''],
		['PAGE','8819',jdecode('Oek.Gespr%C3%A4chsgruppe'),jdecode(''), jdecode('%2F6682%2F8819.html'), 'true',[],'',''],
		['PAGE','8846',jdecode('Kapellenver.+St.+Antonius'),jdecode(''), jdecode('%2F6682%2F8846.html'), 'true',[],'',''],
		['PAGE','8873',jdecode('Frauen-+u.+M%C3%BCttergem.'),jdecode(''), jdecode('%2F6682%2F8873.html'), 'true',[],'',''],
		['PAGE','8900',jdecode('Jungmannschaft'),jdecode(''), jdecode('%2F6682%2F8900.html'), 'true',[],'','']
	],'',''],
	['PAGE','6709',jdecode('Gottesdienste+%2F+Anl%C3%A4sse'),jdecode(''), jdecode('%2F6709%2Findex.html'), 'true',[ 
		['PAGE','7545',jdecode('Pfarrblatt'),jdecode(''), jdecode('%2F6709%2F7545.html'), 'true',[],'',''],
		['PAGE','7572',jdecode('Weitere+Termine'),jdecode(''), jdecode('%2F6709%2F7572.html'), 'true',[],'','']
	],'',''],
	['PAGE','6736',jdecode('Religionsunterricht'),jdecode(''), jdecode('%2F6736.html'), 'true',[],'',''],
	['PAGE','6763',jdecode('Sigristenhaus'),jdecode(''), jdecode('%2F6763.html'), 'true',[],'',''],
	['PAGE','18302',jdecode('Anfahrt'),jdecode(''), jdecode('%2F18302.html'), 'true',[],'',''],
	['PAGE','6790',jdecode('Links'),jdecode(''), jdecode('%2F6790.html'), 'true',[],'',''],
	['PAGE','62701',jdecode('Freie+Stelle%28n%29'),jdecode(''), jdecode('%2F62701.html'), 'true',[],'',''],
	['PAGE','26001',jdecode('Website+%2F+Webmaster'),jdecode(''), jdecode('%2F26001.html'), 'true',[],'','']];
var siteelementCount=41;
theSitetree.topTemplateName='Dispose';
theSitetree.paletteFamily='718DF8';
theSitetree.keyvisualId='9688';
theSitetree.keyvisualName='kv_9688.gif';
theSitetree.fontsetId='10659';
theSitetree.graphicsetId='11186';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCCACA';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Dispose',
				paletteFamily: 	'718DF8',
				keyvisualId: 	'9688',
				keyvisualName: 	'kv_9688.gif',
				fontsetId: 		'10659',
				graphicsetId: 	'11186',
				contentColor: 	'000000',
				contentBGColor: 'CCCACA',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '18302',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4558',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4558',
internalId:  '',
customField: '20120111-140749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6709',
internalId:  '',
customField: '20111111-175549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7545',
internalId:  '',
customField: '20111111-175557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7572',
internalId:  '',
customField: '20120112-104816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26001',
internalId:  '',
customField: '20120111-141421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5974',
internalId:  '',
customField: '20111111-174818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20111111-174839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8228',
internalId:  '',
customField: '20111111-174904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20111111-174913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20120125-093010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6628',
internalId:  '',
customField: '20111111-174927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8282',
internalId:  '',
customField: '20120216-123219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51701',
internalId:  '',
customField: '20111111-175117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6028',
internalId:  '',
customField: '20111111-175125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20120216-122951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20111111-175152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6655',
internalId:  '',
customField: '20111111-175202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7155',
internalId:  '',
customField: '20111111-175214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7182',
internalId:  '',
customField: '20111111-175227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7209',
internalId:  '',
customField: '20111111-175240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7236',
internalId:  '',
customField: '20111111-175252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8309',
internalId:  '',
customField: '20111111-175305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8336',
internalId:  '',
customField: '20111111-175317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8363',
internalId:  '',
customField: '20111111-175326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8390',
internalId:  '',
customField: '20120110-203556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8417',
internalId:  '',
customField: '20111111-175343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7263',
internalId:  '',
customField: '20111111-175352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6682',
internalId:  '',
customField: '20111111-175409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7518',
internalId:  '',
customField: '20120110-203728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8711',
internalId:  '',
customField: '20120125-092940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8738',
internalId:  '',
customField: '20111111-175445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8765',
internalId:  '',
customField: '20100407-071716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8819',
internalId:  '',
customField: '20111111-175459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8846',
internalId:  '',
customField: '20111111-175511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8873',
internalId:  '',
customField: '20111111-175523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8900',
internalId:  '',
customField: '20111111-175540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6736',
internalId:  '',
customField: '20111111-175636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6763',
internalId:  '',
customField: '20111111-175654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18302',
internalId:  '',
customField: '20111111-175706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6790',
internalId:  '',
customField: '20111111-175718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62701',
internalId:  '',
customField: '20120110-204023'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'Ahp010INEQ0Q';
var companyName   = 'Kath.+Kirchgemeinde+Lostorf+%2F+Pfarrei+St.+Martin';
var htmlTitle	  = 'Kath.+Kirchgemeinde+Lostorf+%2F+Pfarrei+St.+Martin';
var metaKeywords  = 'R%C3%B6m.-kath.+Kirchegemeinde+Lostorf++R%C3%B6m.-kath.+Kirche+Lostorf++Kath.+Kirche+Lostorf++Kirche+Lostorf+Pfarrei+St.+Martin+Lostorf+Pfarrei+St.+Martin+St.+Martin+Lostorf+St.+Martin+Lostorf';
var metaContents  = 'kath.+Kirchgemeinde+Lostorf+%2F+Pfarrei+St.+Martin';
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();
};

