/* [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','4554',jdecode('Naturheilpraxis'),jdecode(''),'/4554.html','true',[],'',''],
	['PAGE','4611',jdecode('Diagnoseverfahren'),jdecode(''),'/4611.html','true',[],'',''],
	['PAGE','4638',jdecode('Therapieangebote'),jdecode(''),'/4638.html','true',[],'',''],
	['PAGE','12738',jdecode('Wie+entsteht+Gesundheit%3F'),jdecode(''),'/12738.html','true',[],'',''],
	['PAGE','4692',jdecode('Veranstaltungen+%2F+Links'),jdecode(''),'/4692.html','true',[],'',''],
	['PAGE','6602',jdecode('G%C3%A4stebuch'),jdecode(''),'/6602/index.html','true',[ 
		['PAGE','6603',jdecode('Eintr%C3%A4ge'),jdecode(''),'/6602/6603.html','false',[],'','']
	],'',''],
	['PAGE','8260',jdecode('Kontakt'),jdecode(''),'/8260/index.html','true',[ 
		['PAGE','8323',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/8260/8323.html','false',[],'','']
	],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Success';
theSitetree.paletteFamily='0F3D78';
theSitetree.keyvisualId='1652';
theSitetree.keyvisualName='garten.jpg';
theSitetree.fontsetId='262';
theSitetree.graphicsetId='331';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='F1F1F1';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Success',
				paletteFamily: 	'0F3D78',
				keyvisualId: 	'1652',
				keyvisualName: 	'garten.jpg',
				fontsetId: 		'262',
				graphicsetId: 	'331',
				contentColor: 	'000066',
				contentBGColor: 'F1F1F1',
				a_color: 		'0F3D78',
				b_color: 		'F9AC26',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4554',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4638',
internalId:  '',
customField: '20100318-072920'
};
webappMappings['1002']=webappMappings['1002-6602ABW0X0INXEAE']={
webappId:    '1002',
documentId:  '6602',
internalId:  '6602ABW0X0INXEAE',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4554',
internalId:  '',
customField: '20100326-102513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4611',
internalId:  '',
customField: '20100301-222715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4692',
internalId:  '',
customField: '20100119-201248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12738',
internalId:  '',
customField: '20070416-104011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6602',
internalId:  '',
customField: '20090303-101113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6603',
internalId:  '',
customField: '20030903-151021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8260',
internalId:  '',
customField: '20100520-114306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8323',
internalId:  '',
customField: '20030913-160731'
};
webappMappings['7008']=webappMappings['7008-6873']={
webappId:    '7008',
documentId:  '8260',
internalId:  '6873',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXEAE';
var companyName   = 'Naturheilpraxis+Rolf+Wenger';
var htmlTitle	  = '';
var metaKeywords  = 'Ganzheitlich+Naturheilkunde+Koerper+Seele+Geist+Behandlung+Wirbelsaeule%2C+Bioresonanz%2C+Psycho-Kinesiologie+Bio-Neurologie+Orthomolekulare+Medizin+Massage+Fussreflexzonentherapie+Isopathie+Homotoxikologie+Phytotherapie+Autogenes+Training+Psychosomatik+Schroepfen+Homoeopathie+Lachtherapie+Wellness+Fasten+Rolf+Wenger+Ruecken+Wirbelsaeule+Beschwerden+Genesung+Naturheilkunde+Naturheilpraktiker+Bern+Thun+Gesundheit+Lebensqualitaet+Alternativ+Beratung+Praxis+Allergiebehandlung+Schmerz+Gesundheit+Natur+Psychosomatik+Medizin+Praevention+Schlaf+Stoerung+Lachen+Heilung+Lachgruppe+Probleme+Naturheilpraxis+Heilpraktiker+Ekzem+Magen+Darm+Krebs+Tumor+Abnehmen+Stoffwechsel+Analyse+Diagnose+Schmerz+Kopf+Migraene+Verdauung+Tipps+Rezept+Ernaehrung+Bewegung+Heilkraeuter+Hydrotherapie+Leiden+Sauerstoff+Metabolic+Typing+HRV+Gesundheitstipps+Mykotherapie+Heilpilze+Farbtherapie+Infrarottherapie+IPL';
var metaContents  = 'Ganzheitliche+Naturheilkunde+auf+der+Basis+von+Koerper%2C+Seele+und+Geist%3A+Dorn%2C+Bioresonanz%2C+Psycho-Kinesiologie+%28Bio-Neurologie%29%2C+Orthomolekulare+Medizin%2C+Massage%2C+Dunkelfeld%2C+Fussreflexzonentherapie%2C+Isopathie%2C+Homotoxikologie%2C+Phytotherapie%2C+Autogenes+Training%2C+Psychosomatik%2C+Schroepfen%2C+Hydrotherapie%2C+Allergiebehandlung%2C+Wellness-+und+Fastenwochen%2C+Metabolic+Typing%2C+Sauerstoff+Therapie%2C+HRV%2C+Mykotherapie%2C+IPL%2C+Infrarottherapie%2C++Naturkosmetik+Vitalblut+Diagnostik';
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();
};
