/* [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','41648',jdecode('Aktuelles'),jdecode(''), jdecode('%2F41648.html'), 'true',[],'',''],
	['PAGE','12738',jdecode('Wie+entsteht+Gesundheit%3F'),jdecode(''), jdecode('%2F12738.html'), 'true',[],'',''],
	['PAGE','4692',jdecode('Publikationen'),jdecode(''), jdecode('%2F4692.html'), 'true',[],'',''],
	['PAGE','4554',jdecode('Unterst%C3%BCtzungsfonds'),jdecode(''), jdecode('%2F4554.html'), 'true',[],'',''],
	['PAGE','6602',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F6602%2Findex.html'), 'true',[ 
		['PAGE','6603',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F6602%2F6603.html'), 'false',[],'','']
	],'',''],
	['PAGE','41811',jdecode('Vision'),jdecode(''), jdecode('%2F41811.html'), 'true',[],'',''],
	['PAGE','41820',jdecode('Kontakt'),jdecode(''), jdecode('%2F41820.html'), 'true',[],'','']];
var siteelementCount=8;
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 prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2QE'
};
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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41648',
internalId:  '',
customField: '20111024-120406'
};
webappMappings['1002']=webappMappings['1002-6602ABW0X0INXEAE']={
webappId:    '1002',
documentId:  '6602',
internalId:  '6602ABW0X0INXEAE',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4554',
internalId:  '',
customField: '20110725-110552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4692',
internalId:  '',
customField: '20111009-082455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12738',
internalId:  '',
customField: '20110810-230228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6602',
internalId:  '',
customField: '20110730-094105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6603',
internalId:  '',
customField: '20030903-151021'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '12738',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41811',
internalId:  '',
customField: '20110810-120103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41820',
internalId:  '',
customField: '20110810-120141'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXEAE';
var companyName   = 'Fonds+proHumanitas';
var htmlTitle	  = 'Jeder+hat+ein+Recht+auf+Heilung+-+Fonds+proHumanitas+des+Naturheilzentrum+Oberland+in+Spiez';
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  = 'Naturheilkunde+und+biologische+Medizin+bei+Hautleiden%2C+Allergien%2C+Magenbeschwerden%2C+Verdauungsproblemen%2C+Kopfschmerzen%2C+R%C3%BCckenschmerzen%2C+Gelenkschmerzen%2C+Stresssymptomen%2C+Burnout%2C+Nevosit%C3%A4t%2C+Schlafst%C3%B6rungen%2C+chronische+M%C3%BCdigkeit%2C+wiederkehrende+Infekte%2C+Begleitung+bei+Krebs%2C+Krebstherapien%2C+emotionale+Blockaden%2C+Narbenentst%C3%B6rungen%2CEntgiftung%2C+Entschlackung%2C+Raumharmonisierungen%2C+medizinisch+unklare+Beschwerden+und+mehr';
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();
};

