/* [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 theSitetree=[ 
	['PAGE','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','652',jdecode('Fachjournalismus'),jdecode(''),'/652.html','true',[],''],
	['PAGE','736',jdecode('Coaching'),jdecode(''),'/736.html','true',[],''],
	['PAGE','757',jdecode('Portrait'),jdecode(''),'/757.html','true',[],''],
	['PAGE','8601',jdecode('Kontakt'),jdecode(''),'/8601/index.html','true',[ 
		['PAGE','9901',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/8601/9901.html','false',[],'']
	],''],
	['PAGE','17201',jdecode('Links'),jdecode(''),'/17201.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Explore';
theSitetree.paletteFamily='737373';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10431';
theSitetree.graphicsetId='10767';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				name: 			'Explore',
				paletteFamily: 	'737373',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10431',
				graphicsetId: 	'10767',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-2349']={
webappId:    '7008',
documentId:  '8601',
internalId:  '2349',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2YSL';
var companyName   = 'Kommunikation+und+Coaching';
var htmlTitle	  = 'Keller+Consult+%E2%80%93+Kommunikation+und+Beratung';
var metaKeywords  = 'Christian%2C+Keller%2C+Consult%2C+Frauenfeld%2C+Thalwil%2C+Coach%2C+psychologisch%2C+psychisch%2C+Coaching%2C+systemisch%2C+l%C3%B6sungsorientiert%2C+Unterst%C3%BCtzung%2C+Lebenshilfe%2C+Hilfe%2C+Gespr%C3%A4ch%2C+Reden%2C+Krise%2C+Not%2C+Stress%2C+F%C3%BChrungskr%C3%A4fte%2C+Journalist%2C+Redaktor%2C+Fachjournalismus%2C+Fachjournalist%2C+Berater%2C+Beratung%2C+Schulung%2C+Technik%2C+technisch%2C+Ingenieur%2C';
var metaContents  = 'Christian+Keller%2C+Dr.phil.%2C+Dipl.Ing.%2C+ist+Fachjournalist+f%C3%BCr+Technik+und+systemisch+l%C3%B6sungsorientierter+Coach.+Als+Fachjournalist+ber%C3%A4t+er+technische+Unternehmen+und+Verlage.+Als+Coach+unterst%C3%BCtzt+er+Menschen+%E2%80%93+insbesondere+auch+F%C3%BChrungskr%C3%A4fte+%E2%80%93+die+Belastungen+ausgesetzt+sind.';
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();
};

