/* [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('Willkommen+'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','773',jdecode('Psychologische+Beratung'),jdecode(''),'/773.html','true',[],'',''],
	['PAGE','9001',jdecode('Krisenbegleitung'),jdecode(''),'/9001.html','true',[],'',''],
	['PAGE','5701',jdecode('Atemtherapie'),jdecode(''),'/5701.html','true',[],'',''],
	['PAGE','9701',jdecode('Arbeitsweise'),jdecode(''),'/9701.html','true',[],'',''],
	['PAGE','11901',jdecode('Zu+meiner+Person'),jdecode(''),'/11901.html','true',[],'',''],
	['PAGE','7401',jdecode('Wissenswertes'),jdecode(''),'/7401.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Steps';
theSitetree.paletteFamily='315881';
theSitetree.keyvisualId='2287';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='367';
theSitetree.graphicsetId='419';
theSitetree.contentColor='FFD1BC';
theSitetree.contentBGColor='315881';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Steps',
				paletteFamily: 	'315881',
				keyvisualId: 	'2287',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'367',
				graphicsetId: 	'419',
				contentColor: 	'FFD1BC',
				contentBGColor: '315881',
				a_color: 		'315881',
				b_color: 		'2985B5',
				c_color: 		'3366CC',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20070302-210358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20100204-124311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20100204-124643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20070302-210448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100204-131744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20070302-210934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20060827-201528'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2KVW';
var companyName   = '++www.hinder-beratung.ch+';
var htmlTitle	  = 'Marianne+Hinder%2C+Psychologische+Beratung+Z%C3%BCrich%2C+Atemtherapie%2C+Hilfe%2C+Unterst%C3%BCtzung%2C+Z%C3%BCrich-Enge';
var metaKeywords  = 'Marianne+Hinder%2C+Psychologische+Beratung+Z%C3%BCrich-Enge%2C+Atemtherapie+Z%C3%BCrich%2C+ganzheitliche+Beratung%2C+Lebensberatung%2C+k%C3%B6rperzentrierte+psychologische+Beratung+IKP%2C+Schwierigkeiten%2C+Probleme%2CTrauerverarbeitung%2C+Begleitung+in+schwierigen+Lebenssituationen%2C+Lebenshilfe%2C+Nervosit%C3%A4t%2C+psychosomatische+Probleme%2C+neutrale+Fachperson%2C+Energiearbeit%2C+Entspannungsmethoden%2C+Krise%2C%C3%84ngste%2C+Depression%2C+Bezihungsprobleme%2C+Standortbestimmung%2C+Schlafst%C3%B6rungen%2C+Wechseljahrprobleme%2C+Krisenbegleitung%2C+Atmung+verbessern%2C+Atemprobleme%2C+Tinnitus%2C+Energiemangel%2C+Ersch%C3%B6pfung%2C+Regulation+des+Nervensystems%2C+Biografiearbeit%2C+Traumanalyse%2C+IKP';
var metaContents  = 'Ganzeitliche+psychologische+Beratung+und+Atemtherapie%2C+die+schulmedizinisches+und+k%C3%B6rpertherapeutisches+Wissen+und+auf+der+%C3%B6stlichen+Meridianlehre+beruht.+Begleitung+und+Unterst%C3%BCtzung+in+schwierigen+Lebensphasen%2C+bei+Partnerschafts-+und+Berufsfragen%2C+zwischenmenschlichen+Beziehungen%2C+bei+psychosomatischen+Beschwerden%2C+wie+Stress%2C+%C3%84ngsten%2C++Nervosit%C3%A4t%2C+Panik%2C+Depression%2C+Ersch%C3%B6pfung%2CStandortbestimmung%2C+Trauerarbeit%2C+in+Trennungssituationen%2C+Atemproblemen%2C+Praxis+beim+Bahnhof+8002+Z%C3%BCrich-Enge';
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();
};
