/* [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','9582',jdecode('Portrait'),jdecode(''),'/9582.html','true',[],'',''],
	['PAGE','9528',jdecode('Dienstleistungen'),jdecode(''),'/9528.html','true',[],'',''],
	['PAGE','9501',jdecode('Nutri-bus-Linien'),jdecode(''),'/9501.html','true',[],'',''],
	['PAGE','9555',jdecode('Tarif+'),jdecode(''),'/9555.html','true',[],'',''],
	['PAGE','9609',jdecode('Nutri-bus+aktiv'),jdecode(''),'/9609.html','true',[],'',''],
	['PAGE','9636',jdecode('Kontakt'),jdecode(''),'/9636/index.html','true',[ 
		['PAGE','10178',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/9636/10178.html','true',[],'','']
	],'',''],
	['PAGE','10812',jdecode('Link'),jdecode(''),'/10812.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Fragment';
theSitetree.paletteFamily='D8CFB1';
theSitetree.keyvisualId='3453';
theSitetree.keyvisualName='kv_3453.jpg';
theSitetree.fontsetId='10430';
theSitetree.graphicsetId='10763';
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: 			'Fragment',
				paletteFamily: 	'D8CFB1',
				keyvisualId: 	'3453',
				keyvisualName: 	'kv_3453.jpg',
				fontsetId: 		'10430',
				graphicsetId: 	'10763',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'D8CFB1',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'6E6237',
				e_color: 		'6E6237',
				f_color: 		'6E6237',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4607',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4607',
internalId:  '',
customField: '20101201-135412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9609',
internalId:  '',
customField: '20100813-070444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9582',
internalId:  '',
customField: '20110118-093645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9528',
internalId:  '',
customField: '20110118-140507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20110331-153133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9555',
internalId:  '',
customField: '20100813-070417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9636',
internalId:  '',
customField: '20110111-115551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10178',
internalId:  '',
customField: '20051208-151736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10812',
internalId:  '',
customField: '20100813-070622'
};
webappMappings['7008']=webappMappings['7008-3219']={
webappId:    '7008',
documentId:  '9636',
internalId:  '3219',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXG3';
var companyName   = 'www.nutri-bus.ch';
var htmlTitle	  = 'Nutri-bus';
var metaKeywords  = 'Erwachsenenbildung%2C+Ern%C3%A4hrungsberatung+und+Graub%C3%BCnden%2C+Schulung%3B+Nutri-bus%2C+Ern%C3%A4hrung%2C+Martschitsch%2C+Drouve%2C+betriebliche+Gesundheitsf%C3%B6rderung%2C+Stress%2C+Entspannung%2C+Nahrungsmittelallergie%2C+%C3%BCbergewichtige+Kinder%2C+Vortr%C3%A4ge%2C+Workshops%2C++Nutri-bus-Erlebniskiste%2C+Swissbroke%2C+Proforma%2C+Strapazi%2C+Bus%2C+Kompetenz%2C+Medienarbeit%2C+wissenschaftliche+Unterst%C3%BCtzung%2CErwachsenenbildung%2C+Erwachsenenbildnerin%2C+Ern%C3%A4hrungswissenschaft%2C+Abnehmen%2C+Pensionierungsplanung%2C+Ausbildnerin+mit+eidg.+Fachausweis%2C+Graub%C3%BCnden';
var metaContents  = 'Nutri-bus%2C+ein+Schweizer+Unternehmen+welches+in+den+Bereichen+Nutrition+%3D+Ern%EF%BF%BDhrung%2C+Beratung+und+Schulung+t%C3%A4tig+ist.+Sie+planen+Vortr%C3%A4ge%2C+Schulungen%2C+Kurse+%C3%BCber+Themen+hinsichtlich+Ern%C3%A4hrung%2C+betriebliche+Gesundheitsf%C3%B6rderung+und+Stressbew%C3%A4ltigung+und+suchen+nach+einer+kompetenten+Fachperson%3F';
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();
};

