/* [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','901',jdecode('FIDUCIA+'),jdecode(''), jdecode('%2F901.html'), 'true',[],'',''],
	['PAGE','74801',jdecode('%C3%9Cber+uns'),jdecode(''), jdecode('%2F74801.html'), 'true',[],'',''],
	['PAGE','74822',jdecode('Personalberatung'),jdecode(''), jdecode('%2F74822.html'), 'true',[],'',''],
	['PAGE','74843',jdecode('Unternehmensberatung'),jdecode(''), jdecode('%2F74843.html'), 'true',[],'',''],
	['PAGE','74885',jdecode('Stellenangebote'),jdecode(''), jdecode('%2F74885.html'), 'true',[],'',''],
	['PAGE','1015',jdecode('Kontaktaufnahme'),jdecode(''), jdecode('%2F1015%2Findex.html'), 'true',[ 
		['PAGE','7401',jdecode('Kontaktaufnahme+%28Folgeseite%29'),jdecode(''), jdecode('%2F1015%2F7401.html'), 'false',[],'','']
	],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Dots';
theSitetree.paletteFamily='E7E9D5';
theSitetree.keyvisualId='407';
theSitetree.keyvisualName='handschlag1.jpg';
theSitetree.fontsetId='43';
theSitetree.graphicsetId='49';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E7E9D5';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2QE'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Dots',
				paletteFamily: 	'E7E9D5',
				keyvisualId: 	'407',
				keyvisualName: 	'handschlag1.jpg',
				fontsetId: 		'43',
				graphicsetId: 	'49',
				contentColor: 	'000000',
				contentBGColor: 'E7E9D5',
				a_color: 		'E7E9D5',
				b_color: 		'CCCCCC',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20111028-095532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74822',
internalId:  '',
customField: '20110928-103857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74843',
internalId:  '',
customField: '20110204-180200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74885',
internalId:  '',
customField: '20110915-135329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20091109-110145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20070129-193717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74801',
internalId:  '',
customField: '20110408-234750'
};
webappMappings['7008']=webappMappings['7008-3405']={
webappId:    '7008',
documentId:  '1015',
internalId:  '3405',
customField: 'language:de;country:CH;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN25CX';
var companyName   = 'FIDUCIA+Beratung+%2B+Weiterbildung';
var htmlTitle	  = 'Personalberatung%2C+Personalvermittlung%2C+Unternehmensberatung%2C+Erwachsenenbildung%2C+Kurse%2C+Seminare%2C+Outplacement%2C+Treuhand%2C+Steuerberatung';
var metaKeywords  = 'KMU-Beratung%2C+Personalmanagement%2C+Personaladministration%2C+Lohn%2C+Gehalt%2C+Lohnwesen%2C+Gehaltswesen%2C+Pensionskasse%2C+Personalberatung%2C+Firmenberatung%2C+Rekrutierung%2C+Selektion%2C+Kurse%2C+Seminare%2C+Firmenseminare%2C+Firmenkurse%2C+Coaching%2C+Erwachsenenbildung%2C+Steuererkl%EF%BF%BDrung%2C+Wirtschaftspr%EF%BF%BDfung%2C+Buchhaltung%2C+Lohnbuchhaltung%2C+Unternehmensorganisation%2C+Organisation%2C+Lohn+extern%2C+Lohnadministration%2C+Lehrlingswesen%2C+Sal%EF%BF%BDradministration%2C+Outplacement%2C+NKG%2C+K%EF%BF%BDrpersprache%2C+Non-verbale+Kommunikation%2C+Menschenkenntnis%2C+Farbpsychologie%2C+Zeitmanagement%2C+Arbeitsrecht%2C+Personalfachmann%2C+Personalfachfrau%2C+Personalassistent';
var metaContents  = 'KMU-Beratung%2C+Personalmanagement%2C+Personaladministration%2C+Lohn-+und+Gehaltswesen%2C+Lohn%2C+Gehalt%2C+Personalverwaltung%2C+Lohnlisten%2C+Rekrutierung%2C+Selektion%2C+Kurse%2C+Seminare%2C+Firmenseminare%2C+Firmenkurse%2C+Coaching%2C+Lehrlingswesen%2C+NKG%2C+Outplacement%2C+K%EF%BF%BDrpersprache%2C+Menschenkenntnis%2C+Farbpsychologie%2C+Zeitmanagement%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();
};

