/* [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','2401',jdecode('Home+%2F+Aktuell'),jdecode(''),'/2401/index.html','true',[ 
		['PAGE','21601',jdecode('Charta+Oecumenica'),jdecode(''),'/2401/21601.html','true',[],'',''],
		['PAGE','21622',jdecode('Synode'),jdecode(''),'/2401/21622.html','true',[],'',''],
		['PAGE','21643',jdecode('Delegiertenversam.'),jdecode(''),'/2401/21643.html','true',[],'',''],
		['PAGE','21664',jdecode('HESO'),jdecode(''),'/2401/21664.html','true',[],'',''],
		['PAGE','21685',jdecode('Kirchentag'),jdecode(''),'/2401/21685.html','true',[],'',''],
		['PAGE','21801',jdecode('Plakataktion'),jdecode(''),'/2401/21801.html','true',[],'','']
	],'',''],
	['PAGE','2452',jdecode('Unser+Bezirk'),jdecode(''),'/2452/index.html','true',[ 
		['PAGE','2473',jdecode('Vorstand'),jdecode(''),'/2452/2473.html','true',[],'',''],
		['PAGE','2494',jdecode('Delegierte'),jdecode(''),'/2452/2494.html','true',[],'',''],
		['PAGE','2515',jdecode('Synode+%2F+Synodale'),jdecode(''),'/2452/2515.html','true',[],'',''],
		['PAGE','2536',jdecode('Kirchgemeinden'),jdecode(''),'/2452/2536.html','true',[],'',''],
		['PAGE','2557',jdecode('Geschichte'),jdecode(''),'/2452/2557.html','true',[],'','']
	],'',''],
	['PAGE','2578',jdecode('Agenda+%2F+Kurse'),jdecode(''),'/2578/index.html','true',[ 
		['PAGE','2599',jdecode('Termine+Vorstand'),jdecode(''),'/2578/2599.html','true',[],'',''],
		['PAGE','9001',jdecode('Termine+DV'),jdecode(''),'/2578/9001.html','true',[],'',''],
		['PAGE','2620',jdecode('Veranstaltungen'),jdecode(''),'/2578/2620.html','true',[],'',''],
		['PAGE','2641',jdecode('Kurse'),jdecode(''),'/2578/2641.html','true',[],'','']
	],'',''],
	['PAGE','9022',jdecode('Religionsp%C3%A4dagogik'),jdecode(''),'/9022/index.html','true',[ 
		['PAGE','23601',jdecode('Ausbildung'),jdecode(''),'/9022/23601.html','true',[],'',''],
		['PAGE','23622',jdecode('Weiterbildung'),jdecode(''),'/9022/23622.html','true',[],'',''],
		['PAGE','52901',jdecode('Koordination+hru'),jdecode(''),'/9022/52901.html','true',[],'','']
	],'',''],
	['PAGE','2662',jdecode('Beratung+%2F+Hilfe'),jdecode(''),'/2662/index.html','true',[ 
		['PAGE','9043',jdecode('Lebensberatung'),jdecode(''),'/2662/9043.html','true',[],'',''],
		['PAGE','2704',jdecode('Spitalseelsorge'),jdecode(''),'/2662/2704.html','true',[],'',''],
		['PAGE','2725',jdecode('Gef%C3%A4ngnisseelsorge'),jdecode(''),'/2662/2725.html','true',[],'',''],
		['PAGE','2683',jdecode('Notfallseelsorge'),jdecode(''),'/2662/2683.html','true',[],'',''],
		['PAGE','2746',jdecode('Geh%C3%B6rlosenseelsorge'),jdecode(''),'/2662/2746.html','true',[],'',''],
		['PAGE','2767',jdecode('Nothilfe'),jdecode(''),'/2662/2767.html','true',[],'',''],
		['PAGE','2809',jdecode('Kinderheime'),jdecode(''),'/2662/2809.html','true',[],'',''],
		['PAGE','9085',jdecode('Prot.-kirch.+Hilfsverein'),jdecode(''),'/2662/9085.html','true',[],'','']
	],'',''],
	['PAGE','2830',jdecode('Publikationen'),jdecode(''),'/2830.html','true',[],'',''],
	['PAGE','2851',jdecode('Archiv'),jdecode(''),'/2851.html','true',[],'',''],
	['PAGE','9701',jdecode('Kontakt'),jdecode(''),'/9701.html','true',[],'',''],
	['PAGE','2893',jdecode('Links'),jdecode(''),'/2893.html','true',[],'',''],
	['PAGE','13201',jdecode('Suche'),jdecode(''),'/13201.html','true',[],'','']];
var siteelementCount=36;
theSitetree.topTemplateName='Dispose';
theSitetree.paletteFamily='718DF8';
theSitetree.keyvisualId='9684';
theSitetree.keyvisualName='kv_9684.gif';
theSitetree.fontsetId='10658';
theSitetree.graphicsetId='11186';
theSitetree.contentColor='3D57BA';
theSitetree.contentBGColor='CCCACA';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Dispose',
				paletteFamily: 	'718DF8',
				keyvisualId: 	'9684',
				keyvisualName: 	'kv_9684.gif',
				fontsetId: 		'10658',
				graphicsetId: 	'11186',
				contentColor: 	'3D57BA',
				contentBGColor: 'CCCACA',
				a_color: 		'000000',
				b_color: 		'000000',
				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:  '2401',
internalId:  '',
customField: '20100714-172959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20100516-202011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2830',
internalId:  '',
customField: '20100614-173904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2578',
internalId:  '',
customField: '20100516-130719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2851',
internalId:  '',
customField: '20100529-102959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2473',
internalId:  '',
customField: '20100516-125523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2494',
internalId:  '',
customField: '20100614-180812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2515',
internalId:  '',
customField: '20100219-104400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2536',
internalId:  '',
customField: '20100516-202629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2557',
internalId:  '',
customField: '20100331-084329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2599',
internalId:  '',
customField: '20100614-171627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2620',
internalId:  '',
customField: '20100614-171159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2641',
internalId:  '',
customField: '20100312-142531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2662',
internalId:  '',
customField: '20100219-110148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2683',
internalId:  '',
customField: '20100516-142734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2704',
internalId:  '',
customField: '20100516-142614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2725',
internalId:  '',
customField: '20100516-142645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2746',
internalId:  '',
customField: '20100219-113334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2767',
internalId:  '',
customField: '20100525-152843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21601',
internalId:  '',
customField: '20100525-152450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2809',
internalId:  '',
customField: '20100516-143105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20100131-164047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2893',
internalId:  '',
customField: '20100516-145019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20100525-152544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9022',
internalId:  '',
customField: '20100516-141749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9043',
internalId:  '',
customField: '20100516-142408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52901',
internalId:  '',
customField: '20100516-142248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9085',
internalId:  '',
customField: '20100409-144208'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-2223']={
webappId:    '7008',
documentId:  '9701',
internalId:  '2223',
customField: 'language:de;country:CH;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '13201',
internalId:  'search',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20100219-212340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21664',
internalId:  '',
customField: '20100529-100056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21685',
internalId:  '',
customField: '20100312-143153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21622',
internalId:  '',
customField: '20100312-142944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21643',
internalId:  '',
customField: '20100617-154345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20100219-102953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23601',
internalId:  '',
customField: '20100516-141942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23622',
internalId:  '',
customField: '20100516-142120'
};
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHP340INVD58';
var companyName   = 'REFORMIERTE+BEZIRKSSYNODE+SOLOTHURN';
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();
};
