PageSourceSearch

https://www.charleshotel.hu/wp-content/themes/pro-theme-curcuma/js/main.js?ver=1.1

js charleshotel.hu collected 2026-09-26 14:16:47 UTC 33,475 bytes, 882 lines download raw bytes

1/*!
2 * imagesLoaded PACKAGED v3.0.4
3 * JavaScript is all like "You images are done yet or what?"
4 * MIT License
5 */
6(function () {
7    "use strict";
8
9    function e() {
10    }
11
12    function t(e, t) {
13        for (var n = e.length; n--;) if (e[n].listener === t) return n;
14        return -1
15    }
16
17    function n(e) {
18        return function () {
19            return this[e].apply(this, arguments)
20        }
21    }
22
23    var i = e.prototype;
24    i.getListeners = function (e) {
25        var t, n, i = this._getEvents();
26        if ("object" == typeof e) {
27            t = {};
28            for (n in i) i.hasOwnProperty(n) && e.test(n) && (t[n] = i[n])
29        } else t = i[e] || (i[e] = []);
30        return t
31    }, i.flattenListeners = function (e) {
32        var t, n = [];
33        for (t = 0; e.length > t; t += 1) n.push(e[t].listener);
34        return n
35    }, i.getListenersAsObject = function (e) {
36        var t, n = this.getListeners(e);
37        return n instanceof Array && (t = {}, t[e] = n), t || n
38    }, i.addListener = function (e, n) {
39        var i, r = this.getListenersAsObject(e), o = "object" == typeof n;
40        for (i in r) r.hasOwnProperty(i) && -1 === t(r[i], n) && r[i].push(o ? n : {listener: n, once: !1});
41        return this
42    }, i.on = n("addListener"), i.addOnceListener = function (e, t) {
43        return this.addListener(e, {listener: t, once: !0})
44    }, i.once = n("addOnceListener"), i.defineEvent = function (e) {
45        return this.getListeners(e), this
46    }, i.defineEvents = function (e) {
47        for (var t = 0; e.length > t; t += 1) this.defineEvent(e[t]);
48        return this
49    }, i.removeListener = function (e, n) {
50        var i, r, o = this.getListenersAsObject(e);
51        for (r in o) o.hasOwnProperty(r) && (i = t(o[r], n), -1 !== i && o[r].splice(i, 1));
52        return this
53    }, i.off = n("removeListener"), i.addListeners = function (e, t) {
54        return this.manipulateListeners(!1, e, t)
55    }, i.removeListeners = function (e, t) {
56        return this.manipulateListeners(!0, e, t)
57    }, i.manipulateListeners = function (e, t, n) {
58        var i, r, o = e ? this.removeListener : this.addListener, s = e ? this.removeListeners : this.addListeners;
59        if ("object" != typeof t || t instanceof RegExp) for (i = n.length; i--;) o.call(this, t, n[i]); else for (i in t) t.hasOwnProperty(i) && (r = t[i]) && ("function" == typeof r ? o.call(this, i, r) : s.call(this, i, r));
60        return this
61    }, i.removeEvent = function (e) {
62        var t, n = typeof e, i = this._getEvents();
63        if ("string" === n) delete i[e]; else if ("object" === n) for (t in i) i.hasOwnProperty(t) && e.test(t) && delete i[t]; else delete this._events;
64        return this
65    }, i.removeAllListeners = n("removeEvent"), i.emitEvent = function (e, t) {
66        var n, i, r, o, s = this.getListenersAsObject(e);
67        for (r in s) if (s.hasOwnProperty(r)) for (i = s[r].length; i--;) n = s[r][i], n.once === !0 && this.removeListener(e, n.listener), o = n.listener.apply(this, t || []), o === this._getOnceReturnValue() && this.removeListener(e, n.listener);
68        return this
69    }, i.trigger = n("emitEvent"), i.emit = function (e) {
70        var t = Array.prototype.slice.call(arguments, 1);
71        return this.emitEvent(e, t)
72    }, i.setOnceReturnValue = function (e) {
73        return this._onceReturnValue = e, this
74    }, i._getOnceReturnValue = function () {
75        return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0
76    }, i._getEvents = function () {
77        return this._events || (this._events = {})
78    }, "function" == typeof define && define.amd ? define(function () {
79        return e
80    }) : "object" == typeof module && module.exports ? module.exports = e : this.EventEmitter = e
81}).call(this), function (e) {
82    "use strict";
83    var t = document.documentElement, n = function () {
84    };
85    t.addEventListener ? n = function (e, t, n) {
86        e.addEventListener(t, n, !1)
87    } : t.attachEvent && (n = function (t, n, i) {
88        t[n + i] = i.handleEvent ? function () {
89            var t = e.event;
90            t.target = t.target || t.srcElement, i.handleEvent.call(i, t)
91        } : function () {
92            var n = e.event;
93            n.target = n.target || n.srcElement, i.call(t, n)
94        }, t.attachEvent("on" + n, t[n + i])
95    });
96    var i = function () {
97    };
98    t.removeEventListener ? i = function (e, t, n) {
99        e.removeEventListener(t, n, !1)
100    } : t.detachEvent && (i = function (e, t, n) {
101        e.detachEvent("on" + t, e[t + n]);
102        try {
103            delete e[t + n]
104        } catch (i) {
105            e[t + n] = void 0
106        }
107    });
108    var r = {bind: n, unbind: i};
109    "function" == typeof define && define.amd ? define(r) : e.eventie = r
110}(this), function (e) {
111    "use strict";
112
113    function t(e, t) {
114        for (var n in t) e[n] = t[n];
115        return e
116    }
117
118    function n(e) {
119        return "[object Array]" === c.call(e)
120    }
121
122    function i(e) {
123        var t = [];
124        if (n(e)) t = e; else if ("number" == typeof e.length) for (var i = 0, r = e.length; r > i; i++) t.push(e[i]); else t.push(e);
125        return t
126    }
127
128    function r(e, n) {
129        function r(e, n, s) {
130            if (!(this instanceof r)) return new r(e, n);
131            "string" == typeof e && (e = document.querySelectorAll(e)), this.elements = i(e), this.options = t({}, this.options), "function" == typeof n ? s = n : t(this.options, n), s && this.on("always", s), this.getImages(), o && (this.jqDeferred = new o.Deferred);
132            var a = this;
133            setTimeout(function () {
134                a.check()
135            })
136        }
137
138        function c(e) {
139            this.img = e
140        }
141
142        r.prototype = new e, r.prototype.options = {}, r.prototype.getImages = function () {
143            this.images = [];
144            for (var e = 0, t = this.elements.length; t > e; e++) {
145                var n = this.elements[e];
146                "IMG" === n.nodeName && this.addImage(n);
147                for (var i = n.querySelectorAll("img"), r = 0, o = i.length; o > r; r++) {
148                    var s = i[r];
149                    this.addImage(s)
150                }
151            }
152        }, r.prototype.addImage = function (e) {
153            var t = new c(e);
154            this.images.push(t)
155        }, r.prototype.check = function () {
156            function e(e, r) {
157                return t.options.debug && a && s.log("confirm", e, r), t.progress(e), n++, n === i && t.complete(), !0
158            }
159
160            var t = this, n = 0, i = this.images.length;
161            if (this.hasAnyBroken = !1, !i) return this.complete(), void 0;
162            for (var r = 0; i > r; r++) {
163                var o = this.images[r];
164                o.on("confirm", e), o.check()
165            }
166        }, r.prototype.progress = function (e) {
167            this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded;
168            var t = this;
169            setTimeout(function () {
170                t.emit("progress", t, e), t.jqDeferred && t.jqDeferred.notify(t, e)
171            })
172        }, r.prototype.complete = function () {
173            var e = this.hasAnyBroken ? "fail" : "done";
174            this.isComplete = !0;
175            var t = this;
176            setTimeout(function () {
177                if (t.emit(e, t), t.emit("always", t), t.jqDeferred) {
178                    var n = t.hasAnyBroken ? "reject" : "resolve";
179                    t.jqDeferred[n](t)
180                }
181            })
182        }, o && (o.fn.imagesLoaded = function (e, t) {
183            var n = new r(this, e, t);
184            return n.jqDeferred.promise(o(this))
185        });
186        var f = {};
187        return c.prototype = new e, c.prototype.check = function () {
188            var e = f[this.img.src];
189            if (e) return this.useCached(e), void 0;
190            if (f[this.img.src] = this, this.img.complete && void 0 !== this.img.naturalWidth) return this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), void 0;
191            var t = this.proxyImage = new Image;
192            n.bind(t, "load", this), n.bind(t, "error", this), t.src = this.img.src
193        }, c.prototype.useCached = function (e) {
194            if (e.isConfirmed) this.confirm(e.isLoaded, "cached was confirmed"); else {
195                var t = this;
196                e.on("confirm", function (e) {
197                    return t.confirm(e.isLoaded, "cache emitted confirmed"), !0
198                })
199            }
200        }, c.prototype.confirm = function (e, t) {
201            this.isConfirmed = !0, this.isLoaded = e, this.emit("confirm", this, t)
202        }, c.prototype.handleEvent = function (e) {
203            var t = "on" + e.type;
204            this[t] && this[t](e)
205        }, c.prototype.onload = function () {
206            this.confirm(!0, "onload"), this.unbindProxyEvents()
207        }, c.prototype.onerror = function () {
208            this.confirm(!1, "onerror"), this.unbindProxyEvents()
209        }, c.prototype.unbindProxyEvents = function () {
210            n.unbind(this.proxyImage, "load", this), n.unbind(this.proxyImage, "error", this)
211        }, r
212    }
213
214    var o = e.jQuery, s = e.console, a = s !== void 0, c = Object.prototype.toString;
215    "function" == typeof define && define.amd ? define(["eventEmitter/EventEmitter", "eventie/eventie"], r) : e.imagesLoaded = r(e.EventEmitter, e.eventie)
216}(window);
217
218(function ($) {
219
220    // DOCUMENT READY
221    $(document).ready(function () {
222        // loading
223        if ($('html').hasClass('loading')) {
224            $('#loading').fadeOut(500, function () {
225                $('html').removeClass('loading');
226                $(this).css({'z-index': 1});
227            });
228        }
229
230
231        // home pop_up
232        homepage_pop_up();
233    });
234
235
236    // WINDOW RESIZE
237    jQuery(window).resize(function () {
238
239        fixscrollbar();
240        childrenPreviewHeight()
241        slideshow();
242        slideshowPlaceholder()
243        previewIndex();
244
245    });
246
247    // WINDOW SCROLL
248    jQuery(window).scroll(function () {
249
250
251    });
252
253    // WINDOW LOAD
254    jQuery(window).load(function () {
255
256        childrenPreviewHeight()
257
258        if ($('body').hasClass('custom_submenu')) {
259
260
261            submenu = function submenu() {
262                var hasChildren = $('#primary_menu ul.menu > li.current_page_item');
263                $('#primary_menu ul.menu > li.menu-item-has-children').find('> a').off('click');
264                var parent_li = hasChildren.find('> a').parent('li');
265                if (!parent_li.hasClass('open')) {
266                    $('#primary_menu .sub-menu').fadeOut().parent('li').removeClass('open');
267                    parent_li.addClass('open').find('.sub-menu').fadeIn(600, function () {
268                        $("#wrapper_left_content").mCustomScrollbar('update');
269                    });
270                }
271            };
272            setTimeout(submenu, 500);
273
274
275            if ($('body').hasClass('page-child') && !$('body').hasClass('page-parent')) {
276                submenu_children = function submenu() {
277                    var hasParent = $('#primary_menu ul.menu > li.current_page_ancestor');
278                    $('#primary_menu ul.menu > li.menu-item-has-children').find('> a').off('click');
279                    var parent_li = hasParent.find('> a').parent('li');
280                    if (!parent_li.hasClass('open')) {
281                        $('#primary_menu .sub-menu').fadeOut().parent('li').removeClass('open');
282                        parent_li.addClass('open').find('.sub-menu').fadeIn(600, function () {
283                            $("#wrapper_left_content").mCustomScrollbar('update');
284                        });
285                    }
286                };
287                setTimeout(submenu_children, 500);
288            }
289        }
290
291
292        fixscrollbar();
293
294        //offersmanager initialization
295        OffersManager.init();
296
297        //handle slideshow height
298        slideshow();
299        // SLIDESHOW
300        if ($('#slideshow .cycle').length > 0) {
301            doSlideshow('#slideshow .cycle');
302            picturefill();
303        }
304
305        //move bottom the seobar
306        moveSeobar();
307
308        // fancybox on gallery images
309        $('#photogallery').find('.fancy').fancybox({
310            padding: 0
311        });
312
313        // fancybox for blog images
314        $('.single-post').find('.fancy').fancybox({
315            padding: 0
316        });
317
318        // isotope filtering on gallery images
319        filterGallery();
320
321        //hotel cancel reservation
322        $('#cancel_book').on('click', function () {
323            var lang = document.idForm.langue.value;
324            if (typeof lang !== 'undefined') {
325                hhotelcancel(hotel_cname, lang);
326            } else {
327                hhotelcancel(hotel_cname);
328            }
329        });
330
331        //open-close the menu and handle the click on every manu-category
332        openMenu();
333        submenu();
334
335        //open shareThis at the bottom page
336        toggleShareBox();
337
338        //FAQ
339        if ($('.single_faq').length > 0) {
340            viewItemDetails('.single_faq', '.question', '.answer');
341        }
342
343        //JOB OFFER
344        if ($('.job_offer').length > 0) {
345            viewItemDetails('.job_offer', '.question', '.answer');
346        }
347
348        //activate the scroll bottom
349        if ($('.view-more-link').length > 0 || $('#main_book').length > 0) {
350            scrollPageDown();
351        }
352
353        //start all the snippets previously loaded
354        if (typeof snippets_to_load !== "undefined") {
355
356            for (var i = 0; i < snippets_to_load.length; i++) {
357                var FB = snippets_to_load[i][0],
358                    url = snippets_to_load[i][1],
359                    divdest = snippets_to_load[i][2];
360                window[FB].CrossCom.consume(url, divdest);
361            }
362        }
363
364        // Mobile book button
365        $('#main_book').click(function () {
366            if ($('html').hasClass('mobile') || $('html').hasClass('tablet')) {
367                if (is_availpro && typeof $AvailPro !== 'undefined') {
368                    $AvailPro.openBookingEngine();
369                } else {
370                    hhotelDispopriceFHP(hotel_cname, '', '', '', '', '', '', '');
371                }
372            }
373        });
374
375        //google maps multiple poi loading
376        if ((jQuery('#map_canvas_poi').length > 0) && (jQuery(window).width() >= 768)) {
377            initializeMap('map_canvas_poi', gmap_config);
378        }
379
380        // rooms
381        preview_rooms();
382
383        //change the pposition of text into homepage previews
384        previewIndex();
385
386    });
387
388    //////////////////////////////
389    //////CUSTOM FUNCTIONS
390
391    //This callback will be called when a snippet loads stuff inside our window.
392    OffersManager.callbacks.onSingle = function (selector, index) {
393
394        jQuery('.promotion').addClass('clearfix');
395
396        jQuery(selector).closest('.snippet').addClass('noloading');
397
398        jQuery(selector).find('.more a').removeAttr('onclick');
399
400        // build fancybox link
401        jQuery(selector).find('.promo-wrapper .more a, .promo-wrapper .title, .promo-wrapper .price, .promo-wrapper .image').on('click', function () {
402            var html = jQuery(this).closest('.promo-wrapper').find('.details').html();
403            if (typeof (html) == 'undefined') return;
404            html = '<div id="offer_details">' + html + '</div>';
405            jQuery.fancybox(html, {
406                padding: 0
407            });
408        });
409
410        jQuery(selector).find(".promotion .description").wrap("<div class='ellipsis'></div>");
411
412        if (jQuery('.rooms_offers').length > 0) {
413            // rooms page price
414            moveBookButton();
415        }
416
417        if (jQuery('#FB_hp_offer_0').length > 0) {
418            // rooms page price
419            moveBookButtonHome();
420        }
421
422        //change the pposition of text into homepage previews
423        previewIndex();
424    };
425
426    //in rooms page move the BOOK button
427    function moveBookButton() {
428        var buttons = jQuery('.snippet .promotion .button a');
429        buttons.addClass('book book_room');
430        buttons.each(function () {
431            var button = $(this);
432            var box = $(this).closest('.content.content_rooms');
433            // moving the button
434            button.appendTo(box);
435            // price!
436            var price = box.find('.rooms_offers .promotion > .price');
437            price.on('click', function () {
438                button.click();
439            });
440        });
441
442
443    }
444
445    //in homepage move BOOK button
446    function moveBookButtonHome() {
447        var buttons = jQuery('.snippet .promotion .button a');
448        buttons.addClass('book');
449        buttons.each(function () {
450            // moving the button
451            $(this).insertBefore($(this).closest('.content_preview').find('.info'));
452        });
453    }
454
455    //isotope filtering on gallery images
456    function filterGallery() {
457        if ($('#photogallery').length > 0) {
458            var $grid = $('.all_filter_gallery').isotope();
459
460            $('.filter-button-group').on('click', 'button', function () {
461                $('.filter-button-group button').removeClass('active');
462                $(this).addClass('active');
463                var filterValue = $(this).attr('data-filter'),
464                    newRel = filterValue.replace('.', '');
465
466                $grid.find(filterValue).find('.thumb').attr("rel", newRel);
467
468                $grid.isotope({filter: filterValue});
469            });
470        }
471    }
472
473    //resize the slideshow
474    function slideshow() {
475        if ($('#slideshow_container').size() > 0) {
476            if ($(window).width() >= 768) {
477                $('#slideshow_container').css({
478                    height: $(window).height() * 0.9 - $('#header').height()
479                });
480            }
481            resizeAndCenterImages('#slideshow .foto', 1705, 930);
482        }
483        guest_account();
484
485    }
486
487    //builds the slideshow
488    function doSlideshow(imagesContainerSelector) {
489
490        if (typeof (sshow_image_data) !== 'undefined' && sshow_image_data.length > 0) {
491            $.each(sshow_image_data, function (index, imgset) {
492                var img, slider = $('<div class="slide"/>');
493                if (typeof imgset['url_set'] === 'undefined' || imgset['url_set'] === false) {
494                    img = $('<img/>').attr('src', imgset['url_tiny']).attr('alt', imgset['title']);
495                } else {
496                    img = $('<img/>').attr('src', imgset['url_tiny']).attr('srcset', imgset['url_set']).attr('alt', imgset['title']);
497                }
498                slider.append(img);
499
500                $(imagesContainerSelector).append(slider);
501            });
502            //initialize deferred object for imagesLoaded
503            var dfd = $(imagesContainerSelector).imagesLoaded(function ($images, $proper, $broken) {
504                //$('.loading_sshow .total').html($images.length + '...');
505                //console.log('start loading');
506            });
507            //When all images are loaded...
508            dfd.always(function () {
509                if ((typeof (window.console) !== 'undefined') && (typeof (console.log) === 'function')) {
510                    //console.log('slideshow loaded');
511                }
512                resizeAndCenterImages(imagesContainerSelector, sshow_images_w, sshow_images_h);
513
514                $(window).resize(function () {
515                    resizeAndCenterImages(imagesContainerSelector, sshow_images_w, sshow_images_h);
516                });
517
518                if (sshow_image_data.length == 1) {
519                    $('.loading_sshow').html('').fadeOut(2000);
520                    //jQuery('#guestaccount_box').delay(5500).fadeIn(1000);
521
522                } else {
523
524                    $('#slideshow_container .pager').hide();
525
526                    $('.loading_sshow').html('').fadeOut(2000);
527                    //jQuery('#guestaccount_box').delay(5500).fadeIn(1000);
528                    var slide_speed = (sspeed !== '') ? parseInt(sspeed, 10) : 500;
529                    var slide_timeout = (stimeout !== '') ? parseInt(stimeout, 10) : 2000;
530                    $(imagesContainerSelector).cycle({
531                        speed: parseInt(slide_speed, 10),
532                        timeout: parseInt(slide_timeout, 10),
533                        slides: ' > div ',
534                        pager: '.pager',
535                        swipe: true
536                    });
537
538                    setTimeout(function () {
539                        $('#placeholder_slide').addClass('cancel');
540                        $('#slideshow_container .pager').fadeIn();
541                        $('#guestaccount_box').fadeIn();
542                    }, slide_timeout - 50)
543                }
544                slideshowPlaceholder();
545            });
546        }
547    }
548
549    //sorrow
550    function resizeAndCenterImages(imagesContainerSelector) {
551        if ((typeof (window.console) !== 'undefined') && (typeof (console.log) === 'function')) {
552            //console.log('slideshow resiz '+imagesContainerSelector.length);
553        }
554
555        var slides = $(imagesContainerSelector).find('>div'),
556            screen_width = $(imagesContainerSelector).width(), screen_height = $(imagesContainerSelector).height(),
557            image_width = sshow_images_w,
558            image_height = sshow_images_h,
559            imageWRatio = image_width / image_height,
560            imageHRatio = image_height / image_width, res_w, res_h, res_ox, res_oy;
561
562        if ((res_h = screen_height) && (res_w = res_h * imageWRatio) >= screen_width) {
563            ;
564        } else {
565            if ((res_w = screen_width) && (res_h = res_w * imageHRatio) >= screen_height) {
566                ;
567            }
568        }
569
570        res_ox = (res_w == screen_width ? 0 : '-' + ((res_w - screen_width) / 2));
571        res_oy = (res_h == screen_height ? 0 : '-' + ((res_h - screen_height) / 2));
572        $.each(slides, function (index, slide) {
573            $(slide).find('img').css({
574                'width': res_w + 'px',
575                'height': res_h + 'px',
576                'left': res_ox + 'px',
577                'top': res_oy + 'px'
578            });
579        });
580
581    }
582
583    //this function set the position of the text inside the previews
584    function previewIndex() {
585        if ($('html').hasClass('index')) {
586            var pages = $('.preview_page');
587
588            pages.each(function () {
589                var page = $(this),
590                    pageContent = page.find('.content');
591                pageContent.css({
592                    'margin-top': (page.height() - pageContent.outerHeight()) / 2
593                });
594            });
595        }
596    }
597
598    //this function set the position of the text inside the slideshow
599    function slideshowPlaceholder() {
600        $('#placeholder_slide_text .content').css({
601            'margin-top': ($('#placeholder_slide').height() - $('#placeholder_slide_text .content').outerHeight()) / 2
602        });
603        if ($('#logo_index').length > 0) {
604            var box_h = parseInt($('#logo_index').height());
605            var img_h = parseInt($('#logo_index img').outerHeight());
606            if (box_h > img_h) {
607                var margin = parseInt((box_h - img_h) / 2);
608                $('#logo_index img').css('margin-top', margin + 'px');
609
610            }
611        }
612    }
613
614    //open the menu
615    function openMenu() {
616        var btn = $("#open_menu");
617        if (btn.size() > 0) {
618            var wrapper = $("#wrapper"),
619                header = $("#header"),
620                mClass = "open";
621            if ($(window).width() < 1200) {
622                btn.on('click', function () {
623                    if (!wrapper.hasClass(mClass)) {
624                        wrapper.addClass(mClass);
625                        header.addClass(mClass);
626                    } else {
627                        wrapper.removeClass(mClass);
628                        header.removeClass(mClass);
629                    }
630                });
631            }
632        }
633    }
634
635    //open-close the sub-menu items
636    function submenu() {
637        var hasChildren = $('#primary_menu ul.menu > li.menu-item-has-children');
638
639        hasChildren.each(function () {
640            var element = $(this),
641                ul = element.find('ul'),
642                text = element.find('>a').text(),
643                url = element.find('>a').attr('href'),
644                new_element = $('<li/>').append($('<a/>', {'href': url}).html(text));
645            ul.prepend(new_element);
646        });
647
648        hasChildren.find('> a').on('click', function (e) {
649            e.preventDefault();
650            var parent_li = $(this).parent('li');
651            if (!parent_li.hasClass('open')) {
652                $('#primary_menu .sub-menu').fadeOut().parent('li').removeClass('open');
653                parent_li.addClass('open').find('.sub-menu').fadeIn(600, function () {
654                    $("#wrapper_left_content").mCustomScrollbar('update');
655                });
656
657            } else {
658                parent_li.removeClass('open').find('.sub-menu').fadeOut(600, function () {
659                    $("#wrapper_left_content").mCustomScrollbar('update');
660                });
661            }
662        });
663    }
664
665    function fixscrollbar() {
666        var left_wrapper_container = $('#wrapper_left_content').outerHeight(true);
667        var menu_height = $('#primary_menu').outerHeight(true) + $('#logo').outerHeight(true);
668        if ($('.mCustomScrollbar').length > 0) {
669            if (left_wrapper_container - menu_height >= 0) {
670                $('#primary_menu').css({
671                    'display': 'block',
672                    'margin': 'auto',
673                    'float': 'unset'
674                });
675                $('#logo img').css({
676                    'display': 'block',
677                    'margin': 'auto'
678                });
679            } else {
680                $('#primary_menu').css({
681                    'width': 190 + 'px',
682                    'float': 'left'
683                });
684                $('#logo img').css({
685                    'width': 190 + 'px',
686                    'margin': 'unset'
687                });
688            }
689        }
690    }
691
692    function childrenPreviewHeight() {
693        var items = $('.page_preview .content');
694        var window_width = $(window).width();
695        var is_mobile = (window_width < 768);
696        if (!is_mobile && items.size() > 0 && !items.hasClass('content_rooms')) {
697            var max_height = 0;
698            items.each(function (k, item) {
699                var height = $(item).outerHeight(true);
700                if (height > max_height) {
701                    max_height = height;
702                }
703            });
704            items.each(function (k, item) {
705                $(item).css({
706                    'min-height': max_height
707                });
708            });
709
710        }
711    }
712
713    // jobs and faq additional opening page
714    function viewItemDetails(viewItemDetails_container, viewItemDetails_link, viewItemDetails_description) {
715
716        $(viewItemDetails_link).on('click', function () {
717            if ($(this).hasClass('open')) {
718                $(this).closest(viewItemDetails_container).find(viewItemDetails_description).stop().animate({
719                    height: 0
720                }, 400);
721                $(this).removeClass('open');
722                $(this).closest(viewItemDetails_container).removeClass('open');
723            } else {
724                var height = $(this).closest(viewItemDetails_container).find(viewItemDetails_description).find('> div').outerHeight(true);
725                $(viewItemDetails_description).stop().animate({height: 0}, 400);
726                $(viewItemDetails_container).removeClass('open');
727                $(viewItemDetails_link).removeClass('open');
728
729                $(this).closest(viewItemDetails_container).find(viewItemDetails_description).stop().animate({height: height}, 400).closest(viewItemDetails_container).find(viewItemDetails_link).addClass('open');
730                $(this).closest(viewItemDetails_container).addClass('open');
731            }
732        });
733    }
734
735    //function to scroll down
736    function scrollPageDown() {
737        var window_width = $(window).width();
738        if (!(window_width >= 768 && window_width < 992) && !(window_width < 768)) {
739
740            /*if ($('#previews_rooms').length > 0) {
741                var top = $('#previews_rooms').offset().top - $('#header').height();
742            }
743            else */
744            if ($('#main_book').length > 0) {
745                var top = $('#booking_wrapper').offset().top;
746            } else {
747                var top = $('#booking_wrapper').offset().top - $('#header').height();
748            }
749            $('.view-more-link').on('click', function () {
750                $('html, body').animate({
751                    scrollTop: top
752                });
753            });
754            // QS
755            $('#main_book').on('click', function () {
756                var bf_top = $('#booking_wrapper').offset().top - $('#header').height();
757                $('html, body').animate({
758                    scrollTop: bf_top
759                });
760                if ($('html').hasClass('mobile')) {
761                    $('#booking_form form').trigger('submit');
762                }
763            });
764        }
765    }
766
767    //move seobar to the bottom of the page
768    function moveSeobar() {
769        var seobar = $('.seobar');
770        var footer_menu = $('#footer');
771        if (seobar && footer_menu) {
772            seobar.appendTo(footer_menu);
773        }
774    }
775
776    function preview_rooms() {
777        var items = $('.page_preview .content.content_rooms');
778        if (items.length > 0) {
779            items.each(function () {
780                var item = $(this);
781                var description = item.find('.description').outerHeight(true);
782                var info = item.find('.info').outerHeight(true);
783                var padding = 40;
784                var bottom = -parseInt(description + info + padding);
785                if ($(window).width() >= 1200) {
786                    item.css({
787                        'bottom': bottom
788                    });
789                } else {
790                    item.css({
791                        'bottom': 'auto'
792                    });
793                }
794            })
795        }
796    }
797
798
799})(jQuery);
800
801//
802function homepage_pop_up() {
803    // elems
804    var home_pop_up = jQuery("#home_pop_up");
805    if (home_pop_up.length == 0) return false;
806    // if (jQuery(window).width()<768) return false;
807    var html = home_pop_up.find('.home_pop_up');
808    setTimeout(function () {
809        jQuery.fancybox({
810            content: html
811        });
812    }, 500);
813
814}
815
816//addthis
817function toggleShareBox() {
818    if (jQuery('.addthis_inline_share_toolbox').is(':visible')) {
819        jQuery('.addthis_inline_share_toolbox').fadeOut('slow');
820    } else {
821        jQuery('.addthis_inline_share_toolbox').fadeIn('fast');
822    }
823}
824
825//guest_account
826function guest_account() {
827
828    // return false;
829    var guestaccount_box = jQuery('#guestaccount_box');
830    if (guestaccount_box.size() == 0) return false;
831    // vars
832
833    var is_homepage = jQuery('html').hasClass('index');
834    var is_location = jQuery('html').hasClass('location_page');
835    var WH = jQuery(window).height();
836    var WW = jQuery(window).width();
837    var header_h = jQuery('#header_container').outerHeight();
838    var ss_height = jQuery('#slideshow_container').outerHeight();
839    var guestaccount_box_top;
840    var margin_b;
841    var guest_account_cb = setInterval(function () {
842        if ($('#guestaccount_box').size() > 0) {
843            clearInterval(guest_account_cb);
844
845
846            var guestaccount_box_h = guestaccount_box.outerHeight();
847
848            //not mobile not phone
849            if (WW > 992 && is_homepage) {
850                guestaccount_box_top = parseInt(ss_height - guestaccount_box_h - 200, 10);
851            }
852
853            //tablet portrait
854            if (WW >= 768 && WW < 992) {
855                guestaccount_box_top = parseInt(ss_height - guestaccount_box_h - 215, 10);
856
857            }
858            //phone
859            if (WW < 768) {
860                if (is_homepage) {
861                    guestaccount_box_top = 50 + header_h;
862                }
863            }
864
865            // // under mobile
866            // if (WW < 992) {
867            //     margin_b = guestaccount_box_h;
868            // } else {
869            //     margin_b = 'auto';
870            // }
871            jQuery('#slideshow_container').css({
872                'margin-bottom': margin_b
873            });
874
875            guestaccount_box.css({
876                'top': guestaccount_box_top
877            });
878
879
880        }
881    }, 100);
882}

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.