PageSourceSearch

https://shop.museumnoe.at/webshop/scripts/responsive/functionsResponsive.js?v=2026.3.60.0

js museumnoe.at collected 2026-10-01 12:21:33 UTC 22,582 bytes, 528 lines download raw bytes

1var is_safari = navigator.userAgent.indexOf("Safari") > -1 && navigator.userAgent.indexOf("Chrome") < 0;
2
3
4//prototype String.endWith fuer den InternetExplorer
5if (!String.prototype.endsWith) {
6    String.prototype.endsWith = function (searchString, position) {
7        var subjectString = this.toString();
8        if (typeof position !== 'number' || !isFinite(position)
9            || Math.floor(position) !== position || position > subjectString.length) {
10            position = subjectString.length;
11        }
12        position -= searchString.length;
13        var lastIndex = subjectString.indexOf(searchString, position);
14        return lastIndex !== -1 && lastIndex === position;
15    };
16}
17
18
19//Validierung der Eingabe nach NON-ISO-8859-1 Zeichen
20function validateISOChar() {
21    if (document.getElementById('title') != null && !isISO88591(document.getElementById('title').value)
22        || document.getElementById('title2') != null && !isISO88591(document.getElementById('title2').value)
23        || document.getElementById('firstname') != null && !isISO88591(document.getElementById('firstname').value)
24        || document.getElementById('lastname') != null && !isISO88591(document.getElementById('lastname').value)
25        || document.getElementById('epithet') != null && !isISO88591(document.getElementById('epithet').value)
26        || document.getElementById('name3') != null && !isISO88591(document.getElementById('name3').value)
27        || document.getElementById('street') != null && !isISO88591(document.getElementById('street').value)
28        || document.getElementById('streetNo') != null && !isISO88591(document.getElementById('streetNo').value)
29        || document.getElementById('addressAddition') != null && !isISO88591(document.getElementById('addressAddition').value)
30        || document.getElementById('zipcode') != null && !isISO88591(document.getElementById('zipcode').value)
31        || document.getElementById('zip') != null && !isISO88591(document.getElementById('zip').value)
32        || document.getElementById('city') != null && !isISO88591(document.getElementById('city').value)
33        || document.getElementById('district') != null && !isISO88591(document.getElementById('district').value)) {
34        return true;
35    }
36
37    return false;
38}
39
40function isISO88591(str) {
41    var regexp = /^([\x09\x0A\x0D\x20-\x7E\xA0-\xFF])*$/;
42    return regexp.test(str);
43}
44
45
46function smartPriceFormat(price) {
47    price = String(Math.round(price * 100)); //Centpreiss
48    while (price.length < 3) price = "0" + price;
49    var n = price.split(""), _price = "";
50
51    // Den Preis entsprechend der Lokals mit Dezimal und Trausender Trennzeichen versehen.
52    jQuery.map(n, function (_digit, _idx) {
53        _price = _price + _digit;
54
55        if (_idx + 1 === n.length - 2) {
56            // Dezimaltrenner vor der vorletzten Stelle einfuegen.
57            _price = _price + decimalDelimiter;
58        } else if ((n.length - 3 - _idx) % 3 === 0) {
59            // Tausendertrenner einfuegen.
60            _price = _price + thousandsDelimiter;
61        }
62    });
63    // Jetzt noch entsprechend der Laender- und Affiliateeinstellungen die Waehrung hinzufuegen.
64    return priceformat.replace(/\{price\}/g, _price);
65};
66
67
68function showPopup(url) {
69    popup(url, '', 'scrollbars=yes,width=' + screen.width / 2 + ' ,height=' + (screen.height - 150) + ' , resizable=yes');
70}
71
72// Popup
73function popup(url, name, params) {
74    var sizeX = 0;
75    var sizeY = 0;
76    var winX = screen.availWidth;
77    var winY = screen.availHeight;
78    var tmpArray = params.split(',');
79    for (var i = 0; i < tmpArray.length; i++) {
80        if (tmpArray[i].indexOf('width') != -1) {
81            var tmpArray2 = tmpArray[i].split('=');
82            sizeX = tmpArray2[1];
83        }
84        if (tmpArray[i].indexOf('height') != -1) {
85            var tmpArray2 = tmpArray[i].split('=');
86            sizeY = tmpArray2[1];
87        }
88    }
89    var centerX = Math.round(winX / 2 - sizeX / 2);
90    var centerY = Math.round(winY / 2 - sizeY / 2);
91    params += ',left=' + centerX + ',top=' + centerY;
92    var pWindow = open(url, name, params).focus();
93
94
95}
96
97
98/**
99 * define string format function if not exists
100 */
101if (!String.prototype.format) {
102    String.prototype.format = function () {
103        var args = arguments;
104        return this.replace(/{(\d+)}/g, function (match, number) {
105            return typeof args[number] != 'undefined' ? args[number] : match;
106        });
107    };
108}
109
110$(document).ready(function () {
111    if (jQuery("form.showLoading").length > 0) {
112        jQuery('form.showLoading').on('submit', function (e) {
113            var form = this;
114            showLoadingIcon();
115            if (is_safari) {
116                setTimeout(function () {
117                    form.submit();
118                }, 300);
119                e.preventDefault();
120            } else {
121                form.submit();
122                e.preventDefault();
123            }
124        });
125    }
126});
127
128
129function sleep(milliseconds) {
130    var start = new Date().getTime();
131    for (var i = 0; i < 1e7; i++) {
132        if ((new Date().getTime() - start) > milliseconds) {
133            break;
134        }
135    }
136}
137
138
139function adjustFontSize(targetElement) {
140
141    function numberOfLines(targetElement) {
142        var style = window.getComputedStyle(targetElement, null);
143        var height = parseInt(style.getPropertyValue("height"));
144        var font_size = parseInt(style.getPropertyValue("font-size"));
145        var line_height = parseInt(style.getPropertyValue("line-height"));
146        var box_sizing = style.getPropertyValue("box-sizing");
147
148        if (isNaN(line_height)) line_height = font_size * 1.2;
149
150        if (box_sizing == 'border-box') {
151            var padding_top = parseInt(style.getPropertyValue("padding-top"));
152            var padding_bottom = parseInt(style.getPropertyValue("padding-bottom"));
153            var border_top = parseInt(style.getPropertyValue("border-top-width"));
154            var border_bottom = parseInt(style.getPropertyValue("border-bottom-width"));
155            height = height - padding_top - padding_bottom - border_top - border_bottom;
156        }
157
158        if ((height / line_height) > 1.75 && (height / line_height) < 2) {
159            var lines = -1;
160        } else if ((height / line_height) >= 2) {
161            var lines = Math.ceil(height / line_height);
162        } else {
163            var lines = 1;
164        }
165        return lines;
166    }
167
168    var n = numberOfLines(targetElement);
169    if (n == 1) {
170        targetElement.style.fontSize = '0.875em';
171    } else if (n == -1) {
172        targetElement.style.fontSize = '0.8125em';
173    } else {
174        targetElement.style.fontSize = '0.75em';
175    }
176}
177
178function getCorrectMessageByNumber(number, message1, message2, message3) {
179    var lastChar = null,
180        secondChar = null,
181        language, message = "";
182
183    number = parseInt(number);
184    language = globals.language;
185    lastChar = number % 10;
186    secondChar = parseInt(number / 10);
187    secondChar = secondChar % 10;
188    if (language == "de") {
189        if (number === 1) {
190            message = message1;
191        } else {
192            message = message3; //Plaetzen
193        }
194    } else if (language == "ru") {
195        if (lastChar === 1 && secondChar != 1) {
196            message = message1;
197        } else if (lastChar >= 2 && lastChar <= 4 && secondChar != 1) {
198            message = message2;
199        } else if ((lastChar >= 5 && lastChar <= 9) || lastChar === 0 || secondChar === 1) {
200            message = message3;
201        }
202    } else if (language == "pl") {
203        if (number === 0) {
204            message = message3;
205        } else if (number === 1) {
206            message = message1;
207        } else if (lastChar <= 1 || lastChar >= 5) {
208            message = message3;
209        } else {
210            message = message2;
211        }
212    } else if (language == "cs") {
213        if (number === 1) {
214            message = message1;
215        } else if (number >= 2 && number <= 4) {
216            message = message2;
217        } else {
218            message = message3;
219        }
220    } else {
221        message = (number === 1) ? message1 : message2;
222    }
223    return message;
224};
225
226//Cookie Handling
227function getCookie(cookieName) {
228    let matches = document.cookie.match(new RegExp("(?:^|; )" + cookieName.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"));
229    return matches ? decodeURIComponent(matches[1]) : undefined;
230}
231
232function setCookie(cookieName, cookieData) {
233    document.cookie = cookieName + '=' + cookieData;
234}
235
236//Format Price for GTM Tracking
237function formatPriceForTracking(number) {
238    if (number !== 'undefined') {
239        return Number.parseFloat(number).toFixed(2)
240    }
241}
242
243
244//------------------------------------------------------------------------------------------  
245/*
246 * Messagebox
247 *
248 * Wenn msg nicht gefüllt übergeben wird, dann wird eine Fehlermeldung ausgegeben,
249 * dass die Anzeige des Saalplans aktuell nicht möglich ist.
250 *
251 */
252function showAlertMessage(_msgInput, buttonList, additionalContent, parentContainer) {
253
254    // If no parent Container is specified, use default
255    //parentContainer = parentContainer || '.seatmap-error-container';
256    parentContainer = parentContainer || '.alertmessage-container';
257
258    // Lighbox
259    var _lightbox = jQuery('<div id="alertmessage-lightbox"/>');
260    var _shadow = jQuery('<div id="alertmessage-lightbox-shadow"/>');
261
262    // Message HTML
263    //var _msgStart		= "<div class=\"error error-section section1\"><div class=\"message-icon hint-icon seatmap-icon\"></div><div class=\"message-text\">";
264    var _msgStart = "<div class=\"error error-section section1\"><div class=\"message-text\">";
265    var _msgEnd = "</div></div>";
266    //var _msgClose		= "<div class=\"close-icon seatmap-icon\"></div>";
267    var _msgClose = "<button type=\"button\" class=\"close-icon close pull-right\" aria-label=\"Close\"><span aria-hidden=\"true\">x</span></button>";
268    var _msgTemp = "";
269    var _msgOutput = "";
270
271    // Lightbox löschen und neuzeichnen
272    jQuery('#salertmessage-lightbox, #alertmessage-lightbox-shadow').remove();
273    jQuery(parentContainer).append(_shadow).append(_lightbox);
274    jQuery('#alertmessage-lightbox').empty();
275
276    // Message processing
277    if (_msgInput === undefined) {
278        // Keine Message übergeben --> Allgemeine Fehlermeldung ausgeben
279        _msgOutput = "<div class=\"error-section index1 first last\">";
280        _msgOutput += "<div class=\"message-icon icon-greyed\"></div>";
281        _msgOutput += "<div class=\"message-text\">" + seatmap.message.errorNoSeatmap + "</div></div>";
282    } else {
283        // Message Typenprüfung
284        if ((typeof _msgInput === "object") && (_msgInput.length > 0)) {
285
286            // Mehrere Sektionen gefunden
287            for (var i = 0; i < _msgInput.length; i++) {
288
289                var _msgTempSub = "";
290                var _cssTemp = "";
291
292                // Css Klassen zu Sektionen hinzufügen
293                if (i == 0) {
294                    _cssTemp += " first";
295                } else if (i == (_msgInput.length - 1)) {
296                    _cssTemp += " last";
297                }
298
299                // Multiple Nachrichteneinstellungen suchen
300                if ((typeof _msgInput[i] === "object") && (_msgInput[i].length > 0)) {
301
302                    // Nachricht(en) auslesen
303                    if ((typeof _msgInput[i][0] === "object") && (_msgInput[i][0].length > 0)) {
304
305                        // Mehrere Nachrichten
306                        var _tmpMsgList = '';
307                        for (var j = 0; j < _msgInput[i][0].length; j++) {
308                            _tmpMsgList += "<li>" + _msgInput[i][0][j] + "</li>";
309                        }
310
311                        _msgTempSub = "<ul>" + _tmpMsgList + "</ul>";
312                    } else {
313
314                        // Einzelne Nachricht
315                        _msgTempSub = _msgInput[i][0];
316                    }
317
318                    // Spezifische CSS-Klassen
319                    _cssTemp += (_msgInput[i][1] ? (" " + _msgInput[i][1]) : "");
320
321                    // Sektionen-Eigenschaften laden
322                    _msgTemp += "<div class=\"error-section index" + (i + 1) + _cssTemp + "\">";				// Section-DIV anlegen
323                    _msgTemp += (_msgInput[i][2] ? ("<div class=\"message-icon " + _msgInput[i][2] + "\"></div>") : "");	// Icon hinzufügen
324                    _msgTemp += "<div class=\"message-text\">" + _msgTempSub + "</div>";								// Nachricht hinzufügen
325                    _msgTemp += "</div>";																				// Section-DIV schließen
326                } else {
327                    // Einfache Nachricht gefunden
328                    _msgTemp += "<div class=\"error-section index" + (i + 1) + "\">";								// Section-DIV anlegen
329                    _msgTemp += "<div class=\"message-text\">" + _msgInput[i] + "</div>";								// Nachricht hinzufügen
330                    _msgTemp += "</div>";																				// Section-DIV schließen
331                }
332            }
333            _msgOutput = _msgTemp;
334        } else {
335            // Message ist ein String oder eine Zahl
336            _msgOutput = _msgStart + _msgInput + _msgEnd;
337        }
338
339        // Add close icon
340        _msgOutput = _msgClose + _msgOutput;
341
342
343    }
344
345    // AdditionalContent hinzufügen
346    if (additionalContent) {
347        _msgOutput += "<div class=\"error_additional_content\">" + additionalContent + "</div>";
348    }
349
350    // Nachricht in die Lightbox einfügen
351    jQuery('#alertmessage-lightbox').append('<div class="innerwrapper">' + _msgOutput + '</div>');
352
353    if (buttonList) {
354
355        jQuery(".close-icon").click(function (e) {
356            jQuery('#alertmessage-lightbox, #alertmessage-lightbox-shadow').hide();
357            jQuery('#alertmessage-lightbox').empty();
358        });
359
360        var _btnList = {
361            "okBtn": "<input type=\"button\" id=\"okBtn\" class=\"errorBtn\" onclick=\"javascript:jQuery('.close-icon').click();\" value=\"OK\" />",
362            //"continueBtn" 		 : "<input type=\"button\" id=\"continueBtn\" class=\"errorBtn\" onclick=\"javascript:jQuery('.close-icon').click();\" value=\""+ seatmap.message.continueAnyway +"\" />",
363            "continueBtn": "<input type=\"button\" id=\"continueBtn\" class=\"errorBtn\" onclick=\"javascript:jQuery('.close-icon').click();\" value=\"weiter\" />",
364            //		"closeBtn"	  		 : "<input type=\"button\" id=\"closeBtn\" class=\"errorBtn\" onclick=\"javascript:jQuery('.close-icon').click();\" value=\""+ seatmap.message.closeWindow +"\" />",
365            //		"supportContinueBtn" : "<input type=\"button\" id=\"continueBtn\" class=\"errorBtn\" onclick=\"javascript:disableSupportError();javascript:jQuery('.close-icon').click();\" value=\""+ seatmap.message.continueAnyway +"\" />",
366            //		"deselectPackageYesBtn" : "<input type=\"button\" id=\"deselectPackageYesBtn\" class=\"errorBtn textCenter\" onclick=\"javascript:jQuery('#alertmessage-lightbox-shadow,#alertmessage-lightbox').hide(); PackageHandler.confirmChangeAmount();\" value=\""+ seatmap.message.yes +"\" />",
367            //		"deselectPackageNoBtn"	: "<input type=\"button\" id=\"deselectPackageNoBtn\" class=\"errorBtn textCenter\" onclick=\"javascript:jQuery('#alertmessage-lightbox-shadow,#alertmessage-lightbox').hide(); PackageHandler.cancelChangeAmount();\" value=\""+ seatmap.message.no +"\" />",
368            //		"deletePackageYesBtn" : "<input type=\"button\" id=\"deselectPackageYesBtn\" class=\"errorBtn textCenter\" onclick=\"javascript:jQuery('#alertmessage-lightbox-shadow,#alertmessage-lightbox').hide(); PackageHandler.confirmDeleteAll();\" value=\""+ seatmap.message.yes +"\" />",
369            //		"deletePackageNoBtn"	: "<input type=\"button\" id=\"deselectPackageNoBtn\" class=\"errorBtn textCenter\" onclick=\"javascript:jQuery('#alertmessage-lightbox-shadow,#alertmessage-lightbox').hide();\" value=\""+ seatmap.message.no +"\" />"
370
371//"yesBtn" : "<input type=\"button\" id=\"deselectPackageYesBtn\" class=\"errorBtn textCenter\" onclick=\"javascript:jQuery('#alertmessage-lightbox-shadow,#alertmessage-lightbox').hide(); PackageHandler.confirmDeleteAll();\" value=\"JA\" />",
372//"noBtn"	: "<input type=\"button\" id=\"deselectPackageNoBtn\" class=\"errorBtn textCenter\" onclick=\"javascript:jQuery('#alertmessage-lightbox-shadow,#alertmessage-lightbox').hide();\" value=\"NO\" />",
373            "yesNoBtn": "<div class=\"row\"><div class=\"col-sm-6  m-b-sm\" ><a class=\"btn btn-default full-width\" onclick=\"javascript:jQuery('.close-icon').click();\"  value=\"" + alertMessage.message.no + "\" >" + alertMessage.message.no + "</a></div><div class=\"col-sm-6\" ><a class=\"btn btn-primary full-width \" onclick=\"javascript:jQuery('#alertmessage-lightbox-shadow,#alertmessage-lightbox').hide();alertMessageYesClick();\"   value=\"" + alertMessage.message.yes + "\" >" + alertMessage.message.yes + "</a></div></div>"
374//	"noBtn" : "<a class=\"btn btn-default m-t-sm m-b-sm\" onclick=\"javascript:$('#cancelSeatsModal').modal('show');\">nein</a>",
375
376        };
377
378        // Buttoncontainer bauen
379        var _btnContainer = jQuery('<div class="buttonContainer"/>');
380        var _btnContent = "";
381
382        for (var i = 0; i < buttonList.length; i++) {
383            // "Zur Bestplatzbuchung" nur anzeigen wenn Bestplatz am Event verfügbar ist.
384            //if(buttonList[i] != "bestplace" || seatmap.showBestPlaceTab || (seatmap.options && seatmap.options.mobile && seatmap.backLink))
385            if (_btnList[buttonList[i]]) {
386                _btnContent = _btnContent + _btnList[buttonList[i]];
387            }
388        }
389        jQuery(_btnContainer).append(_btnContent);
390        jQuery('#alertmessage-lightbox .innerwrapper').append(_btnContainer);
391
392    } else {
393        if (_msgInput !== undefined) {
394            jQuery(_shadow).add(_lightbox).add(".close-icon").click(function (e) {
395                jQuery('#alertmessage-lightbox, #alertmessage-lightbox-shadow').hide();
396                jQuery('#alertmessage-lightbox').empty();
397            });
398        }
399    }
400
401    // Lightbox-Position aktualisieren
402    positionAlertMessageLightbox();
403
404    // Lightbox-Position auch bei Resize aktualisieren
405    jQuery(window).resize(function () {
406        positionAlertMessageLightbox();
407    });
408
409    // Lightbox-Position auch bei Scrolling aktualisieren
410    jQuery(window).scroll(function () {
411        positionAlertMessageLightbox();
412    });
413
414    // Lightbox anzeigen
415    jQuery('#alertmessage-lightbox').show();
416    jQuery('#alertmessage-lightbox-shadow').show();
417
418    // Bugfix für Android Browser WEB-4643
419    if (navigator.userAgent.toLowerCase().indexOf('opera') === -1 &&
420        navigator.userAgent.toLowerCase().indexOf('chrome') === -1 &&
421        navigator.userAgent.toLowerCase().indexOf('firefox') === -1 &&
422        navigator.userAgent.toLowerCase().indexOf("android") > -1) {
423        jQuery(".alertmessage #alertmessage-lightbox-shadow").css("z-index", "9902 !important");
424        jQuery(".alertmessage #alertmessage-lightbox").css("z-index", "9903 !important");
425    }
426}
427
428
429/*
430 * LIGHTBOX POSITIONIERUNG
431 *
432 * Die Lightbox wird vertikal und horizontal mittig positioniert. Wenn die
433 * Lightbox größer ist als der zur Verfügung stehende Platz, wird der Inhalt
434 * scroll-fähig und das Hint-Icon neu positioniert.
435 *
436 */
437function positionAlertMessageLightbox() {
438    if (jQuery('#alertmessage-lightbox')) {
439        // Reset
440        jQuery("#alertmessage-lightbox").css({
441            "top": "",
442            "left": "",
443            "height": "",
444            "margin-left": ""
445        });
446
447        // Lade Variablen der abhängigen DIV Container / Zielwertkalkulation
448        var mapWrapperHeight = jQuery('#alertmessage-lightbox').parent().outerHeight();
449        var mapHeaderHeight = jQuery("#alertmessage-header").outerHeight();
450        var mapFooterHeight = jQuery("#alertmessage-footer").outerHeight();
451        var mapLightboxHeight = jQuery("#alertmessage-lightbox").outerHeight();
452        var mapLightboxWidth = jQuery("#alertmessage-lightbox").outerWidth();
453        var mapLightboxErrHeight = jQuery("#alertmessage-lightbox .innerwrapper").outerHeight() + 2 * parseInt(j
453Query('#alertmessage-lightbox').css("padding-top"));
454        var mapLightboxHintPos = '0 center';
455        var minimumOffset = 10;
456
457        // Aussteigen, wenn Fehlermeldung nicht sichtbar
458        if (mapWrapperHeight == 0) {
459            return;
460        }
461
462        // Overwrite in der selection list
463        if (jQuery("#selection-header")) {
464            mapHeaderHeight = jQuery("#selection-header").outerHeight();
465        }
466
467        if (jQuery("#selection-footer")) {
468            mapFooterHeight = jQuery("#selection-footer").outerHeight();
469        }
470
471        // Panorama aktiv
472        if (!jQuery("#panorama").hasClass("hide")) {
473            mapFooterHeight = 0;
474        }
475
476        // Kalkulation top-position lighbox
477        var mapLightboxTop = ((mapWrapperHeight - mapHeaderHeight - mapFooterHeight) / 2 + mapHeaderHeight) + (mapLightboxHeight / -2);
478
479        // Limitierung bei zu großer Lightbox
480        var limitTop = mapHeaderHeight + minimumOffset;
481        var limitHeight = mapWrapperHeight - mapHeaderHeight - mapFooterHeight - minimumOffset * 2;
482
483        // Special Handling / Lighbox zu groß
484        if (mapLightboxTop <= limitTop) {
485            mapLightboxTop = limitTop;
486            mapLightboxHeight = limitHeight;
487            mapLightboxHintPos = "0 5px";
488        } else {
489            if (limitHeight >= mapLightboxErrHeight) {
490                mapLightboxHeight = "auto";
491                mapLightboxHintPos = "0 center";
492            } else {
493                mapLightboxTop = limitTop;
494                mapLightboxHeight = limitHeight;
495                mapLightboxHintPos = "0 5px";
496            }
497        }
498
499        // Processing
500        jQuery("#alertmessage-lightbox").css({
501            "top": mapLightboxTop + "px",
502            "left": "50%",
503            "height": mapLightboxHeight,
504            "margin-left": (mapLightboxWidth / -2) + "px"
505        });
506
507        //if (seatmap.options && seatmap.options.mobile) {
508        jQuery("#alertmessage-lightbox, #alertmessage-lightbox-shadow").css({
509            "position": "fixed"
510        });
511        //}
512        jQuery('#alertmessage-lightbox .hint-icon').css({
513            "background-position": mapLightboxHintPos
514        });
515    }
516}
517
518
519function hideAlertMessage() {
520    jQuery('#alertmessage-lightbox-shadow').hide();
521    jQuery('#alertmessage-lightbox').hide();
522
523}
524
525
526
527//---------------------------------------------------------------------------------------------			
528			

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.