/* [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','4521',jdecode('Home'),jdecode(''),'/4521.html','true',[],'',''],
	['PAGE','34357',jdecode('Gesundheitsprodukte'),jdecode(''),'/34357.html','true',[],'',''],
	['PAGE','34496',jdecode('Seminare%26Worksshops'),jdecode(''),'/34496.html','true',[],'',''],
	['PAGE','15648',jdecode('Anfrage-Online'),jdecode(''),'/15648.html','true',[],'',''],
	['PAGE','16705',jdecode('AGB%C2%B4s'),jdecode(''),'/16705/index.html','true',[ 
		['PAGE','34369',jdecode('Gesundheitsprodukte'),jdecode(''),'/16705/34369.html','true',[],'',''],
		['PAGE','34378',jdecode('Reisen%2FKuren'),jdecode(''),'/16705/34378.html','true',[],'','']
	],'',''],
	['PAGE','9637',jdecode('Kontakt'),jdecode(''),'/9637.html','true',[],'',''],
	['PAGE','17507',jdecode('Links'),jdecode(''),'/17507.html','true',[],'',''],
	['PAGE','9610',jdecode('Jobs'),jdecode(''),'/9610.html','true',[],'',''],
	['PAGE','33242',jdecode('Datenschutz'),jdecode(''),'/33242.html','true',[],'',''],
	['PAGE','30641',jdecode('Shop'),jdecode(''),'/30641.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='FFD375';
theSitetree.keyvisualId='1990';
theSitetree.keyvisualName='strand.jpg';
theSitetree.fontsetId='328';
theSitetree.graphicsetId='385';
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: 			'Stylus',
				paletteFamily: 	'FFD375',
				keyvisualId: 	'1990',
				keyvisualName: 	'strand.jpg',
				fontsetId: 		'328',
				graphicsetId: 	'385',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFD375',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1009']=webappMappings['1009-6262707']={
webappId:    '1009',
documentId:  '27661',
internalId:  '6262707',
customField: 'isFollowupPage:true;documentId:15621;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4521',
internalId:  '1006',
customField: '1006'
};
webappMappings['1009']=webappMappings['1009-6473624']={
webappId:    '1009',
documentId:  '28144',
internalId:  '6473624',
customField: 'isFollowupPage:true;documentId:28089;'
};
webappMappings['7008']=webappMappings['7008-3703']={
webappId:    '7008',
documentId:  '15648',
internalId:  '3703',
customField: 'language:de;country:CH;'
};
webappMappings['1009']=webappMappings['1009-6263187']={
webappId:    '1009',
documentId:  '16203',
internalId:  '6263187',
customField: 'isFollowupPage:true;documentId:15648;'
};
webappMappings['1009']=webappMappings['1009-6266235']={
webappId:    '1009',
documentId:  '21503',
internalId:  '6266235',
customField: 'isFollowupPage:true;documentId:19895;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34378',
internalId:  '',
customField: '20091129-122149'
};
webappMappings['1501']=webappMappings['1501-480197']={
webappId:    '1501',
documentId:  '4521',
internalId:  '480197',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4521',
internalId:  '',
customField: '20091129-123443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17507',
internalId:  '',
customField: '20090324-200236'
};
webappMappings['1009']=webappMappings['1009-6270376']={
webappId:    '1009',
documentId:  '30946',
internalId:  '6270376',
customField: 'isFollowupPage:true;documentId:30641;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34496',
internalId:  '',
customField: '20091129-123532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21503',
internalId:  '',
customField: '20060131-220838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34369',
internalId:  '',
customField: '20091129-122215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27661',
internalId:  '',
customField: '20060331-214522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34357',
internalId:  '',
customField: '20091129-113212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28144',
internalId:  '',
customField: '20060331-221213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15648',
internalId:  '',
customField: '20091129-113223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16203',
internalId:  '',
customField: '20060130-210127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16705',
internalId:  '',
customField: '20091129-123238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9637',
internalId:  '',
customField: '20090729-080710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9610',
internalId:  '',
customField: '20060206-234431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33242',
internalId:  '',
customField: '20080227-235853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30641',
internalId:  '',
customField: '20080920-190708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30946',
internalId:  '',
customField: '20060607-001643'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXM1';
var companyName   = 'ActivWell+GmbH+%E2%80%A2+Gesundheit+und+mehr..';
var htmlTitle	  = '';
var metaKeywords  = 'Wellness%2CWellness+in+der+Schweiz%2CWettbewerb%2CReisegutschein%2CKosmetik%2CBeauty%2CReise+Gutschein%2CWellness+Reise%2CErholung%2CEntspannen';
var metaContents  = 'Gesundheitsprodukte%2CHeilpraktiker%2CNaturarzt%2CErn%C3%A4hrung%2CWellness+Reisen+zum+Festpreis+incl.Anwendungen+und+Halbpension';
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();
};
