/* [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','452',jdecode('NEWS'),jdecode(''), jdecode('%2F452.html'), 'true',[],'',''],
	['PAGE','6422',jdecode('TEAM'),jdecode(''), jdecode('%2F6422%2Findex.html'), 'true',[ 
		['PAGE','7901',jdecode('Schlagzeug'),jdecode(''), jdecode('%2F6422%2F7901.html'), 'true',[],'',''],
		['PAGE','10301',jdecode('Pauken'),jdecode(''), jdecode('%2F6422%2F10301.html'), 'true',[],'',''],
		['PAGE','10322',jdecode('Bl%C3%B6ck'),jdecode(''), jdecode('%2F6422%2F10322.html'), 'true',[],'',''],
		['PAGE','7922',jdecode('Trompeten'),jdecode(''), jdecode('%2F6422%2F7922.html'), 'true',[],'',''],
		['PAGE','7943',jdecode('Posaunen'),jdecode(''), jdecode('%2F6422%2F7943.html'), 'true',[],'',''],
		['PAGE','7964',jdecode('Horn'),jdecode(''), jdecode('%2F6422%2F7964.html'), 'true',[],'',''],
		['PAGE','7985',jdecode('Susaphon'),jdecode(''), jdecode('%2F6422%2F7985.html'), 'true',[],'',''],
		['PAGE','91412',jdecode('Bass-Triangel'),jdecode(''), jdecode('%2F6422%2F91412.html'), 'true',[],'','']
	],'',''],
	['PAGE','6443',jdecode('VORSTAND'),jdecode(''), jdecode('%2F6443%2Findex.html'), 'true',[ 
		['PAGE','29401',jdecode('Kommissionen'),jdecode(''), jdecode('%2F6443%2F29401.html'), 'true',[],'','']
	],'',''],
	['PAGE','97533',jdecode('TOURENPLAN+2012'),jdecode(''), jdecode('%2F97533%2Findex.html'), 'true',[ 
		['PAGE','97512',jdecode('Jahresprogramm'),jdecode(''), jdecode('%2F97533%2F97512.html'), 'true',[],'','']
	],'',''],
	['PAGE','6901',jdecode('FOTOS'),jdecode(''), jdecode('%2F6901.html'), 'true',[],'',''],
	['PAGE','6464',jdecode('REPERTOIRE'),jdecode(''), jdecode('%2F6464.html'), 'true',[],'',''],
	['PAGE','515',jdecode('SCH%C3%9C%C3%9CRBALL'),jdecode(''), jdecode('%2F515%2Findex.html'), 'true',[ 
		['PAGE','6485',jdecode('News'),jdecode(''), jdecode('%2F515%2F6485.html'), 'true',[],'',''],
		['PAGE','6506',jdecode('Info%26%23x27%3Bs'),jdecode(''), jdecode('%2F515%2F6506.html'), 'true',[],'',''],
		['PAGE','29422',jdecode('Sch%C3%BC%C3%BCrball-Kommission'),jdecode(''), jdecode('%2F515%2F29422.html'), 'true',[],'',''],
		['PAGE','6527',jdecode('Fotos'),jdecode(''), jdecode('%2F515%2F6527.html'), 'true',[],'','']
	],'',''],
	['PAGE','66612',jdecode('G%C3%84STEBUCH'),jdecode(''), jdecode('%2F66612.html'), 'true',[],'',''],
	['PAGE','84412',jdecode('SPONSOREN'),jdecode(''), jdecode('%2F84412.html'), 'true',[],'',''],
	['PAGE','536',jdecode('KONTAKT'),jdecode(''), jdecode('%2F536%2Findex.html'), 'true',[ 
		['PAGE','5301',jdecode('Neugugger'),jdecode(''), jdecode('%2F536%2F5301.html'), 'true',[],'','']
	],'',''],
	['PAGE','43301',jdecode('LINKS'),jdecode(''), jdecode('%2F43301%2Findex.html'), 'true',[ 
		['PAGE','43322',jdecode('Diversi+Links'),jdecode(''), jdecode('%2F43301%2F43322.html'), 'true',[],'','']
	],'','']];
var siteelementCount=28;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
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: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				a_color: 		'5E5E5E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84412',
internalId:  '',
customField: '20100501-181215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97533',
internalId:  '',
customField: '20120122-163127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91412',
internalId:  '',
customField: '20100216-141209'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20120128-113418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20110305-134614'
};
webappMappings['1002']=webappMappings['1002-66612abw0x0ine4ei']={
webappId:    '1002',
documentId:  '66612',
internalId:  '66612abw0x0ine4ei',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6422',
internalId:  '',
customField: '20120128-113606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20120122-161622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20120122-161716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10322',
internalId:  '',
customField: '20120129-185844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7922',
internalId:  '',
customField: '20120129-185818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7943',
internalId:  '',
customField: '20120129-185922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7964',
internalId:  '',
customField: '20120129-190007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7985',
internalId:  '',
customField: '20120128-114046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6443',
internalId:  '',
customField: '20120122-163025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20110919-171240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20120122-161137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6464',
internalId:  '',
customField: '20110216-173011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20120129-190928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6485',
internalId:  '',
customField: '20120103-130204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6506',
internalId:  '',
customField: '20120103-130253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29422',
internalId:  '',
customField: '20120103-130316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6527',
internalId:  '',
customField: '20100914-164932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66612',
internalId:  '',
customField: '20090421-165849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97512',
internalId:  '',
customField: '20110919-171709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20110919-171515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20100515-232748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43301',
internalId:  '',
customField: '20090212-175629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43322',
internalId:  '',
customField: '20090421-170338'
};
webappMappings['1501']=webappMappings['1501-22972103']={
webappId:    '1501',
documentId:  '401',
internalId:  '22972103',
customField: '1501'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INE4EI';
var companyName   = 'Guggemusig+Sumpfer-Stilzli';
var htmlTitle	  = '';
var metaKeywords  = 'Sch%C3%BC%C3%BCrball';
var metaContents  = 'Sch%C3%BC%C3%BCrball%0D%0A';
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();
};

