/* [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','401',jdecode('WILLKOMMEN'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','35801',jdecode('Lebens-Gestaltung'),jdecode(''),'/35801/index.html','true',[ 
		['PAGE','122401',jdecode('Systemisches+Denken'),jdecode(''),'/35801/122401.html','true',[],'',''],
		['PAGE','63601',jdecode('Systemische+Beratung'),jdecode(''),'/35801/63601.html','true',[],'',''],
		['PAGE','557',jdecode('KunstAgogik'),jdecode(''),'/35801/557.html','true',[],'',''],
		['PAGE','39801',jdecode('Zeit+%26+Kosten'),jdecode(''),'/35801/39801.html','true',[],'','']
	],'',''],
	['PAGE','494',jdecode('SCHAUfenster'),jdecode(''),'/494.html','true',[],'',''],
	['PAGE','151401',jdecode('geDANKEn'),jdecode(''),'/151401.html','true',[],'',''],
	['PAGE','118522',jdecode('Treffpunkt'),jdecode(''),'/118522.html','true',[],'',''],
	['PAGE','578',jdecode('WeitSICHT'),jdecode(''),'/578/index.html','true',[ 
		['PAGE','74901',jdecode('Sch%C3%BCtzendes'),jdecode(''),'/578/74901.html','true',[],'','']
	],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Brush';
theSitetree.paletteFamily='6F7DC8';
theSitetree.keyvisualId='11939';
theSitetree.keyvisualName='kv_11939.jpg';
theSitetree.fontsetId='33211';
theSitetree.graphicsetId='14102';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Brush',
				paletteFamily: 	'6F7DC8',
				keyvisualId: 	'11939',
				keyvisualName: 	'kv_11939.jpg',
				fontsetId: 		'33211',
				graphicsetId: 	'14102',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:  '401',
internalId:  '',
customField: '20100109-093612'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151401',
internalId:  '',
customField: '20100407-175320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35801',
internalId:  '',
customField: '20090926-115808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122401',
internalId:  '',
customField: '20090926-120118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63601',
internalId:  '',
customField: '20090307-135701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20090307-135739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39801',
internalId:  '',
customField: '20100128-150903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20091116-090241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118522',
internalId:  '',
customField: '20091116-090442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20100407-175026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74901',
internalId:  '',
customField: '20091111-092333'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2YIV';
var companyName   = 'WerkRaumLebensArt';
var htmlTitle	  = 'WerkRaumLebensArt+-+Christina+G%C3%BCnzel+-+Systemische+Beratung+Coaching+Kunstagogik+-+St.Gallen+-+Rapperswil+-+Psychologische+Beratung+Familienberatung+';
var metaKeywords  = 'Lebensgestaltung+Lebensberatung+Lebensbegleitung+Sozialpsychologische+Beratung+Psychologische+Beratung+Systemisches+Coaching+Systemische+Paarberatung+Familienberatung+Kunstagogik+Ausdrucksarbeit+Systemische+Einzelberatung+Gestaltungsp%EF%BF%BDdagogik+Coaching';
var metaContents  = 'Ich+arbeite+mit+verschiedenen+Formen+der+Gespr%EF%BF%BDchsf%EF%BF%BDhrung+und+mit+Elementen+des+gestaltgebenden+Ausdrucks.++Die+verschiedenen+Gespr%EF%BF%BDchstformen+k%EF%BF%BDnnen+mit+den+Elementen+des+gestaltgebenden+Ausdrucks+durch+die+kunstagogische+Begleitung+unterst%EF%BF%BDtzt+und+%2F+oder+erg%EF%BF%BDnzt+werden.++Die+Formen+der+Begleitung+%2F+Beratung+k%EF%BF%BDnnen+jedoch+auch+unabh%EF%BF%BDngig+von+einander+gew%EF%BF%BDhlt+werden.';
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();
};
