/* [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','4599',jdecode('Home'),jdecode(''), jdecode('%2F4599.html'), 'true',[],'',''],
	['PAGE','4683',jdecode('Drogerie'),jdecode(''), jdecode('%2F4683%2Findex.html'), 'true',[ 
		['PAGE','4656',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F4683%2F4656.html'), 'true',[],'',''],
		['PAGE','4818',jdecode('Aktuelles'),jdecode(''), jdecode('%2F4683%2F4818.html'), 'true',[],'',''],
		['PAGE','5007',jdecode('Natur+-+Tipp'),jdecode(''), jdecode('%2F4683%2F5007.html'), 'true',[],'',''],
		['PAGE','4953',jdecode('Adresse%2C+Telefon'),jdecode(''), jdecode('%2F4683%2F4953.html'), 'true',[],'','']
	],'',''],
	['PAGE','65401',jdecode('Kurse+und+Vortr%C3%A4ge'),jdecode(''), jdecode('%2F65401%2Findex.html'), 'true',[ 
		['PAGE','10719',jdecode('Sch%C3%BCssler-Kurse+Hochdorf'),jdecode(''), jdecode('%2F65401%2F10719.html'), 'true',[],'',''],
		['PAGE','65422',jdecode('Kurse+und+Vort%C3%A4ge+Schweiz'),jdecode(''), jdecode('%2F65401%2F65422.html'), 'true',[],'','']
	],'',''],
	['PAGE','36101',jdecode('Sant%C3%A9natur'),jdecode(''), jdecode('%2F36101%2Findex.html'), 'true',[ 
		['PAGE','75501',jdecode('Sch%C3%BCssler+Buch'),jdecode(''), jdecode('%2F36101%2F75501.html'), 'true',[],'',''],
		['PAGE','65443',jdecode('Kartoffelbalsam+Facts'),jdecode(''), jdecode('%2F36101%2F65443.html'), 'true',[],'',''],
		['PAGE','65601',jdecode('Kartoffelbalsam+Hand+und+Fuss'),jdecode(''), jdecode('%2F36101%2F65601.html'), 'true',[],'',''],
		['PAGE','89901',jdecode('Kartoffelbalsam+Brust+und+R%C3%BCcken'),jdecode(''), jdecode('%2F36101%2F89901.html'), 'true',[],'',''],
		['PAGE','65622',jdecode('Kartoffelbalsam+Verkaufsstellen'),jdecode(''), jdecode('%2F36101%2F65622.html'), 'true',[],'',''],
		['PAGE','81401',jdecode('Verkauf+Deutschland+%2FEU'),jdecode(''), jdecode('%2F36101%2F81401.html'), 'true',[],'',''],
		['PAGE','67101',jdecode('Kontakt+Sant%C3%A9natur'),jdecode(''), jdecode('%2F36101%2F67101.html'), 'true',[],'','']
	],'',''],
	['PAGE','6896',jdecode('Online-Shop'),jdecode(''), jdecode('%2F6896.html'), 'true',[],'',''],
	['PAGE','6861',jdecode('Anfahrt'),jdecode(''), jdecode('%2F6861.html'), 'true',[],'',''],
	['PAGE','8281',jdecode('Links'),jdecode(''), jdecode('%2F8281.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Case';
theSitetree.paletteFamily='82C1DC';
theSitetree.keyvisualId='11061';
theSitetree.keyvisualName='kv_11061.jpg';
theSitetree.fontsetId='31938';
theSitetree.graphicsetId='13781';
theSitetree.contentColor='34454C';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Case',
				paletteFamily: 	'82C1DC',
				keyvisualId: 	'11061',
				keyvisualName: 	'kv_11061.jpg',
				fontsetId: 		'31938',
				graphicsetId: 	'13781',
				contentColor: 	'34454C',
				contentBGColor: 'F6FBFE',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4599',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2886658']={
webappId:    '1501',
documentId:  '4599',
internalId:  '2886658',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4656',
internalId:  '',
customField: '20111025-163809'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6861',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['4001']=webappMappings['4001-Mqv9_Kaf2_PCge_u']={
webappId:    '4001',
documentId:  '6896',
internalId:  'Mqv9_Kaf2_PCge_u',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-1773']={
webappId:    '7008',
documentId:  '4953',
internalId:  '1773',
customField: 'language:de;country:CH;'
};
webappMappings['1009']=webappMappings['1009-5764088']={
webappId:    '1009',
documentId:  '12881',
internalId:  '5764088',
customField: 'isFollowupPage:true;documentId:4953;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65601',
internalId:  '',
customField: '20110524-150150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20120210-140633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10719',
internalId:  '',
customField: '20120210-135323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4683',
internalId:  '',
customField: '20120210-140354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36101',
internalId:  '',
customField: '20111102-093516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65401',
internalId:  '',
customField: '20111112-092403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4818',
internalId:  '',
customField: '20120120-160255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5007',
internalId:  '',
customField: '20120120-160515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4953',
internalId:  '',
customField: '20120210-140832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12881',
internalId:  '',
customField: '20050909-141051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6861',
internalId:  '',
customField: '20070330-151222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8281',
internalId:  '',
customField: '20060612-185446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6896',
internalId:  '',
customField: '20120210-135634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65422',
internalId:  '',
customField: '20120210-135435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65443',
internalId:  '',
customField: '20111025-160736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65622',
internalId:  '',
customField: '20110302-115536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67101',
internalId:  '',
customField: '20100124-182926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75501',
internalId:  '',
customField: '20111025-154150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81401',
internalId:  '',
customField: '20110419-151330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89901',
internalId:  '',
customField: '20111026-161516'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXPYJ';
var companyName   = 'DROPA+Drogerie+K%C3%A4ch';
var htmlTitle	  = 'Dropa+Drogerie+Kaech%2C+Sant%C3%A9natur%2C+Walter+Kaech';
var metaKeywords  = 'Kaech%2C+Hochdorf%2C+Gesundheit%2C+Wissen%2C+Drogerie%2C+Heilmittel%2C+Naturheilmittel%2C+Walter%2C+K%C3%A4ch%2C+Omida%2C+Ausbildung%2C+Sch%C3%BCsslersalze%2C+Kurse%2C+Vortr%C3%A4ge%2C+Heilkr%C3%A4uter%2C+Apotheke%2C+Biochemie%2C+Sch%C3%BCssler%2C+Mineralsalze%2C+Zellsalze%2C+Regulation%2C+Dropa%2C+Sant%C3%A9natur%2C+Sch%C3%BCsslerbuch%2C+Kartoffelbalsam%2C+Erg%C3%A4nzungsmittel%2C+Nr.27%2C+Nr.26%2C+Nr.25%2C+Sch%C3%BCssler+Beratungstelefon';
var metaContents  = 'Kurse+und+Vortr%C3%A4ge+zu+Naturheilkunde+und+Sch%C3%BCssler+Salzen.+Ein+kompetenter+Parner+in+Gesundheitsfragen.+Eigenprodukte+die+Sie+sonst+nirgens+bekommen+100%25+nat%C3%BCrlich.%0D%0ASch%C3%BCssler+Beratungstelefon';
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();
};

