/* [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('namaste'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','233801',jdecode('ayurveda...'),jdecode(''),'/233801/index.html','true',[ 
		['PAGE','233822',jdecode('...und+die+veden'),jdecode(''),'/233801/233822.html','true',[],'','']
	],'',''],
	['PAGE','186943',jdecode('medizin+heilkunde'),jdecode(''),'/186943.html','true',[],'',''],
	['PAGE','235901',jdecode('diagnostik+therapie'),jdecode(''),'/235901/index.html','true',[ 
		['PAGE','204322',jdecode('doshas'),jdecode(''),'/235901/204322.html','true',[],'',''],
		['PAGE','204343',jdecode('shrotas+dhatus+malas'),jdecode(''),'/235901/204343.html','true',[],'',''],
		['PAGE','204385',jdecode('agni+und+ama'),jdecode(''),'/235901/204385.html','true',[],'','']
	],'',''],
	['PAGE','204469',jdecode('schulmedizin'),jdecode(''),'/204469.html','true',[],'',''],
	['PAGE','204595',jdecode('links+und+literatur'),jdecode(''),'/204595.html','true',[],'',''],
	['PAGE','164490',jdecode('kontakt'),jdecode(''),'/164490/index.html','true',[ 
		['PAGE','207001',jdecode('lageplan'),jdecode(''),'/164490/207001.html','true',[],'','']
	],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Handout';
theSitetree.paletteFamily='848485';
theSitetree.keyvisualId='11653';
theSitetree.keyvisualName='kv_11653.jpg';
theSitetree.fontsetId='32943';
theSitetree.graphicsetId='13993';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='848485';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Handout',
				paletteFamily: 	'848485',
				keyvisualId: 	'11653',
				keyvisualName: 	'kv_11653.jpg',
				fontsetId: 		'32943',
				graphicsetId: 	'13993',
				contentColor: 	'FFFFFF',
				contentBGColor: '848485',
				a_color: 		'FFFFFF',
				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:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '164490',
internalId:  '',
customField: '20110512-105845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090226-110859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204343',
internalId:  '',
customField: '20090225-175758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204322',
internalId:  '',
customField: '20090225-175534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '186943',
internalId:  '',
customField: '20090226-111805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '207001',
internalId:  '',
customField: '20090223-004612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204385',
internalId:  '',
customField: '20090225-180035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204469',
internalId:  '',
customField: '20090225-181029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '233822',
internalId:  '',
customField: '20090226-112919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '235901',
internalId:  '',
customField: '20090226-111954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '233801',
internalId:  '',
customField: '20090226-105614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204595',
internalId:  '',
customField: '20090225-220820'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '207001',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW1X0INE1IA';
var companyName   = 'svasthya+-+praxis+f%C3%BCr+ayurveda+';
var htmlTitle	  = '';
var metaKeywords  = 'Nicole+Sieber%0D%0AAyurveda%0D%0AGesundheit%0D%0AMassage%0D%0AWangen+an+der+Aare%0D%0ATraditionelle+Indische+Medizin';
var metaContents  = 'Nicole+Sieber%0D%0AAyurveda%0D%0AGesundheit%0D%0AMassage%0D%0AWangen+an+der+Aare%0D%0ATraditionelle+Indische+Medizin';
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();
};

