/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','552',jdecode('Der+Club+%2F+Jahresprogramm'),jdecode(''), jdecode('%2F552%2Findex.html'), 'true',[ 
		['PAGE','594',jdecode('Der+Vorstand'),jdecode(''), jdecode('%2F552%2F594.html'), 'true',[],'',''],
		['PAGE','130801',jdecode('Jahresprogramm'),jdecode(''), jdecode('%2F552%2F130801.html'), 'true',[],'','']
	],'',''],
	['PAGE','3622',jdecode('News'),jdecode(''), jdecode('%2F3622.html'), 'true',[],'',''],
	['PAGE','94622',jdecode('Archiv'),jdecode(''), jdecode('%2F94622.html'), 'true',[],'',''],
	['PAGE','16801',jdecode('Fotos'),jdecode(''), jdecode('%2F16801.html'), 'true',[],'',''],
	['PAGE','636',jdecode('Regatten'),jdecode(''), jdecode('%2F636%2Findex.html'), 'true',[ 
		['PAGE','93001',jdecode('RVB+Cup1'),jdecode(''), jdecode('%2F636%2F93001.html'), 'true',[],'',''],
		['PAGE','103901',jdecode('Alp+Cup'),jdecode(''), jdecode('%2F636%2F103901.html'), 'true',[],'',''],
		['PAGE','94601',jdecode('VC+Cup'),jdecode(''), jdecode('%2F636%2F94601.html'), 'true',[],'',''],
		['PAGE','109401',jdecode('SM+2009'),jdecode(''), jdecode('%2F636%2F109401.html'), 'true',[],'',''],
		['PAGE','112401',jdecode('Clubregatta'),jdecode(''), jdecode('%2F636%2F112401.html'), 'true',[],'',''],
		['PAGE','107901',jdecode('Segelanwesiung'),jdecode(''), jdecode('%2F636%2F107901.html'), 'true',[],'',''],
		['PAGE','678',jdecode('Resultate'),jdecode(''), jdecode('%2F636%2F678.html'), 'true',[],'',''],
		['PAGE','13801',jdecode('Unsere+Regattenleiter'),jdecode(''), jdecode('%2F636%2F13801.html'), 'true',[],'','']
	],'',''],
	['PAGE','4064',jdecode('Junioren'),jdecode(''), jdecode('%2F4064%2Findex.html'), 'true',[ 
		['PAGE','55601',jdecode('Jahresprogramm'),jdecode(''), jdecode('%2F4064%2F55601.html'), 'true',[],'',''],
		['PAGE','55622',jdecode('Obmann+und+Trainer'),jdecode(''), jdecode('%2F4064%2F55622.html'), 'true',[],'',''],
		['PAGE','58201',jdecode('Fotos'),jdecode(''), jdecode('%2F4064%2F58201.html'), 'true',[],'',''],
		['PAGE','55643',jdecode('Mitwirkende'),jdecode(''), jdecode('%2F4064%2F55643.html'), 'true',[],'',''],
		['PAGE','55685',jdecode('Kontakt'),jdecode(''), jdecode('%2F4064%2F55685.html'), 'true',[],'','']
	],'',''],
	['PAGE','47301',jdecode('Sicherheitskonzept'),jdecode(''), jdecode('%2F47301.html'), 'true',[],'',''],
	['PAGE','4043',jdecode('T%C3%B6rnberichte'),jdecode(''), jdecode('%2F4043.html'), 'true',[],'',''],
	['PAGE','4106',jdecode('Links'),jdecode(''), jdecode('%2F4106.html'), 'true',[],'',''],
	['PAGE','4085',jdecode('Sponsoren+%26+G%C3%B6nner'),jdecode(''), jdecode('%2F4085.html'), 'true',[],'',''],
	['PAGE','43201',jdecode('Anfahrt+und+Lageplan'),jdecode(''), jdecode('%2F43201%2Findex.html'), 'true',[ 
		['PAGE','90001',jdecode('Anfahrt'),jdecode(''), jdecode('%2F43201%2F90001.html'), 'true',[],'',''],
		['PAGE','90022',jdecode('Lageplan'),jdecode(''), jdecode('%2F43201%2F90022.html'), 'true',[],'','']
	],'',''],
	['PAGE','14901',jdecode('Kontakt'),jdecode(''), jdecode('%2F14901.html'), 'true',[],'','']];
var siteelementCount=30;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='0000A0';
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: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				contentColor: 	'0000A0',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-1031']={
webappId:    '7008',
documentId:  '14901',
internalId:  '1031',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20090414-082954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130801',
internalId:  '',
customField: '20110209-192109'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20110314-071350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20111121-143938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3622',
internalId:  '',
customField: '20090902-135148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94622',
internalId:  '',
customField: '20091210-104859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20100628-141522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20120129-133135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93001',
internalId:  '',
customField: '20110524-100511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103901',
internalId:  '',
customField: '20110726-055151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94601',
internalId:  '',
customField: '20100222-080145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109401',
internalId:  '',
customField: '20091215-164736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107901',
internalId:  '',
customField: '20090723-072921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20100510-071338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20110209-194940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4064',
internalId:  '',
customField: '20110830-062145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55601',
internalId:  '',
customField: '20110209-192705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55622',
internalId:  '',
customField: '20110209-195316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58201',
internalId:  '',
customField: '20111010-201543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55643',
internalId:  '',
customField: '20080503-174458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55685',
internalId:  '',
customField: '20080607-153517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47301',
internalId:  '',
customField: '20090206-092655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4043',
internalId:  '',
customField: '20090601-095954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4106',
internalId:  '',
customField: '20111128-065357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4085',
internalId:  '',
customField: '20110601-165054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43201',
internalId:  '',
customField: '20090128-182549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90001',
internalId:  '',
customField: '20090128-185610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90022',
internalId:  '',
customField: '20090128-183528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20071226-161543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112401',
internalId:  '',
customField: '20090828-115756'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHOPT0IN3NRH';
var companyName   = '';
var htmlTitle	  = '';
var metaKeywords  = 'Segeln%2C+Regattieren%2C+Brunnen%2C+Regattaverein%2C+Segelklub%2C+Segelclub%2C+Urnersee%2C+Vierwaldst%C3%A4ttersee%2C+Regattaverein+Brunnen%2C+RVB';
var metaContents  = 'Segeln%2C+Regattieren%2C+Brunnen%2C+Regattaverein%2C+Segelklub%2C+Segelclub%2C+Urnersee%2C+Vierwaldst%C3%A4ttersee%2C+Regattaverein+Brunnen%2C+RVB';
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();
};

