/* [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','4577',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F4577%2Findex.html'), 'true',[ 
		['PAGE','39027',jdecode('Vorstand+%26+Mitglieder'),jdecode(''), jdecode('%2F4577%2F39027.html'), 'true',[],'',''],
		['PAGE','38412',jdecode('Chorleitung'),jdecode(''), jdecode('%2F4577%2F38412.html'), 'true',[],'',''],
		['PAGE','55801',jdecode('Blackriver+Singers'),jdecode(''), jdecode('%2F4577%2F55801.html'), 'true',[],'',''],
		['PAGE','45601',jdecode('Proben'),jdecode(''), jdecode('%2F4577%2F45601.html'), 'true',[],'','']
	],'',''],
	['PAGE','140401',jdecode('Aktuelles+Verein'),jdecode(''), jdecode('%2F140401%2Findex.html'), 'true',[ 
		['PAGE','4604',jdecode('Jahresprogramm'),jdecode(''), jdecode('%2F140401%2F4604.html'), 'true',[],'','']
	],'',''],
	['PAGE','83401',jdecode('Aktuelles+Mitglieder'),jdecode(''), jdecode('%2F83401.html'), 'true',[],'',''],
	['PAGE','110201',jdecode('Abendunterhaltungen'),jdecode(''), jdecode('%2F110201%2Findex.html'), 'true',[ 
		['PAGE','69901',jdecode('Vorverkauf'),jdecode(''), jdecode('%2F110201%2F69901.html'), 'true',[],'',''],
		['PAGE','111701',jdecode('2011%2F2012'),jdecode(''), jdecode('%2F110201%2F111701.html'), 'true',[],'',''],
		['PAGE','110501',jdecode('2009%2F2010'),jdecode(''), jdecode('%2F110201%2F110501.html'), 'true',[],'',''],
		['PAGE','112401',jdecode('2007%2F2008'),jdecode(''), jdecode('%2F110201%2F112401.html'), 'true',[],'',''],
		['PAGE','68101',jdecode('Team'),jdecode(''), jdecode('%2F110201%2F68101.html'), 'true',[],'','']
	],'',''],
	['PAGE','127801',jdecode('Archiv+2011'),jdecode(''), jdecode('%2F127801.html'), 'true',[],'',''],
	['PAGE','107001',jdecode('Archiv+2006-10'),jdecode(''), jdecode('%2F107001%2Findex.html'), 'true',[ 
		['PAGE','125101',jdecode('Archiv+2010'),jdecode(''), jdecode('%2F107001%2F125101.html'), 'true',[],'',''],
		['PAGE','33701',jdecode('Archiv+2009'),jdecode(''), jdecode('%2F107001%2F33701.html'), 'true',[],'',''],
		['PAGE','96701',jdecode('Archiv+2008'),jdecode(''), jdecode('%2F107001%2F96701.html'), 'true',[],'',''],
		['PAGE','75801',jdecode('Archiv+2007'),jdecode(''), jdecode('%2F107001%2F75801.html'), 'true',[],'',''],
		['PAGE','10302',jdecode('Archiv+2006'),jdecode(''), jdecode('%2F107001%2F10302.html'), 'true',[],'','']
	],'',''],
	['PAGE','53101',jdecode('Archiv+%22alt%22'),jdecode(''), jdecode('%2F53101.html'), 'true',[],'',''],
	['PAGE','7665',jdecode('F%C3%BCr+Mitglieder'),jdecode(''), jdecode('%2F7665%2Findex.html'), 'true',[ 
		['PAGE','5301',jdecode('Probenplan'),jdecode(''), jdecode('%2F7665%2F5301.html'), 'true',[],'',''],
		['PAGE','104201',jdecode('Telefon-Alarmliste'),jdecode(''), jdecode('%2F7665%2F104201.html'), 'true',[],'','']
	],'',''],
	['PAGE','39734',jdecode('Musik+%26+Chor+Potpurri'),jdecode(''), jdecode('%2F39734%2Findex.html'), 'true',[ 
		['PAGE','43071',jdecode('Diverse+Veranstaltungen'),jdecode(''), jdecode('%2F39734%2F43071.html'), 'true',[],'',''],
		['PAGE','64501',jdecode('Singen+allgemein'),jdecode(''), jdecode('%2F39734%2F64501.html'), 'true',[],'',''],
		['PAGE','130801',jdecode('Musik-+und+Notenkunde'),jdecode(''), jdecode('%2F39734%2F130801.html'), 'true',[],'',''],
		['PAGE','50301',jdecode('SGF+08'),jdecode(''), jdecode('%2F39734%2F50301.html'), 'true',[],'','']
	],'',''],
	['PAGE','48201',jdecode('G%C3%B6nnerliste'),jdecode(''), jdecode('%2F48201.html'), 'true',[],'',''],
	['PAGE','39177',jdecode('Kontakt'),jdecode(''), jdecode('%2F39177%2Findex.html'), 'true',[ 
		['PAGE','39234',jdecode('Formular+%28Folgeseite%29'),jdecode(''), jdecode('%2F39177%2F39234.html'), 'false',[],'',''],
		['PAGE','49501',jdecode('Anfahrt'),jdecode(''), jdecode('%2F39177%2F49501.html'), 'true',[],'',''],
		['PAGE','49001',jdecode('Ihr+Weg+zu+uns'),jdecode(''), jdecode('%2F39177%2F49001.html'), 'true',[],'','']
	],'','']];
var siteelementCount=36;
theSitetree.topTemplateName='Sober';
theSitetree.paletteFamily='EFD30E';
theSitetree.keyvisualId='3478';
theSitetree.keyvisualName='kv_3478.jpg';
theSitetree.fontsetId='10757';
theSitetree.graphicsetId='10786';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F1FECE';
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: 			'Sober',
				paletteFamily: 	'EFD30E',
				keyvisualId: 	'3478',
				keyvisualName: 	'kv_3478.jpg',
				fontsetId: 		'10757',
				graphicsetId: 	'10786',
				contentColor: 	'000000',
				contentBGColor: 'F1FECE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'EFD30E',
				e_color: 		'707070',
				f_color: 		'979696',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4520',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111701',
internalId:  '',
customField: '20120112-191715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110501',
internalId:  '',
customField: '20110313-112025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110201',
internalId:  '',
customField: '20120112-185116'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '49001',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '49501',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48201',
internalId:  '',
customField: '20100119-055603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4520',
internalId:  '',
customField: '20080405-092850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4577',
internalId:  '',
customField: '20111128-184605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39027',
internalId:  '',
customField: '20120112-183617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38412',
internalId:  '',
customField: '20120112-184440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55801',
internalId:  '',
customField: '20110313-105732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45601',
internalId:  '',
customField: '20120112-062059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33701',
internalId:  '',
customField: '20101018-190351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4604',
internalId:  '',
customField: '20120114-083420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83401',
internalId:  '',
customField: '20120114-085700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96701',
internalId:  '',
customField: '20090805-153531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75801',
internalId:  '',
customField: '20090805-143520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10302',
internalId:  '',
customField: '20070108-062034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53101',
internalId:  '',
customField: '20071203-064358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112401',
internalId:  '',
customField: '20100513-092931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68101',
internalId:  '',
customField: '20110313-111037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69901',
internalId:  '',
customField: '20120112-185422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7665',
internalId:  '',
customField: '20120114-090630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20120114-133105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104201',
internalId:  '',
customField: '20100513-103944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39734',
internalId:  '',
customField: '20110313-195822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43071',
internalId:  '',
customField: '20110827-095647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64501',
internalId:  '',
customField: '20110313-200510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50301',
internalId:  '',
customField: '20090805-153458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39177',
internalId:  '',
customField: '20080405-104312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39234',
internalId:  '',
customField: '20061023-231214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49501',
internalId:  '',
customField: '20061128-085600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49001',
internalId:  '',
customField: '20061128-085623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107001',
internalId:  '',
customField: '20090805-150657'
};
webappMappings['7008']=webappMappings['7008-3457']={
webappId:    '7008',
documentId:  '39177',
internalId:  '3457',
customField: 'language:de;country:CH;'
};
webappMappings['1501']=webappMappings['1501-222076']={
webappId:    '1501',
documentId:  '4520',
internalId:  '222076',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125101',
internalId:  '',
customField: '20110313-192301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127801',
internalId:  '',
customField: '20110320-095121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130801',
internalId:  '',
customField: '20110313-201853'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '140401',
internalId:  '-',
customField: '20120114-082751'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXS6A';
var companyName   = 'M%C3%A4nnerchor+Schwerzenbach';
var htmlTitle	  = 'Maennerchor+Schwerzenbach';
var metaKeywords  = 'M%C3%A4nnerchor+Schwerzenbach+Chor+Verein+Gesang+Singen';
var metaContents  = 'M%C3%A4nnerchor+Veranstaltungskalender+Chor+Bezirk+Uster+Schwerzenbach';
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();
};

