/* [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','301',jdecode('Home'),jdecode(''), jdecode('%2F301.html'), 'true',[],'',''],
	['PAGE','5601',jdecode('Coaching+%26+Workshop'),jdecode(''), jdecode('%2F5601.html'), 'true',[],'',''],
	['PAGE','5622',jdecode('Wellness+Ferien+%2F+Holiday'),jdecode(''), jdecode('%2F5622.html'), 'true',[],'',''],
	['PAGE','5643',jdecode('Online+Coaching+%26+Shop'),jdecode(''), jdecode('%2F5643.html'), 'true',[],'',''],
	['PAGE','5706',jdecode('Daten+%26+Preise+'),jdecode(''), jdecode('%2F5706%2Findex.html'), 'true',[ 
		['PAGE','10812',jdecode('Anmeldung+%2F+Registration'),jdecode(''), jdecode('%2F5706%2F10812.html'), 'true',[],'','']
	],'',''],
	['PAGE','5664',jdecode('%C3%9Cber+mich+%26+Links+'),jdecode(''), jdecode('%2F5664%2Findex.html'), 'true',[ 
		['PAGE','5685',jdecode('Werdegang+%2F+Career'),jdecode(''), jdecode('%2F5664%2F5685.html'), 'true',[],'','']
	],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='A5B351';
theSitetree.keyvisualId='6858';
theSitetree.keyvisualName='kv_6858.jpg';
theSitetree.fontsetId='11213';
theSitetree.graphicsetId='12031';
theSitetree.contentColor='657025';
theSitetree.contentBGColor='C1CF70';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'genotec',
  product: 'WSCSYSSSSLYTCP0K'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'A5B351',
				keyvisualId: 	'6858',
				keyvisualName: 	'kv_6858.jpg',
				fontsetId: 		'11213',
				graphicsetId: 	'12031',
				contentColor: 	'657025',
				contentBGColor: 'C1CF70',
				a_color: 		'C1CF70',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20111102-092758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20111031-231640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5622',
internalId:  '',
customField: '20111028-075947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5643',
internalId:  '',
customField: '20111024-230104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5664',
internalId:  '',
customField: '20110410-203457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5685',
internalId:  '',
customField: '20110214-200812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5706',
internalId:  '',
customField: '20111028-075912'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10812',
internalId:  '',
customField: '20080225-092354'
};
webappMappings['7008']=webappMappings['7008-1172']={
webappId:    '7008',
documentId:  '10812',
internalId:  '1172',
customField: 'language:de;country:CH;'
};
var webAppHostname = 'cgi.wsc.genotec.ch:80';
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN2KYZ';
var companyName   = '++++++++++++balance-yourself+++++++';
var htmlTitle	  = 'Ern%C3%A4hrungs-+%26+Lifestyle+Coach';
var metaKeywords  = 'Ern%C3%A4hrungsberatung%2C+Ern%C3%A4hrungsberaterin%2C+Luzern%2C+online+beratung%2C+Abnehmen%2C+Lebensberatung%2C+Wohlbefinden%2C+Wohlf%C3%BChlgewicht%2C+Wunschgewicht%2C+Gesundheit%2C+ausgewogene+Ern%C3%A4hrung%2C+Selbstbewusstsein+st%C3%A4rken%2C+positive+Energie%2C+Ganzheitlichkeit%2C+online+beratung%2C+Kurse%2C+Workshops%2C+online+shop%2C+wellness+ferien%2C+mediterrane+Ern%C3%A4hrung%2C+Degustationen%2C+Antipasti%2C+work-life-balance%2C+Info-Abend%2C+Entspannungs-+und+Erholungs-Ferien%2C+Management+Ferien%2C+gesund+alt+werden%2C+Kinderernaehrung%2C+Frauenpower%2C+Abnehmferien%2C+Wellness+Ferien%2C+Gesundheit%2C+ELKI+Treffen%2C+';
var metaContents  = 'Eine+ern%C3%A4hrungs-psychologische+und+Bewegungs+Beratung+hilft+Ihnen+m%C3%BChelos+Ihren+Wohlf%C3%BChlgewicht+und+Wohlbefinden+zu+erreichen+und+zu+halten.+Die+eigenen+Bed%C3%BCrfnissen+werden+wahrgenommen+und+an+der+momentanen+Lebenssituation+angepasst.+Sie+werden+intensiv+von+einer+Fachperson+begleitet%2C+um+Barrieren+m%C3%BChelos+zu+%C3%BCberwaeltigen.';
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();
};

