/* [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','4677',jdecode('Home'),jdecode(''),'/4677.html','true',[],'',''],
	['PAGE','4734',jdecode('Die+Idee+W%C3%B6lfli-Huus'),jdecode(''),'/4734/index.html','true',[ 
		['PAGE','4761',jdecode('Das+Team'),jdecode(''),'/4734/4761.html','true',[],'',''],
		['PAGE','4788',jdecode('Das+Ziel'),jdecode(''),'/4734/4788.html','true',[],'',''],
		['PAGE','4815',jdecode('Die+Leitung'),jdecode(''),'/4734/4815.html','true',[],'','']
	],'',''],
	['PAGE','4842',jdecode('Wir+bieten+an%3A'),jdecode(''),'/4842/index.html','true',[ 
		['PAGE','4869',jdecode('Das+Konzept'),jdecode(''),'/4842/4869.html','true',[],'',''],
		['PAGE','4896',jdecode('WG+in+Solothurn'),jdecode(''),'/4842/4896.html','true',[],'',''],
		['PAGE','4923',jdecode('WG+in+Neuendorf'),jdecode(''),'/4842/4923.html','true',[],'',''],
		['PAGE','25087',jdecode('WLS+Glauseria+Solothurn'),jdecode(''),'/4842/25087.html','true',[],'',''],
		['PAGE','25319',jdecode('Werkstatt++Do+it'),jdecode(''),'/4842/25319.html','true',[],'','']
	],'',''],
	['PAGE','4977',jdecode('Aktivit%C3%A4ten'),jdecode(''),'/4977/index.html','true',[ 
		['PAGE','5004',jdecode('Monatsbericht'),jdecode(''),'/4977/5004.html','true',[],'',''],
		['PAGE','5031',jdecode('Was+steht+an'),jdecode(''),'/4977/5031.html','true',[],'',''],
		['PAGE','5058',jdecode('Ferien'),jdecode(''),'/4977/5058.html','true',[],'','']
	],'',''],
	['PAGE','4950',jdecode('Wen+sprechen+wir+an'),jdecode(''),'/4950.html','true',[],'',''],
	['PAGE','5085',jdecode('Stellen'),jdecode(''),'/5085.html','true',[],'',''],
	['PAGE','5112',jdecode('Kontakt+%2F+freie+Pl%C3%A4tze'),jdecode(''),'/5112/index.html','true',[ 
		['PAGE','5139',jdecode('Freie+Pl%C3%A4tze'),jdecode(''),'/5112/5139.html','true',[],'',''],
		['PAGE','5166',jdecode('Links'),jdecode(''),'/5112/5166.html','true',[],'','']
	],'',''],
	['PAGE','5193',jdecode('Photos'),jdecode(''),'/5193.html','true',[],'',''],
	['PAGE','14456',jdecode('G%C3%A4stebuch'),jdecode(''),'/14456/index.html','true',[ 
		['PAGE','14457',jdecode('Eintr%C3%A4ge'),jdecode(''),'/14456/14457.html','false',[],'','']
	],'',''],
	['PAGE','16802',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/16802.html','true',[],'',''],
	['PAGE','25096',jdecode('TESSIN+%222009%22+'),jdecode(''),'/25096.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Deepcolor';
theSitetree.paletteFamily='D14747';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10613';
theSitetree.graphicsetId='10471';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='980000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Deepcolor',
				paletteFamily: 	'D14747',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10613',
				graphicsetId: 	'10471',
				contentColor: 	'000000',
				contentBGColor: '980000',
				a_color: 		'D14747',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4734',
internalId:  '',
customField: '20050807-114622'
};
webappMappings['1002']=webappMappings['1002-14456ABW0X0INXZE3']={
webappId:    '1002',
documentId:  '14456',
internalId:  '14456ABW0X0INXZE3',
customField: 'icq=false'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '16802',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4677',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2649749']={
webappId:    '1501',
documentId:  '4677',
internalId:  '2649749',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4677',
internalId:  '',
customField: '20080626-084442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4761',
internalId:  '',
customField: '20100719-192431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4788',
internalId:  '',
customField: '20050807-131334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4815',
internalId:  '',
customField: '20080319-070626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4842',
internalId:  '',
customField: '20050807-113929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4869',
internalId:  '',
customField: '20100506-100802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4896',
internalId:  '',
customField: '20050807-125918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4923',
internalId:  '',
customField: '20050807-150356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25087',
internalId:  '',
customField: '20090204-105352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4977',
internalId:  '',
customField: '20071126-172952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5004',
internalId:  '',
customField: '20071126-145510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5031',
internalId:  '',
customField: '20071126-173228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5058',
internalId:  '',
customField: '20071203-162255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4950',
internalId:  '',
customField: '20050807-114536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5085',
internalId:  '',
customField: '20060422-145414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5112',
internalId:  '',
customField: '20050726-101320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5139',
internalId:  '',
customField: '20100719-191922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5166',
internalId:  '',
customField: '20060730-151704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5193',
internalId:  '',
customField: '20071126-161316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14456',
internalId:  '',
customField: '20050719-163205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14457',
internalId:  '',
customField: '20050719-163205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16802',
internalId:  '',
customField: '20050724-153836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25096',
internalId:  '',
customField: '20090902-165251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25319',
internalId:  '',
customField: '20090204-110331'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXZE3';
var companyName   = 'Wohngemeinschaft+W%C3%B6lfli-Huus';
var htmlTitle	  = 'Therapeutische+Wohngemeinschaft+W%C3%B6lfli-Huus';
var metaKeywords  = 'begleitetes+Wohnen%2CWohngemeinschaft%2Cpsychische+Behinderung%2Cschizophrenie%2Csozialpsychiatrie%2Csozialarbeit%2Csozial%2Cmilieutherapie%2Cbewohner%2Cgabriele+erzer%2Cchristian+wyss%2Cneuendorf%2Csolothurn%2Cheime%2Canstalten%2Cffe%2Cbetreungspl%C3%A4tze%2Cantipsychiatrie%2Cborderlinest%C3%B6rung%2CMaltherapie';
var metaContents  = 'Milieutherapie%2Cbetreutes+Wohnen%2CWohngemeinschaft%2Cpsychische+Behinderung%2CHeimpl%C3%A4tze%2CMaltherapie%2Ctherapeutische+Wohngemeinschaft%2Chilfe+zur+selbsthilfe%2Cpsychiatrie%2Cschizophrenie%2Cdepression%2Cmanie%2Cborderline%2Cphobie%2Cneurosen%2Cneuendorf%2Csolothurn%2Cpl%C3%A4tze+f%C3%BCr+behinderte%2CAdolf+W%C3%B6lfli%2Cffe%2CGabriele+Erzer%2CChristian+Wyss%2CWG%2CBetreuung%2CW%C3%B6lflihuus%2CW%C3%B6lfli-Huus%2C';
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();
};
