/* [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','4801',jdecode('Home'),jdecode(''), jdecode('%2F4801.html'), 'true',[],'',''],
	['PAGE','4852',jdecode('Aquatraining'),jdecode(''), jdecode('%2F4852%2Findex.html'), 'true',[ 
		['PAGE','4873',jdecode('Kurse'),jdecode(''), jdecode('%2F4852%2F4873.html'), 'true',[],'',''],
		['PAGE','27501',jdecode('Kursdaten+%26+-Preise'),jdecode(''), jdecode('%2F4852%2F27501.html'), 'true',[],'',''],
		['PAGE','27522',jdecode('Schnupper-Angebot'),jdecode(''), jdecode('%2F4852%2F27522.html'), 'true',[],'',''],
		['PAGE','27801',jdecode('Privatlektionen'),jdecode(''), jdecode('%2F4852%2F27801.html'), 'true',[],'',''],
		['PAGE','33201',jdecode('Wirkung+%26+Infos'),jdecode(''), jdecode('%2F4852%2F33201.html'), 'true',[],'','']
	],'',''],
	['PAGE','4894',jdecode('Crawl-Kurse'),jdecode(''), jdecode('%2F4894%2Findex.html'), 'true',[ 
		['PAGE','4915',jdecode('Kurse'),jdecode(''), jdecode('%2F4894%2F4915.html'), 'true',[],'',''],
		['PAGE','27543',jdecode('Kursdaten+%26+-Preise'),jdecode(''), jdecode('%2F4894%2F27543.html'), 'true',[],'','']
	],'',''],
	['PAGE','4936',jdecode('%C3%9Cber+uns'),jdecode(''), jdecode('%2F4936%2Findex.html'), 'true',[ 
		['PAGE','34001',jdecode('Jeannette+Furler'),jdecode(''), jdecode('%2F4936%2F34001.html'), 'true',[],'',''],
		['PAGE','34022',jdecode('Kursleiterinnen'),jdecode(''), jdecode('%2F4936%2F34022.html'), 'true',[],'','']
	],'',''],
	['PAGE','4957',jdecode('Kontakt'),jdecode(''), jdecode('%2F4957.html'), 'true',[],'',''],
	['PAGE','4978',jdecode('Anmeldung'),jdecode(''), jdecode('%2F4978.html'), 'true',[],'',''],
	['PAGE','27564',jdecode('Vertragsbedingungen'),jdecode(''), jdecode('%2F27564.html'), 'true',[],'',''],
	['PAGE','30301',jdecode('News'),jdecode(''), jdecode('%2F30301.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Flyer';
theSitetree.paletteFamily='000066';
theSitetree.keyvisualId='540';
theSitetree.keyvisualName='schwimmen.jpg';
theSitetree.fontsetId='72';
theSitetree.graphicsetId='69';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='666699';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21Y'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Flyer',
				paletteFamily: 	'000066',
				keyvisualId: 	'540',
				keyvisualName: 	'schwimmen.jpg',
				fontsetId: 		'72',
				graphicsetId: 	'69',
				contentColor: 	'FFFFFF',
				contentBGColor: '666699',
				a_color: 		'000066',
				b_color: 		'CCCCCC',
				c_color: 		'000000',
				d_color: 		'666699',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-4816']={
webappId:    '7008',
documentId:  '4978',
internalId:  '4816',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20110915-064029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4852',
internalId:  '',
customField: '20111108-180401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4873',
internalId:  '',
customField: '20120112-092950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4894',
internalId:  '',
customField: '20110918-194825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4915',
internalId:  '',
customField: '20110920-073732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4936',
internalId:  '',
customField: '20110915-062540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4957',
internalId:  '',
customField: '20120112-093645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4978',
internalId:  '',
customField: '20110707-203250'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27801',
internalId:  '',
customField: '20111108-201002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20120124-061127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27522',
internalId:  '',
customField: '20111108-200941'
};
webappMappings['7050']=webappMappings['7050-415']={
webappId:    '7050',
documentId:  '30301',
internalId:  '415',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27543',
internalId:  '',
customField: '20111007-185601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27564',
internalId:  '',
customField: '20120124-060615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20110630-183009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33201',
internalId:  '',
customField: '20111108-201023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34001',
internalId:  '',
customField: '20120112-093544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34022',
internalId:  '',
customField: '20120112-093345'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHP340INV2UM';
var companyName   = '';
var htmlTitle	  = 'www.get-wet.ch%3A+Aquatraining+%26+Crawl-Kurse';
var metaKeywords  = 'get+wet%2C+aqua-fit%2C+aquafit%2C+aqua-gym%2C+aquagym%2C+Crawl%2C+crawlen+Kurse%2C+schwimmen%2C+wasser-fitness%2C+Kraftraining%2C+Ausdauer%2C+Herzkreislauftraining%2C+gelenkschonend+trainieren%2C+Fitness';
var metaContents  = 'get+wet+organisiert+Aqua-Gym-+und+Aqua-Fit+Kurse+f%C3%BCr+Teilnehmende+jeden+Alters+im+Raum+Z%C3%BCrich%3B+zudem+Crawl-Basic-Kurse+f%C3%BCr+alle%2C+die+bereits+schwimmen+k%C3%B6nnen.';
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();
};

