/* [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(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','121101',jdecode('Kurse'),jdecode(''), jdecode('%2F121101%2Findex.html'), 'true',[ 
		['PAGE','121301',jdecode('Afro-Tanz'),jdecode(''), jdecode('%2F121101%2F121301.html'), 'true',[],'',''],
		['PAGE','121322',jdecode('Afro-Fit'),jdecode(''), jdecode('%2F121101%2F121322.html'), 'true',[],'','']
	],'',''],
	['PAGE','121122',jdecode('Workshops'),jdecode(''), jdecode('%2F121122%2Findex.html'), 'true',[ 
		['PAGE','121343',jdecode('Aktuell'),jdecode(''), jdecode('%2F121122%2F121343.html'), 'true',[],'',''],
		['PAGE','121364',jdecode('Archiv'),jdecode(''), jdecode('%2F121122%2F121364.html'), 'true',[],'','']
	],'',''],
	['PAGE','121143',jdecode('Events'),jdecode(''), jdecode('%2F121143.html'), 'true',[],'',''],
	['PAGE','452',jdecode('%C3%9Cber+mich'),jdecode(''), jdecode('%2F452%2Findex.html'), 'true',[ 
		['PAGE','45101',jdecode('Cr%C3%A9ations'),jdecode(''), jdecode('%2F452%2F45101.html'), 'true',[],'','']
	],'',''],
	['PAGE','121185',jdecode('Links'),jdecode(''), jdecode('%2F121185.html'), 'true',[],'',''],
	['PAGE','121206',jdecode('Kontaktformular'),jdecode(''), jdecode('%2F121206.html'), 'true',[],'',''],
	['PAGE','125801',jdecode('Gallery'),jdecode(''), jdecode('%2F125801.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Verve';
theSitetree.paletteFamily='78D949';
theSitetree.keyvisualId='8400';
theSitetree.keyvisualName='kv_8400.jpg';
theSitetree.fontsetId='17072';
theSitetree.graphicsetId='12441';
theSitetree.contentColor='929191';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Verve',
				paletteFamily: 	'78D949',
				keyvisualId: 	'8400',
				keyvisualName: 	'kv_8400.jpg',
				fontsetId: 		'17072',
				graphicsetId: 	'12441',
				contentColor: 	'929191',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20111025-141039'
};
webappMappings['7008']=webappMappings['7008-4587']={
webappId:    '7008',
documentId:  '121206',
internalId:  '4587',
customField: 'language:de;country:CH;'
};
webappMappings['1501']=webappMappings['1501-19156433']={
webappId:    '1501',
documentId:  '401',
internalId:  '19156433',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-de282be9500b54f7d199ac677bc68427']={
webappId:    '7060',
documentId:  '125801',
internalId:  'de282be9500b54f7d199ac677bc68427',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45101',
internalId:  '',
customField: '20110420-212701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20120108-003324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121101',
internalId:  '',
customField: '20110420-135801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121301',
internalId:  '',
customField: '20120130-102410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121322',
internalId:  '',
customField: '20120130-102045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121122',
internalId:  '',
customField: '20110420-140340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121343',
internalId:  '',
customField: '20120130-093334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121364',
internalId:  '',
customField: '20120122-194247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121143',
internalId:  '',
customField: '20120205-135919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125801',
internalId:  '',
customField: '20110421-213310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121185',
internalId:  '',
customField: '20111106-141937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121206',
internalId:  '',
customField: '20110420-152631'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0INEFT6';
var companyName   = 'Leben+ist+Tanz%2C+Afro-Tanz+ist+Freude+pur%21';
var htmlTitle	  = 'Tanzprojekte+-+Afrikanischer+Tanz+und+Afro-Fit';
var metaKeywords  = 'Afrika+Afrikanisch+Afro+Bewegung+Tanz+Fitness+Sportnacht+Sylvia+Mograbi+Richard+Kabore+Norma+Claire+Drissa+Sanon+Christian+Kambou+Njamy+Sitson+Alpjen+Wallis';
var metaContents  = 'In+der+Welt+meiner+afrikanischer+Tanzstile+kannst+du+in+meinen+Afro-Tanzkursen+tanzen+lernen+und+in+vielen+Workshops+mit+internationalen+Dozenten+eintauchen+in+die+Vielseitigkeit+des+Afro-+und+zeitgen%C3%B6ssischen+Tanzes.';
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();
};

