/* [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','94901',jdecode('Zielgruppen'),jdecode(''), jdecode('%2F94901%2Findex.html'), 'true',[ 
		['PAGE','87338',jdecode('UnternehmerInnen'),jdecode(''), jdecode('%2F94901%2F87338.html'), 'true',[],'',''],
		['PAGE','94922',jdecode('PersonalleiterInnen'),jdecode(''), jdecode('%2F94901%2F94922.html'), 'true',[],'',''],
		['PAGE','94943',jdecode('F%C3%BChrungskr%C3%A4fte'),jdecode(''), jdecode('%2F94901%2F94943.html'), 'true',[],'',''],
		['PAGE','95401',jdecode('TrainerInnen'),jdecode(''), jdecode('%2F94901%2F95401.html'), 'true',[],'',''],
		['PAGE','95422',jdecode('Vertriebsleute'),jdecode(''), jdecode('%2F94901%2F95422.html'), 'true',[],'',''],
		['PAGE','95443',jdecode('Montageleute'),jdecode(''), jdecode('%2F94901%2F95443.html'), 'true',[],'',''],
		['PAGE','95464',jdecode('Innendienstleute'),jdecode(''), jdecode('%2F94901%2F95464.html'), 'true',[],'','']
	],'',''],
	['PAGE','95485',jdecode('Leitgedanken+%2F+Leitlinien'),jdecode(''), jdecode('%2F95485.html'), 'true',[],'',''],
	['PAGE','106401',jdecode('Feedback'),jdecode(''), jdecode('%2F106401.html'), 'true',[],'',''],
	['PAGE','95506',jdecode('Referenzen'),jdecode(''), jdecode('%2F95506.html'), 'true',[],'',''],
	['PAGE','95527',jdecode('Roland+Fahrni'),jdecode(''), jdecode('%2F95527.html'), 'true',[],'',''],
	['PAGE','95548',jdecode('Kontakt'),jdecode(''), jdecode('%2F95548.html'), 'true',[],'',''],
	['PAGE','94801',jdecode(''),jdecode(''), jdecode('%2F94801.html'), 'true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Clean';
theSitetree.paletteFamily='B5B5B5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33273';
theSitetree.graphicsetId='14153';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Clean',
				paletteFamily: 	'B5B5B5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33273',
				graphicsetId: 	'14153',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'787878',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Trebuchet MS, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1009']=webappMappings['1009-4630901']={
webappId:    '1009',
documentId:  '51301',
internalId:  '4630901',
customField: 'isFollowupPage:true;documentId:40818;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106401',
internalId:  '',
customField: '20110802-161729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95443',
internalId:  '',
customField: '20100723-123820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95422',
internalId:  '',
customField: '20100723-123804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94922',
internalId:  '',
customField: '20100723-123717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95401',
internalId:  '',
customField: '20100723-123752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95548',
internalId:  '',
customField: '20100903-174515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95527',
internalId:  '',
customField: '20110205-211110'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '95548',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95464',
internalId:  '',
customField: '20100911-132645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87338',
internalId:  '',
customField: '20100911-132612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94801',
internalId:  '',
customField: '20100722-214435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94901',
internalId:  '',
customField: '20110219-112439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94943',
internalId:  '',
customField: '20110205-212700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95485',
internalId:  '',
customField: '20100903-175645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51301',
internalId:  '',
customField: '20041229-233709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95506',
internalId:  '',
customField: '20110802-160544'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '94901',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXLDB';
var companyName   = 'Roland+Fahrni+++++++++++++++++++++++++Training+-+Coaching+-+Moderation+';
var htmlTitle	  = 'Roland+Fahrni++Training+-+Moderation+-+Coaching+';
var metaKeywords  = 'Unternehmensstrategie%2C+Vertriebsstrategie%2C+Leadership%2C+Kommunikationstrainings%2C+HR-+L%C3%B6sungen';
var metaContents  = 'Training%2C+Moderation%2C+Coaching%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();
};

