/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','50701',jdecode('News'),jdecode(''),'/50701.html','true',[],'',''],
	['PAGE','53601',jdecode('Business+Workshops'),jdecode(''),'/53601.html','false',[],'',''],
	['PAGE','32001',jdecode('ERP+Consulting'),jdecode(''),'/32001/index.html','true',[ 
		['PAGE','32043',jdecode('Beratung'),jdecode(''),'/32001/32043.html','true',[],'',''],
		['PAGE','32022',jdecode('Evaluation'),jdecode(''),'/32001/32022.html','true',[],'',''],
		['PAGE','34101',jdecode('Projektmanagement'),jdecode(''),'/32001/34101.html','true',[],'',''],
		['PAGE','38901',jdecode('Was+ist+ERP+%3F'),jdecode(''),'/32001/38901.html','true',[],'','']
	],'',''],
	['PAGE','56301',jdecode('ERP+Skills'),jdecode(''),'/56301.html','true',[],'',''],
	['PAGE','44601',jdecode('ERP+Solutions'),jdecode(''),'/44601/index.html','true',[ 
		['PAGE','44622',jdecode('PROFFIX'),jdecode(''),'/44601/44622.html','true',[],'',''],
		['PAGE','65601',jdecode('PROFFIX+Reporting'),jdecode(''),'/44601/65601.html','true',[],'','']
	],'',''],
	['PAGE','60701',jdecode('WEB+Solutions'),jdecode(''),'/60701/index.html','true',[ 
		['PAGE','67401',jdecode('WEB+Winteraktion'),jdecode(''),'/60701/67401.html','false',[],'','']
	],'',''],
	['PAGE','51901',jdecode('Anmeldung+Workshop'),jdecode(''),'/51901.html','true',[],'',''],
	['PAGE','12201',jdecode('Kontaktdaten'),jdecode(''),'/12201.html','true',[],'',''],
	['PAGE','47701',jdecode('Kontaktformular'),jdecode(''),'/47701.html','true',[],'',''],
	['PAGE','55101',jdecode('Unser+Standort'),jdecode(''),'/55101.html','true',[],'',''],
	['PAGE','53622',jdecode('Suche'),jdecode(''),'/53622.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Startup';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='1347';
theSitetree.keyvisualName='buero.jpg';
theSitetree.fontsetId='235';
theSitetree.graphicsetId='278';
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: 			'Startup',
				paletteFamily: 	'990000',
				keyvisualId: 	'1347',
				keyvisualName: 	'buero.jpg',
				fontsetId: 		'235',
				graphicsetId: 	'278',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'990000',
				b_color: 		'333333',
				c_color: 		'000000',
				d_color: 		'FF0000',
				e_color: 		'FF0000',
				f_color: 		'FF0000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20110330-113429'
};
webappMappings['7008']=webappMappings['7008-1239']={
webappId:    '7008',
documentId:  '51901',
internalId:  '1239',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-141']={
webappId:    '7008',
documentId:  '47701',
internalId:  '141',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50701',
internalId:  '',
customField: '20100225-222823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32001',
internalId:  '',
customField: '20091027-112800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32043',
internalId:  '',
customField: '20100601-094718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32022',
internalId:  '',
customField: '20071130-102052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34101',
internalId:  '',
customField: '20090612-145630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20091027-112009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44601',
internalId:  '',
customField: '20091109-172629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44622',
internalId:  '',
customField: '20091208-133951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20090815-103847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47701',
internalId:  '',
customField: '20080822-144103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51901',
internalId:  '',
customField: '20091019-155450'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '53622',
internalId:  'search',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53622',
internalId:  '',
customField: '20090324-183831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53601',
internalId:  '',
customField: '20090326-102107'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '55101',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55101',
internalId:  '',
customField: '20110330-101253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56301',
internalId:  '',
customField: '20110330-113137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60701',
internalId:  '',
customField: '20090925-152117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65601',
internalId:  '',
customField: '20091104-120442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67401',
internalId:  '',
customField: '20091127-102113'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INEC4D';
var companyName   = '';
var htmlTitle	  = 'LeCon+-+we+accelerate+your+business';
var metaKeywords  = 'LeCon+ERP+Beratung+Consulting+IT+Evaluation+Evaluation+Projekt+Project+Unternehmensberatung++Prozessanalysen++Schulung++Seminare++Projektmanagement+++Individualentwicklungen++Controlling+Enterprise+Resource+Planning+Oracle+Miracle+Navision+Proffix';
var metaContents  = 'LeCon++ERP+Consulting++Beratung+Leuenberger+Evaluation+Management+Projekt+Project+Oracle+Miracle+Navision+Proffix';
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();
};

