/* [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','4598',jdecode('Home'),jdecode(''),'/4598.html','true',[],'',''],
	['PAGE','18430',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/18430.html','true',[],'',''],
	['PAGE','24703',jdecode('Rechtsberatung'),jdecode(''),'/24703.html','true',[],'',''],
	['PAGE','24730',jdecode('Treuhand'),jdecode(''),'/24730.html','true',[],'',''],
	['PAGE','19597',jdecode('Preise'),jdecode(''),'/19597.html','true',[],'',''],
	['PAGE','4682',jdecode('Adresse%2C+Telefon%2C++E-mail'),jdecode(''),'/4682.html','true',[],'',''],
	['PAGE','4655',jdecode('Kontakt'),jdecode(''),'/4655/index.html','true',[ 
		['PAGE','17745',jdecode('Kontakt+%28Form+followup+page%29'),jdecode(''),'/4655/17745.html','false',[],'','']
	],'',''],
	['PAGE','5202',jdecode('G%C3%A4stebuch'),jdecode(''),'/5202/index.html','true',[ 
		['PAGE','5203',jdecode('Eintr%C3%A4ge'),jdecode(''),'/5202/5203.html','false',[],'','']
	],'',''],
	['PAGE','28744',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/28744.html','true',[],'',''],
	['PAGE','28754',jdecode('Anfahrt'),jdecode(''),'/28754.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='336699';
theSitetree.keyvisualId='1282';
theSitetree.keyvisualName='pflanzen.jpg';
theSitetree.fontsetId='193';
theSitetree.graphicsetId='230';
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: 			'Profile',
				paletteFamily: 	'336699',
				keyvisualId: 	'1282',
				keyvisualName: 	'pflanzen.jpg',
				fontsetId: 		'193',
				graphicsetId: 	'230',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'336699',
				b_color: 		'336699',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28744',
internalId:  '',
customField: '20090129-195706'
};
webappMappings['1002']=webappMappings['1002-5202ABW0X0INX3DJ']={
webappId:    '1002',
documentId:  '5202',
internalId:  '5202ABW0X0INX3DJ',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '28754',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '28744',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28754',
internalId:  '',
customField: '20090129-195647'
};
webappMappings['1009']=webappMappings['1009-5026033']={
webappId:    '1009',
documentId:  '17745',
internalId:  '5026033',
customField: 'isFollowupPage:true;documentId:4655;'
};
webappMappings['7008']=webappMappings['7008-237']={
webappId:    '7008',
documentId:  '4655',
internalId:  '237',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20060114-064555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18430',
internalId:  '',
customField: '20071006-091844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24703',
internalId:  '',
customField: '20060209-074229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24730',
internalId:  '',
customField: '20060209-074555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19597',
internalId:  '',
customField: '20060209-074135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4682',
internalId:  '',
customField: '20100206-140245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20060110-132438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17745',
internalId:  '',
customField: '20060109-085954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5202',
internalId:  '',
customField: '20060108-000439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5203',
internalId:  '',
customField: '20050220-132118'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX3DJ';
var companyName   = 'Mag.+iur.+E.+Kitonyo++-++Treuhand++%26+Rechtsberatung';
var htmlTitle	  = 'www.kitonyo.net';
var metaKeywords  = 'Rechtsberatung%2C+Verwaltungsrecht%2C+Arbeitsrecht%2C+Sozialrecht%2C+Trennung%2C+Scheidung%2C+Steuer%2C+Businessplan%2C+Firmengr%3Fndung%2C+Buchhaltung%2C+IV+Renten%2C+AHV+Renten%2C+Zusatzleistungen%2C+Sozialhilfe%2C+Hilfe%2C+Not%2C+Briefe+an+die+%3Fmter%2C+Probleme+mit+den+%3Fmtern%2C+Meine+Rechte%2C+Privat.+Behinderte%2C+Soziales%2C+Schwache%2C+Treuhand%2C+Budget%2CVertretung%2C+Kosteng%EF%BF%BDnstig%2C+polski+prawnik+w+Szwajcarii%2C+polska+pomoc+prawna+w+Szwajcarii%2C+Vollm%EF%BF%BDchte%2CZuerich%2C+Schweiz.';
var metaContents  = 'Rechtsberatung%2C+Verwaltungsrecht%2C+Arbeitsrecht%2C+Sozialrecht%2C+Ehe%2C+Kinder%2CTrennung%2C+Scheidung%2C+Steuer%2C+Businessplan%2C+Firmengruendung%2C+Buchhaltung%2C+IV+Renten%2C+Behinderung%2C+Krankheit%2C+Hilfe%2C+AHV+Renten%2C+Zusatzleistungen%2C+Sozialhilfe%2C+Briefe+an+die+Aemter%2C+Probleme+mit+den+Aemtern%2C+Meine+Rechte%2C+polski+prawnik+w+Szwajcarii%2C+polska+pomoc+prawna+w+Szwajcarii%2C+Vollmaechte%2C+Zuerich%2C+Schweiz.';
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();
};

