/* [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','103712',jdecode('Kulturstube+'),jdecode(''), jdecode('%2F103712.html'), 'true',[],'',''],
	['PAGE','107612',jdecode('Programm'),jdecode(''), jdecode('%2F107612.html'), 'true',[],'',''],
	['PAGE','110833',jdecode('%C3%96ffnungszeiten'),jdecode(''), jdecode('%2F110833.html'), 'true',[],'',''],
	['PAGE','110854',jdecode('Vermietung'),jdecode(''), jdecode('%2F110854.html'), 'true',[],'',''],
	['PAGE','110917',jdecode('Member+werden'),jdecode(''), jdecode('%2F110917.html'), 'true',[],'',''],
	['PAGE','115012',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F115012.html'), 'true',[],'',''],
	['PAGE','110938',jdecode('Medienspiegel'),jdecode(''), jdecode('%2F110938.html'), 'false',[],'',''],
	['PAGE','110980',jdecode('Fotogalerie'),jdecode(''), jdecode('%2F110980.html'), 'false',[],'',''],
	['PAGE','103733',jdecode('Theater'),jdecode(''), jdecode('%2F103733.html'), 'false',[],'',''],
	['PAGE','103754',jdecode('Opernair'),jdecode(''), jdecode('%2F103754%2Findex.html'), 'false',[ 
		['PAGE','9401',jdecode('1.+Opernair+Hemishofen'),jdecode(''), jdecode('%2F103754%2F9401.html'), 'true',[],'',''],
		['PAGE','66412',jdecode('Presse'),jdecode(''), jdecode('%2F103754%2F66412.html'), 'false',[],'',''],
		['PAGE','11901',jdecode('2.+Opernair+Hemishofen+'),jdecode(''), jdecode('%2F103754%2F11901.html'), 'true',[],'','']
	],'',''],
	['PAGE','99812',jdecode('Letzte+Spieldaten'),jdecode(''), jdecode('%2F99812.html'), 'false',[],'',''],
	['PAGE','9452',jdecode('Ticketbestellung'),jdecode(''), jdecode('%2F9452%2Findex.html'), 'false',[ 
		['PAGE','68912',jdecode('Twist-Team'),jdecode(''), jdecode('%2F9452%2F68912.html'), 'false',[],'','']
	],'',''],
	['PAGE','99412',jdecode('Theaterrestaurant'),jdecode(''), jdecode('%2F99412.html'), 'false',[],'',''],
	['PAGE','38212',jdecode('Sponsoren+%2F+Medien'),jdecode(''), jdecode('%2F38212.html'), 'false',[],'',''],
	['PAGE','77412',jdecode('Sponsorendossier'),jdecode(''), jdecode('%2F77412.html'), 'false',[],'',''],
	['PAGE','9536',jdecode('G%C3%B6nnerverein'),jdecode(''), jdecode('%2F9536.html'), 'false',[],'',''],
	['PAGE','13522',jdecode('Kontaktformular'),jdecode(''), jdecode('%2F13522.html'), 'true',[],'',''],
	['PAGE','9473',jdecode('Oliver+Twist'),jdecode(''), jdecode('%2F9473%2Findex.html'), 'true',[ 
		['PAGE','13001',jdecode('Presse'),jdecode(''), jdecode('%2F9473%2F13001.html'), 'true',[],'',''],
		['PAGE','61712',jdecode('Bildergalerie'),jdecode(''), jdecode('%2F9473%2F61712.html'), 'true',[],'',''],
		['PAGE','68012',jdecode('Die+Geschichte'),jdecode(''), jdecode('%2F9473%2F68012.html'), 'true',[],'',''],
		['PAGE','31012',jdecode('Drehbuch+und+Regie'),jdecode(''), jdecode('%2F9473%2F31012.html'), 'false',[],'',''],
		['PAGE','31033',jdecode('Licht+%2F+Ton+%2F+B%C3%BChne'),jdecode(''), jdecode('%2F9473%2F31033.html'), 'false',[],'',''],
		['PAGE','9801',jdecode('Spielerportraits'),jdecode(''), jdecode('%2F9473%2F9801.html'), 'false',[],'',''],
		['PAGE','68033',jdecode('Musik+-+CD'),jdecode(''), jdecode('%2F9473%2F68033.html'), 'true',[],'',''],
		['PAGE','15101',jdecode('Ensemble'),jdecode(''), jdecode('%2F9473%2F15101.html'), 'false',[],'',''],
		['PAGE','15401',jdecode('Produktionsteam'),jdecode(''), jdecode('%2F9473%2F15401.html'), 'false',[],'',''],
		['PAGE','31912',jdecode('Proben-Tagebuch'),jdecode(''), jdecode('%2F9473%2F31912.html'), 'false',[],'',''],
		['PAGE','34912',jdecode('Aktuell'),jdecode(''), jdecode('%2F9473%2F34912.html'), 'false',[],'','']
	],'',''],
	['PAGE','44912',jdecode('Links'),jdecode(''), jdecode('%2F44912.html'), 'false',[],'',''],
	['PAGE','55912',jdecode('Impressum'),jdecode(''), jdecode('%2F55912.html'), 'false',[],'',''],
	['PAGE','95812',jdecode('Links'),jdecode(''), jdecode('%2F95812.html'), 'true',[],'',''],
	['PAGE','115033',jdecode('Lyoness'),jdecode(''), jdecode('%2F115033.html'), 'true',[],'','']];
var siteelementCount=37;
theSitetree.topTemplateName='Vienna';
theSitetree.paletteFamily='DCCC9F';
theSitetree.keyvisualId='11879';
theSitetree.keyvisualName='kv_11879.jpg';
theSitetree.fontsetId='33182';
theSitetree.graphicsetId='14089';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='fbeec7';
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: 			'Vienna',
				paletteFamily: 	'DCCC9F',
				keyvisualId: 	'11879',
				keyvisualName: 	'kv_11879.jpg',
				fontsetId: 		'33182',
				graphicsetId: 	'14089',
				contentColor: 	'000000',
				contentBGColor: 'fbeec7',
				a_color: 		'FBEFC9',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '110980',
internalId:  '-',
customField: '20120115-150855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20111113-155445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20110901-153803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9452',
internalId:  '',
customField: '20110731-115742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9473',
internalId:  '',
customField: '20120201-131358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31012',
internalId:  '',
customField: '20111113-160721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9536',
internalId:  '',
customField: '20111113-160952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20110901-145929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66412',
internalId:  '',
customField: '20111113-155416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20120201-125320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20111113-153200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31912',
internalId:  '',
customField: '20100625-185548'
};
webappMappings['7008']=webappMappings['7008-7252']={
webappId:    '7008',
documentId:  '13522',
internalId:  '7252',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13522',
internalId:  '',
customField: '20120131-131125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20100610-130227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31033',
internalId:  '',
customField: '20111113-160736'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '103733',
internalId:  '-',
customField: '20111113-160320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61712',
internalId:  '',
customField: '20120201-130619'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '110833',
internalId:  '-',
customField: '20120201-123128'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '110854',
internalId:  '-',
customField: '20120131-100213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34912',
internalId:  '',
customField: '20100627-093251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38212',
internalId:  '',
customField: '20110901-145705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44912',
internalId:  '',
customField: '20101129-161827'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '103712',
internalId:  '-',
customField: '20120131-095744'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '103754',
internalId:  '-',
customField: '20111113-165047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55912',
internalId:  '',
customField: '20101129-161902'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '107612',
internalId:  '-',
customField: '20120201-110208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68012',
internalId:  '',
customField: '20120201-131250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68033',
internalId:  '',
customField: '20120201-130833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68912',
internalId:  '',
customField: '20110531-103452'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '115033',
internalId:  '-',
customField: '20120201-123750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77412',
internalId:  '',
customField: '20101207-170814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99412',
internalId:  '',
customField: '20110922-131447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99812',
internalId:  '',
customField: '20110924-110336'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '110938',
internalId:  '-',
customField: '20120115-150855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95812',
internalId:  '',
customField: '20120112-201942'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '110917',
internalId:  '-',
customField: '20120124-124337'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '115012',
internalId:  '-',
customField: '20120201-120832'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '103712',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INE8KJ';
var companyName   = 'Kulturstube+L%C3%B6wen';
var htmlTitle	  = 'Kulturstube+L%C3%B6wen';
var metaKeywords  = 'Musical%2C+Operette%2C+Theater%2C+openair%2C+Freilichtspiel%2C+Freilichtauff%C3%BChrung%2C+Stein+am+Rhein%2C+opernair%2C+Kultur%2C+Kulturstube%2C+Gasthof%2C+Restaurant%2C+Besenbeiz%2C+L%C3%B6wen%2C+L%C3%B6wenkultur%2C+Oliver+Twist%2C+Opernair%2C+Diessenhofen%2C+Hemishofen%2C+Stein+am+Rhein';
var metaContents  = 'Musical%2C+Operette%2C+Theater%2C+openair%2C+Freilichtauff%C3%BChrung%2C+Stein+am+Rhein%2C+opernair%2C+Oliver+Twist%2C+Kulturstube%2C+Gasthof%2C+L%C3%B6wenkultur%2C+Kultur%2C+Diessenhofen';
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();
};

