/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','99801',jdecode('Kinesiologie'),jdecode(''),'/99801/index.html','true',[ 
		['PAGE','123301',jdecode('Applied+Physiology'),jdecode(''),'/99801/123301.html','true',[],'',''],
		['PAGE','125101',jdecode('Anwendung'),jdecode(''),'/99801/125101.html','true',[],'','']
	],'',''],
	['PAGE','4722',jdecode('TierTherapie'),jdecode(''),'/4722/index.html','true',[ 
		['PAGE','125501',jdecode('Anwendung'),jdecode(''),'/4722/125501.html','true',[],'','']
	],'',''],
	['PAGE','7701',jdecode('Tierkommunikation'),jdecode(''),'/7701/index.html','true',[ 
		['PAGE','138901',jdecode('Dienstleistung'),jdecode(''),'/7701/138901.html','true',[],'',''],
		['PAGE','126401',jdecode('Seminar+und+%C3%9Cbungsabend'),jdecode(''),'/7701/126401.html','true',[],'',''],
		['PAGE','106901',jdecode('Preise%2FKursdaten+%28Folgeseite%29'),jdecode(''),'/7701/106901.html','false',[],'','']
	],'',''],
	['PAGE','120101',jdecode('Portrait'),jdecode(''),'/120101.html','true',[],'',''],
	['PAGE','117501',jdecode('Der+Weg+zu+KINEBA'),jdecode(''),'/117501.html','true',[],'',''],
	['PAGE','78822',jdecode('Preise%2FKursdaten'),jdecode(''),'/78822.html','true',[],'',''],
	['PAGE','79101',jdecode('Link%2FKontakte'),jdecode(''),'/79101.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20091103-173554'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '117501',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79101',
internalId:  '',
customField: '20100202-194408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99801',
internalId:  '',
customField: '20080629-135812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123301',
internalId:  '',
customField: '20080629-145204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125101',
internalId:  '',
customField: '20080629-142859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20090523-181053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125501',
internalId:  '',
customField: '20080629-151431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20090523-181444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126401',
internalId:  '',
customField: '20090104-194557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120101',
internalId:  '',
customField: '20091103-174223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117501',
internalId:  '',
customField: '20080307-160630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78822',
internalId:  '',
customField: '20100813-205246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106901',
internalId:  '',
customField: '20070930-183836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138901',
internalId:  '',
customField: '20090523-183237'
};
webappMappings['7008']=webappMappings['7008-4993']={
webappId:    '7008',
documentId:  '78822',
internalId:  '4993',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2731';
var companyName   = 'PRAXIS+F%C3%9CR+KINESIOLOGIE';
var htmlTitle	  = 'Tiertherapie+Tierkinesiologie+Naturheilkunde+Bachbl%C3%BCten+Kinesiologie+Applied+Physiologie+Hom%C3%B6opathie+Reiki+Tierkommunikation';
var metaKeywords  = 'Pferd++Tierkommunikation++Bachbl%C3%BCten++Tiere++Hund+++Katze+++Reiki++reiten+nat%C3%BCrlich+natural+heilen+therapieren+Tierkinesiologie+Naturheilkunde+Seminare';
var metaContents  = 'Therapie++Kurse++++Naturheilen++Gespr%C3%A4che+mit+Tieren+reiten+Reiki+Tierkommunikation+Tiertherapie+Bachbl%C3%BCten+Kinesiologie+Tierkinesiologie+Naturheilkunde+Seminare';
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();
};
