/* [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('Willkommen'),jdecode(''), jdecode('%2F4599%2Findex.html'), 'true',[ 
		['PAGE','4791',jdecode('%C3%BCber+mich'),jdecode(''), jdecode('%2F4599%2F4791.html'), 'true',[],'',''],
		['PAGE','14412',jdecode('meine+Praxis'),jdecode(''), jdecode('%2F4599%2F14412.html'), 'true',[],'','']
	],'',''],
	['PAGE','4656',jdecode('Tarot+Beratungen'),jdecode(''), jdecode('%2F4656.html'), 'true',[],'',''],
	['PAGE','10477',jdecode('Tarot+Kurse'),jdecode(''), jdecode('%2F10477.html'), 'true',[],'',''],
	['PAGE','22801',jdecode('Tarot-Mobil'),jdecode(''), jdecode('%2F22801.html'), 'true',[],'',''],
	['PAGE','4683',jdecode('Bachbl%C3%BCten+Beratungen'),jdecode(''), jdecode('%2F4683.html'), 'true',[],'',''],
	['PAGE','4710',jdecode('Einzel-Coaching'),jdecode(''), jdecode('%2F4710.html'), 'true',[],'',''],
	['PAGE','21901',jdecode('K%C3%B6rper-Energie-Arbeit'),jdecode(''), jdecode('%2F21901.html'), 'true',[],'',''],
	['PAGE','9402',jdecode('Seminare'),jdecode(''), jdecode('%2F9402.html'), 'true',[],'',''],
	['PAGE','21922',jdecode('Kreativ+%26+Shop'),jdecode(''), jdecode('%2F21922.html'), 'true',[],'',''],
	['PAGE','4764',jdecode('Aktuelles+%2F+Links'),jdecode(''), jdecode('%2F4764.html'), 'true',[],'',''],
	['PAGE','4818',jdecode('Kontakt'),jdecode(''), jdecode('%2F4818%2Findex.html'), 'true',[ 
		['PAGE','6964',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''), jdecode('%2F4818%2F6964.html'), 'false',[],'','']
	],'',''],
	['PAGE','10512',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F10512%2Findex.html'), 'true',[ 
		['PAGE','10513',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F10512%2F10513.html'), 'false',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Vignette';
theSitetree.paletteFamily='E79E6E';
theSitetree.keyvisualId='3549';
theSitetree.keyvisualName='kv_3549.jpg';
theSitetree.fontsetId='10783';
theSitetree.graphicsetId='10833';
theSitetree.contentColor='875534';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vignette',
				paletteFamily: 	'E79E6E',
				keyvisualId: 	'3549',
				keyvisualName: 	'kv_3549.jpg',
				fontsetId: 		'10783',
				graphicsetId: 	'10833',
				contentColor: 	'875534',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'E79E6E',
				e_color: 		'886146',
				f_color: 		'C97556',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4599',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4764',
internalId:  '',
customField: '20110501-115212'
};
webappMappings['1002']=webappMappings['1002-10512ABW0X0INXX7W']={
webappId:    '1002',
documentId:  '10512',
internalId:  '10512ABW0X0INXX7W',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-652492']={
webappId:    '1501',
documentId:  '4599',
internalId:  '652492',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20110501-114359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9402',
internalId:  '',
customField: '20111224-211818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4791',
internalId:  '',
customField: '20101028-174218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14412',
internalId:  '',
customField: '20081026-192329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21922',
internalId:  '',
customField: '20120113-162150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4656',
internalId:  '',
customField: '20111224-202014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4683',
internalId:  '',
customField: '20111224-211237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4710',
internalId:  '',
customField: '20111224-201836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10477',
internalId:  '',
customField: '20111224-211324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21901',
internalId:  '',
customField: '20111224-210922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20110501-115116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4818',
internalId:  '',
customField: '20101029-164114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6964',
internalId:  '',
customField: '20041112-235605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10512',
internalId:  '',
customField: '20101029-164155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10513',
internalId:  '',
customField: '20081026-193125'
};
webappMappings['7008']=webappMappings['7008-6646']={
webappId:    '7008',
documentId:  '4818',
internalId:  '6646',
customField: 'language:de;country:CH;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXX7W';
var companyName   = 'Praxis+f%C3%BCr+K%C3%B6rper%2C+Geist+%26+Seele';
var htmlTitle	  = 'Praxis+f%C3%BCr+K%C3%B6rper%2C+Geist+und+Seele';
var metaKeywords  = 'Tarotkurs+Beratungen+Tarot%2C+Astrologie+Horoskop+Enertree+Lebensberatung++Pratteln+Basel+Lichtarbeit+Energiearbeit+Chakraarbeit+Reinkernationsanalyse+Seminare+Meditationen+Coaching+Tarot+Mobil+fahrende+Praxis';
var metaContents  = 'Astrologie+Tarot+Tarotkurs+Pratteln+Basel++K%C3%B6rper-Energiearbeit%2C+Chakraarbeit%2C+Lichtarbeit%2C+Behandlungen%2C+Beratungen%2C+Kurse%2C+Coaching%2C+Meditationen%2C+Loslass+Seminare%2C+Tarot+Mobil%2C+fahrende+Praxis';
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();
};

