/* [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','4504',jdecode('Home'),jdecode(''), jdecode('%2F4504.html'), 'true',[],'',''],
	['PAGE','648480',jdecode('Vorstand+-+Aufgaben'),jdecode(''), jdecode('%2F648480.html'), 'true',[],'',''],
	['PAGE','659880',jdecode('Veteranen+aktive'),jdecode(''), jdecode('%2F659880.html'), 'true',[],'',''],
	['PAGE','304347',jdecode('Mitgliederliste'),jdecode(''), jdecode('%2F304347.html'), 'true',[],'',''],
	['PAGE','4669',jdecode('Termine%2FAbsenzen'),jdecode(''), jdecode('%2F4669.html'), 'true',[],'',''],
	['PAGE','650080',jdecode('Notenmaterial'),jdecode(''), jdecode('%2F650080.html'), 'true',[],'',''],
	['PAGE','4642',jdecode('Links+u.+Wetter'),jdecode(''), jdecode('%2F4642.html'), 'true',[],'',''],
	['PAGE','486380',jdecode('Dok.+Mitglieder'),jdecode(''), jdecode('%2F486380.html'), 'true',[],'',''],
	['PAGE','4696',jdecode('Kontakt'),jdecode(''), jdecode('%2F4696.html'), 'true',[],'',''],
	['PAGE','483980',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F483980.html'), 'true',[],'',''],
	['PAGE','470480',jdecode('Archiv'),jdecode(''), jdecode('%2F470480%2Findex.html'), 'true',[ 
		['PAGE','817491',jdecode('Wetten+dass....18.6.2011'),jdecode(''), jdecode('%2F470480%2F817491.html'), 'true',[],'',''],
		['PAGE','470580',jdecode('Baumgartenfeste'),jdecode(''), jdecode('%2F470480%2F470580.html'), 'true',[],'',''],
		['PAGE','471343',jdecode('Ehrungen%2FFeste'),jdecode(''), jdecode('%2F470480%2F471343.html'), 'true',[],'',''],
		['PAGE','471280',jdecode('Herbstkonzerte'),jdecode(''), jdecode('%2F470480%2F471280.html'), 'true',[],'',''],
		['PAGE','471480',jdecode('Jahreskonzerte'),jdecode(''), jdecode('%2F470480%2F471480.html'), 'true',[],'',''],
		['PAGE','471301',jdecode('Musikreisen'),jdecode(''), jdecode('%2F470480%2F471301.html'), 'true',[],'',''],
		['PAGE','471322',jdecode('Musiktage'),jdecode(''), jdecode('%2F470480%2F471322.html'), 'true',[],'',''],
		['PAGE','484280',jdecode('Sonstiges'),jdecode(''), jdecode('%2F470480%2F484280.html'), 'true',[],'','']
	],'',''],
	['PAGE','487280',jdecode('Galerie'),jdecode(''), jdecode('%2F487280%2Findex.html'), 'true',[ 
		['PAGE','487301',jdecode('Neuuniformierung'),jdecode(''), jdecode('%2F487280%2F487301.html'), 'true',[],'','']
	],'',''],
	['PAGE','512980',jdecode('Ortsplan'),jdecode(''), jdecode('%2F512980.html'), 'true',[],'',''],
	['PAGE','695480',jdecode('Suche'),jdecode(''), jdecode('%2F695480.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Party';
theSitetree.paletteFamily='0035E0';
theSitetree.keyvisualId='3529';
theSitetree.keyvisualName='kv_3529.jpg';
theSitetree.fontsetId='10441';
theSitetree.graphicsetId='10806';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0035E0';
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: 			'Party',
				paletteFamily: 	'0035E0',
				keyvisualId: 	'3529',
				keyvisualName: 	'kv_3529.jpg',
				fontsetId: 		'10441',
				graphicsetId: 	'10806',
				contentColor: 	'FFFFFF',
				contentBGColor: '0035E0',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'E6FFAB',
				e_color: 		'E6FFAB',
				f_color: 		'E6FFAB',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4504',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4504',
internalId:  '',
customField: '20120129-211507'
};
webappMappings['7008']=webappMappings['7008-171']={
webappId:    '7008',
documentId:  '4696',
internalId:  '171',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '304347',
internalId:  '',
customField: '20111106-120009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4669',
internalId:  '',
customField: '20111106-133532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4642',
internalId:  '',
customField: '20100512-215339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4696',
internalId:  '',
customField: '20101122-152511'
};
webappMappings['1002']=webappMappings['1002-483980ahp010in2txy']={
webappId:    '1002',
documentId:  '483980',
internalId:  '483980ahp010in2txy',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '471301',
internalId:  '',
customField: '20120122-152349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '470580',
internalId:  '',
customField: '20120122-155012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '471280',
internalId:  '',
customField: '20101121-180027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '471480',
internalId:  '',
customField: '20110320-103059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '470480',
internalId:  '',
customField: '20111029-203953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '471343',
internalId:  '',
customField: '20100520-212105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '471322',
internalId:  '',
customField: '20100619-132946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '483980',
internalId:  '',
customField: '20090924-085815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '484280',
internalId:  '',
customField: '20101107-082631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '487301',
internalId:  '',
customField: '20091018-091846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '486380',
internalId:  '',
customField: '20120129-211524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '487280',
internalId:  '',
customField: '20091018-091234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '512980',
internalId:  '',
customField: '20091030-231559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '648480',
internalId:  '',
customField: '20100512-215041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '650080',
internalId:  '',
customField: '20100520-205216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '659880',
internalId:  '',
customField: '20110522-203436'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '695480',
internalId:  'search',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '695480',
internalId:  '',
customField: '20100815-175946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '817491',
internalId:  '',
customField: '20111029-223528'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010IN2TXY';
var companyName   = 'bei+der+MG+Oberkulm';
var htmlTitle	  = 'MG+Oberkulm';
var metaKeywords  = '';
var metaContents  = 'Baumgartenfest+Jahreskonzert+Herbstkonzert+Musikgesellschaft+Oberkulm+Auftritte+Musikgesellschaft+Oberkulm+';
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();
};

