/* [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','4607',jdecode('Home'),jdecode(''),'/4607.html','true',[],'',''],
	['PAGE','4691',jdecode('Unser+Kundensegment'),jdecode(''),'/4691.html','true',[],'',''],
	['PAGE','25502',jdecode('Rechnungswesen'),jdecode(''),'/25502.html','true',[],'',''],
	['PAGE','4745',jdecode('Wirtschaftspr%C3%BCfung'),jdecode(''),'/4745.html','true',[],'',''],
	['PAGE','4826',jdecode('Unsere+Qualifikation+'),jdecode(''),'/4826.html','true',[],'',''],
	['PAGE','40252',jdecode('News'),jdecode(''),'/40252.html','true',[],'',''],
	['PAGE','4907',jdecode('Links'),jdecode(''),'/4907.html','true',[],'',''],
	['PAGE','4934',jdecode('Kontakt'),jdecode(''),'/4934/index.html','true',[ 
		['PAGE','6407',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/4934/6407.html','false',[],'','']
	],'',''],
	['PAGE','7569',jdecode('Wegweiser'),jdecode(''),'/7569.html','true',[],'',''],
	['PAGE','9502',jdecode('Routenplaner'),jdecode(''),'/9502.html','true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Basic';
theSitetree.paletteFamily='36566E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10829';
theSitetree.graphicsetId='11283';
theSitetree.contentColor='36566E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Basic',
				paletteFamily: 	'36566E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10829',
				graphicsetId: 	'11283',
				contentColor: 	'36566E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4607',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '7569',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-2468574']={
webappId:    '1501',
documentId:  '4607',
internalId:  '2468574',
customField: '1501'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '9502',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4691',
internalId:  '',
customField: '20091029-191846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4607',
internalId:  '',
customField: '20091102-133447'
};
webappMappings['7008']=webappMappings['7008-3024']={
webappId:    '7008',
documentId:  '4934',
internalId:  '3024',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4745',
internalId:  '',
customField: '20091103-201651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25502',
internalId:  '',
customField: '20091102-121137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4826',
internalId:  '',
customField: '20091029-172407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40252',
internalId:  '',
customField: '20091214-213909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4907',
internalId:  '',
customField: '20091103-211456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4934',
internalId:  '',
customField: '20060203-133949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6407',
internalId:  '',
customField: '20050114-221143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7569',
internalId:  '',
customField: '20091103-202555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9502',
internalId:  '',
customField: '20060204-183240'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXL3B';
var companyName   = 'Baumann+Treuhand+AG++4803+Vordemwald+++%28RAB+RegNr%3A+504137%29';
var htmlTitle	  = '';
var metaKeywords  = 'Rechnungswesen%2C+Jahresabschluss%2C+Steuererkl%C3%A4rung%2C+Steuern%2C+Steuerberatung%2C+Finanzbuchhalung%2C+Finanzberatung%2C+Rating%2C+Geld%2C+Zins%2C+Steuerrechnung%2C+Liegenschaftsverwaltung%2C+Verm%C3%B6gensverwaltung%2C+Hausverwaltung%2C+Erbteilung%2C+Erbschaft%2C+Willensvollstreckung%2C+Abschreibung%2C+Cash+Flow%2C+Investition%2C+Wirtschaftspr%C3%BCfung%2C+Revisor%2C+Revision%2C+Treuhand%2C+AHV%2C+IV%2C+Berufliche+Vorsorge%2C+BVG%2C+UVG%2C+Verlust%2C+Gewinn%2C+Erfolgsrechnung%2C+Bilanz%2C+Verm%C3%B6gensrechnung%2C+Spendenverwaltung%2C+Vertrauen%2C+Glaube%2C+Lebenssinn%2C+Finanzziele%2C+Vordemwald%2C+R%C3%BCtiweg%2C+Buchpr%C3%BCfung%2C+Gutachten%2C+Bewertung%2C+Investition%2C+Konkurs%2C+Schuldbetreibung%2C+Stellvertretung%2C+Vertr%C3%A4ge%2C+Steuerveranlagung%2C+Steuerverwaltung%2C+Veranlagung%2C+zugelassener+Revisor%2C+';
var metaContents  = 'Wirtschaftspr%C3%BCfung%2C+Beratung%2C+Betreuung%2C+Coaching%2C+Revision%2C+Wirtschaftspr%C3%BCfung%2C+Revisionaufsichtsbeh%C3%B6rde%2C+zugelassener+Revisionsexperte%2C++';
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();
};
