/* [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','4584',jdecode('Home'),jdecode(''),'/4584.html','true',[],'',''],
	['PAGE','4695',jdecode('Sprache'),jdecode(''),'/4695/index.html','true',[ 
		['PAGE','43948',jdecode('Fran%C3%A7ais'),jdecode(''),'/4695/43948.html','true',[],'',''],
		['PAGE','43975',jdecode('English'),jdecode(''),'/4695/43975.html','true',[],'','']
	],'',''],
	['PAGE','4668',jdecode('Schulung'),jdecode(''),'/4668.html','true',[],'',''],
	['PAGE','4722',jdecode('Beratung'),jdecode(''),'/4722.html','true',[],'',''],
	['PAGE','4641',jdecode('Portrait'),jdecode(''),'/4641.html','true',[],'',''],
	['PAGE','4776',jdecode('Referenzen'),jdecode(''),'/4776.html','true',[],'',''],
	['PAGE','105210',jdecode('F%C3%BCr+Sie+gefunden'),jdecode(''),'/105210.html','true',[],'',''],
	['PAGE','4803',jdecode('Kontakt'),jdecode(''),'/4803/index.html','true',[ 
		['PAGE','33245',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/4803/33245.html','false',[],'',''],
		['PAGE','4830',jdecode('Adresse%2C+Telefon'),jdecode(''),'/4803/4830.html','true',[],'',''],
		['PAGE','4857',jdecode('So+finden+Sie+mich'),jdecode(''),'/4803/4857.html','true',[],'','']
	],'',''],
	['PAGE','4884',jdecode('Partner'),jdecode(''),'/4884.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Seifenblase';
theSitetree.paletteFamily='C8E2FF';
theSitetree.keyvisualId='2353';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='379';
theSitetree.graphicsetId='427';
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: 			'Seifenblase',
				paletteFamily: 	'C8E2FF',
				keyvisualId: 	'2353',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'379',
				graphicsetId: 	'427',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'6666CC',
				e_color: 		'3333CC',
				f_color: 		'9999CC',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4584',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4695',
internalId:  '',
customField: '20091214-163750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4584',
internalId:  '',
customField: '20110225-114549'
};
webappMappings['7008']=webappMappings['7008-4151']={
webappId:    '7008',
documentId:  '4803',
internalId:  '4151',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4776',
internalId:  '',
customField: '20100504-145137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105210',
internalId:  '',
customField: '20110208-160022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43948',
internalId:  '',
customField: '20091214-163459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43975',
internalId:  '',
customField: '20090904-180849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4668',
internalId:  '',
customField: '20110218-191906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20100410-174407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4641',
internalId:  '',
customField: '20100820-135327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4803',
internalId:  '',
customField: '20041218-182709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33245',
internalId:  '',
customField: '20040831-223050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4830',
internalId:  '',
customField: '20091206-014617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4857',
internalId:  '',
customField: '20100410-180805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4884',
internalId:  '',
customField: '20100410-181009'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXVW0';
var companyName   = '';
var htmlTitle	  = 'sm-communications';
var metaKeywords  = '%C3%9Cbersetzungen%2C+Coaching%2C+Supervision%2C+Mediation%2C+Erwachsenenbildung%2C+Lehrpersonen%2C+Burn-out%2C+Sozialberatung%2C+Sprachunterricht%2C+Sprachen%2C+Franz%C3%B6sisch%2C+Deutsch%2C+Englisch%2C+Case+Management%2C+Managed+Care%2C+Sozialversicherungen%2C+Lernberatung%2C+Lerncoaching';
var metaContents  = '%C3%9Cbersetzungen%2C+Lektorat%2C+Coaching%2C+Supervision%2C+Sprachkurse%2C+NLP%2C+Beratung%2C+Traductions%2C+Translations%2C+Burn-out%2C+Managed+Care%2C+Case+Management';
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();
};

