/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','752',jdecode('%C3%9Cber+uns'),jdecode(''),'/752.html','true',[],'',''],
	['PAGE','815',jdecode('Tr%C3%A4gerschaft+'),jdecode(''),'/815/index.html','true',[ 
		['PAGE','70501',jdecode('Jahresbericht'),jdecode(''),'/815/70501.html','true',[],'',''],
		['PAGE','71001',jdecode('Vereinsstatuten'),jdecode(''),'/815/71001.html','true',[],'','']
	],'',''],
	['PAGE','66501',jdecode('Patronatskomitee'),jdecode(''),'/66501.html','true',[],'',''],
	['PAGE','773',jdecode('Selbsthilfegruppen'),jdecode(''),'/773/index.html','true',[ 
		['PAGE','794',jdecode('Gruppenlisten+SO'),jdecode(''),'/773/794.html','true',[],'','']
	],'',''],
	['PAGE','857',jdecode('Kontakt'),jdecode(''),'/857/index.html','true',[ 
		['PAGE','6001',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/857/6001.html','false',[],'','']
	],'',''],
	['PAGE','46001',jdecode('Aktuell'),jdecode(''),'/46001/index.html','true',[ 
		['PAGE','82401',jdecode('Spit%C3%A4ler+Kliniken'),jdecode(''),'/46001/82401.html','true',[],'',''],
		['PAGE','84601',jdecode('Austauschtreffen+'),jdecode(''),'/46001/84601.html','true',[],'','']
	],'',''],
	['PAGE','74001',jdecode('Mitglieder+gesucht'),jdecode(''),'/74001.html','true',[],'',''],
	['PAGE','86601',jdecode('Spenden'),jdecode(''),'/86601.html','true',[],'',''],
	['PAGE','56701',jdecode('Links'),jdecode(''),'/56701.html','true',[],'',''],
	['PAGE','92901',jdecode('Selbsthilfe-Post'),jdecode(''),'/92901.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Borders';
theSitetree.paletteFamily='C9DFEE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10571';
theSitetree.graphicsetId='10771';
theSitetree.contentColor='692643';
theSitetree.contentBGColor='F0F2F4';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Borders',
				paletteFamily: 	'C9DFEE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10571',
				graphicsetId: 	'10771',
				contentColor: 	'692643',
				contentBGColor: 'F0F2F4',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20100709-105412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100713-155922'
};
webappMappings['7008']=webappMappings['7008-729']={
webappId:    '7008',
documentId:  '857',
internalId:  '729',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '815',
internalId:  '',
customField: '20100609-112632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70501',
internalId:  '',
customField: '20100506-135727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71001',
internalId:  '',
customField: '20090417-144057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66501',
internalId:  '',
customField: '20100505-162636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20080618-104014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20100714-104256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20081013-150710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20090216-085201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46001',
internalId:  '',
customField: '20100526-102434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74001',
internalId:  '',
customField: '20100305-114550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56701',
internalId:  '',
customField: '20100514-113756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82401',
internalId:  '',
customField: '20100506-135839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84601',
internalId:  '',
customField: '20100623-160406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86601',
internalId:  '',
customField: '20100604-111842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92901',
internalId:  '',
customField: '20100713-155542'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHOPT0INE6DC';
var companyName   = 'Hilfe+zur+Selbsthilfe+im+Kanton+Solothurn';
var htmlTitle	  = 'Kontaktstelle+f%C3%BCr+Selbsthilfegruppen+Kanton+Solothurn';
var metaKeywords  = 'Selbsthilfegruppen%2C+AA+AL-ANON+Alleinstehende+Alleinerziehende+Allergien-Asthma-Neurodermitis+Alzheimer+Amalgamgesch%C3%A4digte+Asthma-+und+Atemwegserkrankungen++Autismus+Behinderte+Erwachsene+Behinderte+Behinderte+Kinder+-+Gliederlose+Kinder+Bulimie+Magersucht+Essst%C3%B6rungen+Brustkrebs+Behinderte+Erwachsene+Chronische+Schmerzen++Depression+Depression+Diabetes+Drogen+Sucht+Dystonien+Eltern+homosexueller+Kinder++Epilepsie+Epilepsie+bei+Kindern+Fr%C3%BChgeborene+Kinder+fr%C3%BChgewordene+Eltern++Fibromyalgie+Weichteilrheumatismus+Herzkranke+Kinder+Hirnverletzte+Inzest++Kehlkopflose+Kindstod+Krebskranke+Kinder+Krebskranke+allgemein+Krebskranke+M%C3%A4nnerLupus+Erythematodes+Magenband+Messie+Morbus+Bechterew+Morbus+Crohn+Colitis+ulcerosa+Multiple+Sklerose+Neurodermitis+Nierenerkrankungen+Dialyse+Osteoporose+Parkinson+Pflegenden+Angeh%C3%B6rige+Polyarthritiker++Polyneuropathie+POS+ADS+bei+Kindern+Gespr%C3%A4chsgruppe+POS+ADS+Erwachsene++Psychisch+Kranke+++Psychose+Seminar+++Restless+Legs+++Scheidung+%28M%C3%A4nner%29++Schizophrenie++Schwerkranke+u.+Sterbende+begleiten++Sehbehinderte++Sexueller+Missbrauch++Sklerodermie++Stillen%2FStillberatung++Schwerh%C3%B6rige+++Tinnitus++Trauern++Trennung+Scheidung++Traumatische+Geburt+%C3%9Cbergewicht+Verwitwete+mit+Kindern+Verantwortungsvoll+Erziehende+Scheidung++Z%C3%B6liakie++';
var metaContents  = 'Information+zur+Selbsthilfe+Kanton+Solothurn+Selbsthilfegruppen+Gruppengespr%C3%A4che+Therapie';
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();
};
