/* [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','4520',jdecode('HOME'),jdecode(''), jdecode('%2F4520.html'), 'true',[],'',''],
	['PAGE','17962',jdecode('BODY+GAME'),jdecode(''), jdecode('%2F17962%2Findex.html'), 'true',[ 
		['PAGE','18016',jdecode('Team'),jdecode(''), jdecode('%2F17962%2F18016.html'), 'true',[],'',''],
		['PAGE','18043',jdecode('Kursprogramm'),jdecode(''), jdecode('%2F17962%2F18043.html'), 'true',[],'',''],
		['PAGE','18097',jdecode('Stundenplan'),jdecode(''), jdecode('%2F17962%2F18097.html'), 'true',[],'',''],
		['PAGE','18070',jdecode('Preise'),jdecode(''), jdecode('%2F17962%2F18070.html'), 'true',[],'',''],
		['PAGE','128037',jdecode('M%C3%84NNER'),jdecode(''), jdecode('%2F17962%2F128037.html'), 'true',[],'',''],
		['PAGE','18496',jdecode('Lageplan'),jdecode(''), jdecode('%2F17962%2F18496.html'), 'true',[],'',''],
		['PAGE','18461',jdecode('Anfahrt'),jdecode(''), jdecode('%2F17962%2F18461.html'), 'true',[],'',''],
		['PAGE','128312',jdecode('AGB+und+Ethik+Code'),jdecode(''), jdecode('%2F17962%2F128312.html'), 'true',[],'','']
	],'',''],
	['PAGE','32555',jdecode('PRAXIS+'),jdecode(''), jdecode('%2F32555%2Findex.html'), 'true',[ 
		['PAGE','19438',jdecode('Anwendung'),jdecode(''), jdecode('%2F32555%2F19438.html'), 'true',[],'',''],
		['PAGE','19886',jdecode('Einzel-Sitzung'),jdecode(''), jdecode('%2F32555%2F19886.html'), 'true',[],'',''],
		['PAGE','125908',jdecode('Preise'),jdecode(''), jdecode('%2F32555%2F125908.html'), 'true',[],'',''],
		['PAGE','32263',jdecode('Portrait'),jdecode(''), jdecode('%2F32555%2F32263.html'), 'true',[],'',''],
		['PAGE','19411',jdecode('Praxis'),jdecode(''), jdecode('%2F32555%2F19411.html'), 'true',[],'',''],
		['PAGE','31180',jdecode('TOUCH+FOR+HEALTH'),jdecode(''), jdecode('%2F32555%2F31180.html'), 'true',[],'',''],
		['PAGE','19913',jdecode('BRAIN+GYM'),jdecode(''), jdecode('%2F32555%2F19913.html'), 'true',[],'',''],
		['PAGE','127776',jdecode('LERNHILFEN'),jdecode(''), jdecode('%2F32555%2F127776.html'), 'true',[],'',''],
		['PAGE','19940',jdecode('BECKENBODEN'),jdecode(''), jdecode('%2F32555%2F19940.html'), 'true',[],'',''],
		['PAGE','125558',jdecode('PILATES-EINF%C3%9CHRUNG'),jdecode(''), jdecode('%2F32555%2F125558.html'), 'true',[],'',''],
		['PAGE','127959',jdecode('KURSE+2012'),jdecode(''), jdecode('%2F32555%2F127959.html'), 'true',[],'','']
	],'',''],
	['PAGE','82124',jdecode('KONTAKT'),jdecode(''), jdecode('%2F82124%2Findex.html'), 'true',[ 
		['PAGE','82672',jdecode('KONTAKT+%28Form+followup+page%29'),jdecode(''), jdecode('%2F82124%2F82672.html'), 'true',[],'','']
	],'',''],
	['PAGE','127589',jdecode('LINKS'),jdecode(''), jdecode('%2F127589.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='003399';
theSitetree.keyvisualId='1233';
theSitetree.keyvisualName='fitness.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='228';
theSitetree.contentColor='000000';
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: 			'Profile',
				paletteFamily: 	'003399',
				keyvisualId: 	'1233',
				keyvisualName: 	'fitness.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'228',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003399',
				b_color: 		'000066',
				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['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '4520',
internalId:  '1501',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '18461',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '18496',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['1009']=webappMappings['1009-6162242']={
webappId:    '1009',
documentId:  '82672',
internalId:  '6162242',
customField: 'isFollowupPage:true;documentId:82124;'
};
webappMappings['7008']=webappMappings['7008-739']={
webappId:    '7008',
documentId:  '82124',
internalId:  '739',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4520',
internalId:  '',
customField: '20110125-114722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17962',
internalId:  '',
customField: '20110204-160341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18016',
internalId:  '',
customField: '20111103-141245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18043',
internalId:  '',
customField: '20120214-085600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18097',
internalId:  '',
customField: '20111222-152857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18070',
internalId:  '',
customField: '20111103-141627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18496',
internalId:  '',
customField: '20070504-154239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18461',
internalId:  '',
customField: '20070504-154308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32555',
internalId:  '',
customField: '20091208-175911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19438',
internalId:  '',
customField: '20111012-171253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19886',
internalId:  '',
customField: '20070513-125602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125908',
internalId:  '',
customField: '20091208-175252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32263',
internalId:  '',
customField: '20110629-180323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19411',
internalId:  '',
customField: '20111012-171118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31180',
internalId:  '',
customField: '20091231-132843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19913',
internalId:  '',
customField: '20091231-133100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19940',
internalId:  '',
customField: '20110629-174728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125558',
internalId:  '',
customField: '20110514-130813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82124',
internalId:  '',
customField: '20070331-161257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82672',
internalId:  '',
customField: '20060103-091516'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4520',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128312',
internalId:  '',
customField: '20110214-154142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128037',
internalId:  '',
customField: '20111103-141809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127589',
internalId:  '',
customField: '20110907-142219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127776',
internalId:  '',
customField: '20090506-151419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127959',
internalId:  '',
customField: '20111103-142011'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX3CR';
var companyName   = 'BODY+GAME+und+IK+KINESIOLOGIE';
var htmlTitle	  = 'Bodygame';
var metaKeywords  = 'GymnastikBodygameKinesiologieintegrative+KinesiologieBewegung';
var metaContents  = '';
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();
};

