/* [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','501',jdecode('HOME'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','145901',jdecode('SELBSTPORTRAIT'),jdecode(''), jdecode('%2F145901.html'), 'true',[],'',''],
	['PAGE','194701',jdecode('PHILOSOPHIE'),jdecode(''), jdecode('%2F194701.html'), 'true',[],'',''],
	['PAGE','247812',jdecode('ENERGIE-ARBEIT'),jdecode(''), jdecode('%2F247812.html'), 'true',[],'',''],
	['PAGE','636',jdecode('BL%C3%9CTENKRAFT'),jdecode(''), jdecode('%2F636.html'), 'true',[],'',''],
	['PAGE','657',jdecode('ESSENZEN'),jdecode(''), jdecode('%2F657.html'), 'true',[],'',''],
	['PAGE','238512',jdecode('AUSTESTEN'),jdecode(''), jdecode('%2F238512.html'), 'true',[],'',''],
	['PAGE','198601',jdecode('INTUITIONS-TRAINING'),jdecode(''), jdecode('%2F198601.html'), 'true',[],'',''],
	['PAGE','615',jdecode('BERATUNG+%2F+PREISE'),jdecode(''), jdecode('%2F615.html'), 'true',[],'',''],
	['PAGE','699',jdecode('PRAXIS'),jdecode(''), jdecode('%2F699.html'), 'true',[],'',''],
	['PAGE','147601',jdecode('WEGBESCHREIBUNG'),jdecode(''), jdecode('%2F147601.html'), 'true',[],'',''],
	['PAGE','164701',jdecode('KONTAKT'),jdecode(''), jdecode('%2F164701.html'), 'true',[],'',''],
	['PAGE','720',jdecode('LINKS'),jdecode(''), jdecode('%2F720.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Groove';
theSitetree.paletteFamily='F36969';
theSitetree.keyvisualId='6007';
theSitetree.keyvisualName='kv_6007.jpg';
theSitetree.fontsetId='11127';
theSitetree.graphicsetId='11921';
theSitetree.contentColor='5F5F60';
theSitetree.contentBGColor='E4E4E6';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Groove',
				paletteFamily: 	'F36969',
				keyvisualId: 	'6007',
				keyvisualName: 	'kv_6007.jpg',
				fontsetId: 		'11127',
				graphicsetId: 	'11921',
				contentColor: 	'5F5F60',
				contentBGColor: 'E4E4E6',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20120122-140555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145901',
internalId:  '',
customField: '20120122-134504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '194701',
internalId:  '',
customField: '20120122-141335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20120122-135031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20120122-134635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20120122-134840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '238512',
internalId:  '',
customField: '20120122-134734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20120122-134708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '247812',
internalId:  '',
customField: '20120122-134607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20120113-115407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147601',
internalId:  '',
customField: '20120122-134931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '164701',
internalId:  '',
customField: '20120122-134951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '198601',
internalId:  '',
customField: '20120122-134813'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW1X0INED1N';
var companyName   = '';
var htmlTitle	  = 'POWER+and+FLOWERS%2C+Energie-+und+Bl%C3%BCtentherapie+f%C3%BCr+Mensch+und+Tier%2C+Bachbl%C3%BCten%2C+Jonabl%C3%BCten%2C+Australische+Buschbl%C3%BCten%2C+Alaskabl%C3%BCten%2C+Energetische+Behandlungen';
var metaKeywords  = 'Bl%C3%BCtenessenzen%2C+aus+dem+Herzen+leben%2C+Selbstfindung%2C+Heilung+aus+dem+Inneren%2C+Unterst%C3%BCtzung+in+Beziehung%2C+Beruf%2C+Finanzen+und+Gesundheit%2C+bei+Hochsensibilit%C3%A4t%2C+f%C3%BCr+Indigo-+und+Kristallkinder%2C+Heilung+des+inneren+Kindes%2C+Verbindung+zu+Engeln+und+Planeten%2C++';
var metaContents  = 'Ganzheitliche+Bl%C3%BCtentherapie+f%C3%BCr+Mensch+und+Tier+in+Hombrechtikon%2C+Bachbl%C3%BCten%2C+Jonabl%C3%BCten%2C+Australische+Buschbl%C3%BCten%2C++Alaskabl%C3%BCten%2C+telefonische+Beratungen%2C++Meditationen%2C+Energie-Arbeit';
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();
};

