/* [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','106301',jdecode('Home+-+Programm+-+News'),jdecode(''), jdecode('%2F106301%2Findex.html'), 'true',[ 
		['PAGE','119101',jdecode('FlowYoga'),jdecode(''), jdecode('%2F106301%2F119101.html'), 'true',[],'',''],
		['PAGE','117201',jdecode('Seil-BodyToning'),jdecode(''), jdecode('%2F106301%2F117201.html'), 'true',[],'',''],
		['PAGE','120201',jdecode('Yoga+FreeFlow'),jdecode(''), jdecode('%2F106301%2F120201.html'), 'true',[],'',''],
		['PAGE','120222',jdecode('Mind+Training'),jdecode(''), jdecode('%2F106301%2F120222.html'), 'true',[],'',''],
		['PAGE','125501',jdecode('Workshops+%26+Events'),jdecode(''), jdecode('%2F106301%2F125501.html'), 'true',[],'',''],
		['PAGE','125522',jdecode('Teacher+Training'),jdecode(''), jdecode('%2F106301%2F125522.html'), 'true',[],'',''],
		['PAGE','124701',jdecode('Privatlektionen+%2F+Private+Training'),jdecode(''), jdecode('%2F106301%2F124701.html'), 'true',[],'',''],
		['PAGE','125543',jdecode('Training+f%C3%BCr+Firmen'),jdecode(''), jdecode('%2F106301%2F125543.html'), 'true',[],'','']
	],'',''],
	['PAGE','46443',jdecode('Wochenplan+%2F+Schedule'),jdecode(''), jdecode('%2F46443.html'), 'true',[],'',''],
	['PAGE','8977',jdecode('Preise+%2F+Prices'),jdecode(''), jdecode('%2F8977.html'), 'true',[],'',''],
	['PAGE','46422',jdecode('Biografie+%2F+Biography'),jdecode(''), jdecode('%2F46422.html'), 'true',[],'',''],
	['PAGE','46401',jdecode('Studio'),jdecode(''), jdecode('%2F46401.html'), 'true',[],'',''],
	['PAGE','99101',jdecode('+Links'),jdecode(''), jdecode('%2F99101.html'), 'true',[],'',''],
	['PAGE','7737',jdecode('Guestbook%21%21'),jdecode(''), jdecode('%2F7737%2Findex.html'), 'true',[ 
		['PAGE','7738',jdecode('Eintr%C3%A4ge+%2F+Entries'),jdecode(''), jdecode('%2F7737%2F7738.html'), 'false',[],'','']
	],'',''],
	['PAGE','10082',jdecode('Kontakt+%2F+Contact'),jdecode(''), jdecode('%2F10082.html'), 'true',[],'',''],
	['PAGE','7875',jdecode('Anfahrt+%2F+Directions'),jdecode(''), jdecode('%2F7875.html'), 'true',[],'',''],
	['PAGE','7845',jdecode('Routenplaner'),jdecode(''), jdecode('%2F7845.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10892';
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: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '106301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106301',
internalId:  '',
customField: '20120131-123636'
};
webappMappings['1002']=webappMappings['1002-7737ABW0X0INXXHP']={
webappId:    '1002',
documentId:  '7737',
internalId:  '7737ABW0X0INXXHP',
customField: 'icq=false'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '7845',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '7875',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117201',
internalId:  '',
customField: '20120130-162807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120222',
internalId:  '',
customField: '20120110-154725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124701',
internalId:  '',
customField: '20111011-231605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125501',
internalId:  '',
customField: '20111011-231503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125543',
internalId:  '',
customField: '20111011-232052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120201',
internalId:  '',
customField: '20120110-155432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125522',
internalId:  '',
customField: '20111011-231532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8977',
internalId:  '',
customField: '20111011-232143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99101',
internalId:  '',
customField: '20111011-232245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7737',
internalId:  '',
customField: '20111011-232309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7738',
internalId:  '',
customField: '20060418-210313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10082',
internalId:  '',
customField: '20111011-232338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7875',
internalId:  '',
customField: '20111011-232410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7845',
internalId:  '',
customField: '20111011-232437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119101',
internalId:  '',
customField: '20120110-155338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46401',
internalId:  '',
customField: '20111011-232216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46422',
internalId:  '',
customField: '20111011-135124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46443',
internalId:  '',
customField: '20120130-162842'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXHP';
var companyName   = 'Practical+Wellness+Body+%26+Mind+Studio';
var htmlTitle	  = 'Yoga+Studio+Limmattal+-+Flow+Yoga';
var metaKeywords  = 'Hatha+-+Yoga+Release+-+Yoga+Flow+-+Yoga+Power+-+Yoga+Yoga+Spreitenbach+Yoga+Limmattal+Yoga+Z%C3%BCrich+Yoga+Aargau+Meditation+Erholung+Fitness+Yoga+Schweiz+Yoga+Switzerland+Yoga+Ausbildung+Yogalehrer+Yogalehrerausbildung+Yogaausbildung+-+Meditation+Yoga+-+Atemtechniken+Yoga';
var metaContents  = 'Hatha+-+Yoga+Release+-+Yoga+Flow+-+Yoga+Power+-+Yoga+-+Meditation+-+Atemtechniken+-+Yoga-Ausbildungen+-+';
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();
};

