PageSourceSearch

https://www.yournature.be/wp-content/themes/pro-theme-munich/js/main.js?ver=1.0

js yournature.be collected 2026-10-08 16:21:35 UTC 48,339 bytes, 1,300 lines download raw bytes

1////////////// JQUERY CONFLICT NO PLEASE
2
3
4(function($){
5    ///////////////////////////////////
6    ///////     FUNCTIONS     /////////
7    ///////////////////////////////////
8
9    // debug
10    window.debug = window.debug || function (log) {
11        if (typeof (log) === 'undefined') return;
12        if ((typeof (window.console) !== 'undefined') && (typeof (console.log) === 'function')) {
13            console.log(log);
14        }
15    };
16
17    // callback helper
18    window.callback_all = window.callback_all || function (jQueryEl, cback) {
19        var counter = 0;
20        return function () {
21            counter++;
22            if (counter < jQueryEl.length) return;
23            cback();
24        }
25    };
26
27    // check if object is empty
28    window.isEmpty = function (obj) {
29
30        // null and undefined are "empty"
31        if (obj == null) return true;
32
33        // Assume if it has a length property with a non-zero value
34        // that that property is correct.
35        if (obj.length > 0) return false;
36        if (obj.length === 0) return true;
37
38        // If it isn't an object at this point
39        // it is empty, but it can't be anything *but* empty
40        // Is it empty?  Depends on your application.
41        if (typeof obj !== "object") return true;
42
43        // Otherwise, does it have any properties of its own?
44        // Note that this doesn't handle
45        // toString and valueOf enumeration bugs in IE < 9
46        for (var key in obj) {
47            if (hasOwnProperty.call(obj, key)) return false;
48        }
49
50        return true;
51    };
52
53    // Main slideshow
54    window.detectIE = window.detectIE || function () {
55        var ua = window.navigator.userAgent;
56        var msie = ua.indexOf('MSIE ');
57        if (msie > 0) {
58            return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
59        }
60    };
61
62    //Detect IOS
63    window.detectIOS = window.detectIOS || function () {
64        if (/iP(hone|od|ad)/.test(navigator.platform)) {
65            // supports iOS 2.0 and later: <http://bit.ly/TJjs1V>
66            var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
67            return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
68        }
69    };
70
71    /*  concat values offering */
72    window.concatValues = window.concatValues || function (obj) {
73        var value = '';
74        for (var prop in obj) {
75            value += obj[prop];
76        }
77        return value;
78    };
79
80    // check for mobiles and tablets
81    window.refresh_size_queries = window.refresh_size_queries || function () {
82        var classes = [];
83        var window_width = jQuery(window).width();
84        var window_height = jQuery(window).height();
85        var html = jQuery('html');
86
87        window.is_phone = (window_width < 768);
88        // window.is_phone = (window.matchMedia("(max-width: 767px)").matches);
89        window.is_mobile = (window_width < 992);
90        // window.is_mobile = (window.matchMedia("(max-width: 991px)").matches);
91        window.is_tablet_portrait = (window_width >= 768 && window_width < 992);
92        // window.is_tablet_portrait = (window.matchMedia("(min-width: 768px) and (max-width: 991px)").matches);
93        window.is_tablet_landscape = (window_width >= 992 && window_width < 1200 && window_height <= 768);
94        // window.is_tablet_landscape = (window.matchMedia("(min-width: 768px) and (max-width: 991px and max-height: 768px)").matches);
95        // window.is_tablet = is_tablet_portrait || is_tablet_landscape;
96        window.is_desktop = (window_width >= 992);
97        // window.is_desktop = (window.matchMedia("(min-width: 992px)").matches);
98        window.is_desktop_large = (window_width >= 1200);
99        // window.is_large_desktop = (window.matchMedia("(min-width: 1200px)").matches);
100
101        if (window.is_phone) {
102            classes.push('mq_phone');
103        }
104        if (window.is_mobile) {
105            classes.push('mq_mobile');
106        }
107        if (window.is_tablet_portrait) {
108            classes.push('mq_tablet_portrait');
109        }
110        if (window.is_tablet_landscape) {
111            classes.push('mq_tablet_landscape');
112        }
113        if (window.is_tablet) {
114            classes.push('mq_tablet');
115        }
116
117        html
118            .removeClass('mq_phone')
119            .removeClass('mq_mobile')
120            .removeClass('mq_tablet_portrait')
121            .removeClass('mq_tablet_landscape')
122            .removeClass('mq_tablet')
123            .addClass(classes.join(' '));
124
125        // theme adds
126        window.is_index = html.hasClass('homepage');
127        window.is_internal_page = html.hasClass('internal_page');
128        window.is_location = html.hasClass('location_page');
129    };
130
131    ///////////////////////////////////
132    //////// THEME FUNCTIONS //////////
133    ///////////////////////////////////
134
135    ////////////////////////////////////////////////////////
136    // COMMONS
137    ////////////////////////////////////////////////////////
138
139
140    // creating breakpoints
141    window.create_breakpoint = window.create_breakpoint || function() {
142        // check
143        if(typeof sshow_image_sizes === 'undefined' || sshow_image_sizes.length===0 ) return false;
144        // vars
145        var breakpoints = [];
146        var current_breakpoint = 'max';
147        var sizes = sshow_image_sizes;
148        var ww = $(window).width();
149        //
150        for (var i in sizes) {
151            if (sizes.hasOwnProperty(i)) {
152                if (i !== 'default' && i!=='max') {
153                    breakpoints.push(parseInt(i,10));
154                }
155            }
156        }
157        if (breakpoints.length > 0) {
158            breakpoints.sort(function(a,b){ return a - b; });
159            for (var k = 0; k < breakpoints.length; k++) {
160                if (ww <= breakpoints[k]) {
161                    current_breakpoint = breakpoints[k];
162                    break;
163                }
164            }
165        }
166        return current_breakpoint;
167    };
168
169    // Post-loads images and starts slideshow
170    window.doSlideshow = window.doSlideshow || function(imagesContainerSelector) {
171        // vars
172        var sshow = jQuery(imagesContainerSelector);
173        // checks
174        if(typeof sshow === 'undefined' || sshow.size()===0 ) return false;
175        if (typeof(sshow_image_data) === 'undefined' || sshow_image_data.length === 0) return false;
176        // config
177        var ss_speed = (typeof(sspeed) !== 'undefined' && jQuery.trim(sspeed) !== '') ? sspeed : 2000;
178        var ss_timeout = (typeof(stimeout) !== 'undefined' && jQuery.trim(stimeout) !== '') ? stimeout : 5000;
179
180        var loading = jQuery('.loading_sshow');
181        // calculating size
182        var current_breakpoint = window.create_breakpoint();
183
184        // bind the mouseenter
185        $.each(sshow_image_data, function (index, imgset) {
186            // config
187            // images set
188            var urls = imgset['url_set'];
189            // do the other images
190            var id = imgset['ID'];
191            var img = jQuery('<img />').attr('src', imgset['url_set']['max']).attr('alt', imgset['title']);
192            var slider = jQuery('<div class="slide" data-id="'+id+'" />');
193            var img_cont = jQuery('<div class="slide_image">');
194            // appending no script
195            slider.append($('<noscript>').append(img));
196            img_cont.css('background-image', 'url('+urls[current_breakpoint]+')');
197            // appending img
198            slider.append(img_cont);
199            // front page
200            if(jQuery('.slideshow_container').hasClass('homepage')) {
201                var img_blur = jQuery('<div class="blur">');
202                var img_blur_wrapper = jQuery('<div class="blur_wrapper hidden-xs hidden-sm">');
203                img_blur.css('background-image', 'url('+urls[current_breakpoint]+')');
204                img_blur_wrapper.append(img_blur);
205                slider.append(img_blur_wrapper);
206            }
207            // appending images to sshow
208            sshow.append(slider);
209        });
210        //  sshowwww
211        if (sshow_image_data.length === 1) {
212            loading.fadeOut(2000);
213        } else {
214            if (!sshow.hasClass('slick-initialized')) {
215                // On init event
216                sshow.on('init', function(event, slick, direction){
217                    loading.fadeOut(500);
218                });
219                sshow.slick({
220                    rows: 0,
221                    arrows: false,
222                    dots: false,
223                    autoplay: true,
224                    autoplaySpeed: ss_timeout,
225                    speed: ss_speed,
226                    fade: true,
227                    pauseOnHover: false,
228                    pauseOnFocus: false,
229                    infinite: true,
230                    responsive: [
231                        {
232                            breakpoint: 768,
233                            settings: {
234                                arrows: false
235                            }
236                        }
237                    ]
238                });
239            }
240        }
241    };
242    // SS height function
243    window.slideshowHeight = window.slideshowHeight || function(imagesContainerSelector) {
244        // check
245        var slideshowContainer = $('.slideshow_container');
246        if (slideshowContainer.length === 0) return false;
247        // vars
248        var height = $(window).height();
249        // // check
250        // if (is_mobile && is_index) {
251        //      height = 'calc(80vh - 60px)';
252        // } else if (is_index) {
253        //     height = '80vh';
254        // } else {
255        //     height = '70vh';
256        // }
257
258
259        if (is_mobile) {
260             height = 'calc('+ slideshow_height +' - 60px)';
261        } else {
262            height = slideshow_height;
263        }
264        // go height
265        slideshowContainer.css({
266            'height': height,
267            'max-height': '100%'
268        });
269    };
270
271    // scroll blur
272    window.scroll_blur = window.scroll_blur || function(){
273        var sshow_wrap = jQuery('.slideshow_container');
274        var blurs = sshow_wrap.find('.blur_wrapper');
275        if (blurs.length === 0) return false;
276        // vars
277        var w_top = $(window).scrollTop();
278        // loop
279        blurs.each(function(){
280            var blur = $(this);
281            var blur_img = blur.find('.blur');
282            // if i scroll i want to follow the header
283            if(w_top>300){
284                // no following
285                blur.css('top',0+'px');
286            } else {
287                // following
288                blur.css('top',w_top+'px');
289                // var mtop = w_top;
290                blur_img.css('margin-top','-'+w_top+'px');
291            }
292        });
293    };
294
295    // scrolling header
296    window.headerScroll = window.headerScroll || function () {
297        // check
298        var header = $('#header');
299        if (header.length === 0) return false;
300        // vars
301        var mClass = 'short';
302        var breakpoint = 300;
303        //
304        if (!window.is_mobile) {
305            if ($(window).scrollTop() > breakpoint) {
306                header.addClass(mClass);
307            } else {
308                header.removeClass(mClass);
309            }
310        } else {
311            header.removeClass(mClass);
312        }
313    };
314
315    // mobile menu
316    window.openSidebar = window.openSidebar || function () {
317        var btn = $('#header #open_menu');
318        var btnClose = $('.close');
319        var sidebar = $('#sidebar');
320        var overlay = $('#sidebar_overlay');
321        var mClass = 'visible';
322        if(navigator.userAgent.toLowerCase().match(/(ipad|iphone)/)){
323            var ios_version = detectIOS();
324        }
325        //
326        // if (window.is_mobile) {
327            btn.click(function () {
328                if (!sidebar.hasClass(mClass)) {
329                    sidebar.addClass(mClass);
330                    overlay.addClass(mClass);
331                    $('html').addClass('noscroll');
332                    if(navigator.userAgent.toLowerCase().match(/(ipad|iphone)/)) {
333                        if (ios_version[0] <= 12) {
334                            $('html').addClass('ios_old_version');
335                        }
336                    }
337                }
338            });
339            btnClose.click(function () {
340                if (sidebar.hasClass(mClass)) {
341                    sidebar.removeClass(mClass);
342                    overlay.removeClass(mClass);
343                    $('html').removeClass('noscroll');
344                    if(navigator.userAgent.toLowerCase().match(/(ipad|iphone)/)) {
345                        if (ios_version[0] <= 12) {
346                            $('html').removeClass('ios_old_version');
347                        }
348                    }
349                }
350            });
351            overlay.click(function () {
352                if (sidebar.hasClass(mClass)) {
353                    sidebar.removeClass(mClass);
354                    overlay.removeClass(mClass);
355                    $('html').removeClass('noscroll');
356                    if(navigator.userAgent.toLowerCase().match(/(i
356pad|iphone)/)) {
357                        if (ios_version[0] <= 12) {
358                            $('html').removeClass('ios_old_version');
359                        }
360                    }
361                }
362            });
363        // }
364    };
365
366    // function for submenu
367    window.pageSubmenu = window.pageSubmenu || function() {
368        //
369        var menu = $('#page_submenu ul');
370        if (menu.size() > 0) {
371            menu.find('>li>a').each(function () {
372                var link = $(this);
373                link.click(function () {
374                    var goTo = '#' + link.attr('data-scroll'),
375                        top_part = $('#header').height(),
376                        top = $(goTo).offset().top - top_part - menu.height();
377                    $('html,body').stop().animate({scrollTop: top}, 500);
378                });
379            })
380        }
381    };
382
383    // function for submenu scroll
384    window.pageMenuScroll = window.pageMenuScroll || function() {
385        var mClass = 'fixed',
386            header = $('#page_submenu'),
387            breakpoint = $('.slideshow_container').height() - $('#primary_menu').height();
388        if (!window.is_phone && header.size() > 0) {
389            if ($(window).scrollTop() > breakpoint) {
390                header.addClass('fixed')
391            } else {
392                header.removeClass(mClass)
393            }
394        }
395    };
396
397    // gallery function
398    window.minigallery = window.minigallery || function() {
399        //
400        var gallery = $('.gallery');
401        //
402        if (gallery.size() > 0) {
403            gallery.slick({
404                rows: 0,
405                infinite: true,
406                speed: 300,
407                slidesToShow: 4,
408                slidesToScroll: 4,
409                centerMode: false,
410                variableWidth: false,
411                nextArrow: '<a href="javascript:;" class="arrow next"><span class="icon"></span></a>',
412                prevArrow: '<a href="javascript:;" class="arrow prev"><span class="icon"></span></a>',
413                dots: true,
414                responsive: [
415                    {
416                        breakpoint: 1200,
417                        settings: {
418                            slidesToShow: 3,
419                            slidesToScroll: 3,
420                        }
421                    },
422                    {
423                        breakpoint: 768,
424                        settings: {
425                            slidesToShow: 1,
426                            slidesToScroll: 1,
427                        }
428                    }
429                ]
430            });
431            if(typeof myLazyLoad !== 'undefined'){
432                myLazyLoad.update();
433            }
434        }
435    };
436
437
438    // gallery page function
439    window.Managegallery = window.Managegallery || function (){
440        if ($('#gallery').size() > 0) {
441            var filters = {};
442            var $grid = $('#gallery');
443            // var $imgs = $("img.lazy");
444
445            // go isotope
446            $grid.isotope({
447                itemSelector: '.thumb_wrap',
448                percentPosition: true,
449                masonry: {
450                    // use element for option
451                    columnWidth: '.thumb_wrap'
452                }
453            });
454
455            //filter desktop
456            var images = $('.thumb-gallery');
457            $('.filter-button-group').on('click', 'button', function () {
458                $('.filter-button-group button').removeClass('active');
459                $(this).addClass('active');
460                var filterValue = $(this).attr('data-filter');
461                if(filterValue !== '*'){
462                    images.each(function(){
463                        var cat = $(this).attr('data-cat');
464                        $(this).attr('data-fancybox',cat);
465                    });
466                } else {
467                    images.each(function(){
468                        $(this).attr('data-fancybox','gallery');
469                    });
470                }
471                $grid.isotope({filter: filterValue});
472            });
473            //filter mobile
474            $('.filter_photo').change(function () {
475                var filterValue = $(this).val();
476                if(filterValue !== '*'){
477                    images.each(function(){
478                        var cat = $(this).attr('data-cat');
479                        $(this).attr('data-fancybox',cat);
480                    });
481                } else {
482                    images.each(function(){
483                        $(this).attr('data-fancybox','gallery');
484                    });
485                }
486                $grid.isotope({filter: this.value});
487            });
488        }
489    };
490
491    window.initializeMap = window.initializeMap || function(div, gmap_config) {
492        if (typeof(div) === "undefined") div = "map_canvas";
493        // general vars
494        var center;
495        var marker_icon;
496        var drag  =  (jQuery(window).width()>767) ? gmap_config.map_drag : false ;
497
498        // for calculate routes
499        directionsService = new google.maps.DirectionsService();
500        directionsDisplay = new google.maps.DirectionsRenderer();
501
502        //
503        if (typeof(map_marker)!=='undefined' && map_marker!=null) {
504            // center map is the hotel coords
505            center = new google.maps.LatLng(map_marker.lat, map_marker.lng);
506        }
507        //
508        var myOptions = {
509            //map type
510            mapTypeId: google.maps.MapTypeId[gmap_config.maptype.toUpperCase()],
511            mapTypeControl: gmap_config.mapTypeControl,
512            mapTypeControlOptions: {
513                position: google.maps.ControlPosition.TOP_RIGHT
514            },
515            // position
516            center: center,
517            //zoom
518            zoom: gmap_config.map_zoom,
519            zoomControl: gmap_config.map_zoom_control,
520            zoomControlOptions: {
521                position: google.maps.ControlPosition[gmap_config.zoom_control_position]
522            },
523            // scroll wheel
524            scrollwheel: gmap_config.scrollwheel,
525
526            // default pan control
527            panControl: false,
528            // scale control - image with the scale index (m,km,etc)
529            scaleControl: false,
530            // 	streetview controls
531            streetViewControl: gmap_config.streetViewControl,
532            streetViewControlOptions: {
533                position: google.maps.ControlPosition.RIGHT_CENTER
534            },
535            // draggable for mobile
536            draggable: drag
537
538        };
539
540        // do map!
541        var map = new google.maps.Map(document.getElementById(div), myOptions);
542        // i need in the cloud
543        window.map = map;
544        // window.centermap = center;
545        // set directions elemtens
546        directionsDisplay.setMap(map);
547        directionsDisplay.setPanel(document.getElementById('map_directions_content'));
548
549        // hotel marker
550        if(typeof map_marker != 'undefined' && map_marker != null) {
551            marker_icon = (typeof map_marker.marker !='undefined' && map_marker.marker !='') ? map_marker.marker : theme_dir+'/images/marker.png';
552            var marker = new google.maps.Marker({
553                position			:	new google.maps.LatLng(map_marker.lat, map_marker.lng),
554                map					:	map,
555                title				:	map_marker.title,
556                icon : {
557                    url: marker_icon ,
558                    size: new google.maps.Size(71, 93) ,
559                    anchor: new google.maps.Point(30, 81)
560                }
561            });
562
563            var map_marker_infowindow = new google.maps.InfoWindow({
564                content				: map_marker.html
565            });
566            window.map_marker_infowindow = map_marker_infowindow;
567            google.maps.event.addListener(marker, 'click', (function(marker) {
568                return function() {
569                    if(window.prev_infowindow){
570                        window.prev_infowindow.close();
571                    }
572                    window.prev_infowindow = map_marker_infowindow;
573                    window.map_marker_infowindow.open(map, this);
574                }
575            })(marker));
576        }
577
578        var styles = [{
579            "featureType": "poi",
580            "elementType": "all",
581            "stylers": [{
582                "visibility": "off"
583            }]
584        },{
585            "featureType": "poi",
586            "elementType": "geometry",
587            "stylers": [{
588                "visibility": "off"
589            }]
590        }, {
591            "featureType": "poi",
592            "elementType": "labels",
593            "stylers": [{
594                "visibility": "off"
595            }]
596        }];
597        map.setOptions({styles: styles});
598
599        google.maps.event.addDomListener(window, "resize", function () {
600            var center = map.getCenter();
601            google.maps.event.trigger(map, "resize");
602            map.setCenter(center);
603        });
604
605    };
606
607    //calcRoute retrive 3 parameters from thr DOM and calculate the directions : start/end/travelMode
608    window.calcRoute = window.calcRoute || function(start) {
609
610        // remove previous message if present
611        if (jQuery('.itineraryPanelWrapper').length > 0) {
612            jQuery('.itineraryPanelWrapper').remove();
613        }
614        // delete previous results
615        if (typeof directionsDisplay === 'undefined') {
616            directionsDisplay = new google.maps.DirectionsRenderer();
617        }
618        //reset close button display
619        jQuery(".close_map.bottom").css("display", "inherit");
620
621        //
622        jQuery('#map_directions').fadeIn();
623
624        directionsDisplay.setPanel(null);
625        directionsDisplay.setMap(map);
626        // directionsDisplay.setOptions({suppressMarkers: true});
627        directionsDisplay.setPanel(document.getElementById('map_directions_content'));
628
629        //MESSAGES to display
630        var ok_message = document.createElement('div');
631        var empty_message = document.createElement('div');
632        var not_found_message = document.createElement('div');
633        var err_message = document.createElement('div');
634        // putting classes
635        ok_message.className = 'itineraryPanelWrapper';
636        empty_message.className = 'itineraryPanelWrapper';
637        not_found_message.className = 'itineraryPanelWrapper';
638        err_message.className = 'itineraryPanelWrapper';
639        // putting html
640        ok_message.innerHTML = ok_message_html;
641        empty_message.innerHTML = empty_message_html;
642        not_found_message.innerHTML = not_found_message_html;
643        err_message.innerHTML = err_message_html;
644
645        //document.getElementById("map_directions_content").appendChild(intro);
646
647        // TRAVEL MODE
648        var selectedMode;
649        if(jQuery('.itinerary_mode.active').length>0) {
650            selectedMode = jQuery('.itinerary_mode.active').attr('data-travelmode');
651        } else {
652            selectedMode = gmap_config.travel_mode;
653        }
654
655        // START
656        if(typeof start === 'undefined' || start == '') {
657            start = jQuery('input[name=start]').val();
658        }
659        if (start == '') {
660            document.getElementById("map_directions_content").appendChild(empty_message);
661            directionsDisplay.setPanel(null);
662            directionsDisplay.setMap(null);
663            map.setZoom(gmap_config.map_zoom);
664            //  map.setCenter(new google.maps.LatLng(center[0], center[1]));
665            jQuery(".close_map.bottom").css("display", "none");
666
667        }  else {
668            // new google.maps.LatLng(map_marker.lat, map_marker.lng),
669            var end = ''+map_marker.lat+','+ map_marker.lng;
670            var request = {
671                origin: start,
672                destination: end,
673                travelMode: google.maps.TravelMode[selectedMode]
674            };
675
676            directionsService.route(request, function (response, status) {
677                if (status == google.maps.DirectionsStatus.OK) {
678                    directionsDisplay.setDirections(response);
679                    document.getElementById("map_directions_content").appendChild(ok_message);
680
681                } else if (status == google.maps.DirectionsStatus.NOT_FOUND) {
682                    document.getElementById("map_directions_content").appendChild(not_found_message);
683                    directionsDisplay.setPanel(null);
684                    directionsDisplay.setMap(null);
685                    map.setZoom(gmap_config.map_zoom);
686                    map.setCenter(google.maps.LatLng(map_marker.lat, map_marker.lng));
687                    jQuery(".close_map.bottom").css("display", "none");
688                } else {
689                    document.getElementById("map_directions_content").appendChild(err_message);
690                    directionsDisplay.setPanel(null);
691                    directionsDisplay.setMap(null);
692                    map.setZoom(gmap_config.map_zoom);
693                    map.setCenter(google.maps.LatLng(map_marker.lat, map_marker.lng));
694                    jQuery(".close_map.bottom").css("display", "none");
695                }
696            });
697        }
698    };
699
700    //////////////////////////////////////////////////////////////
701    // multi markers map code
702    //////////////////////////////////////////////////////////////
703
704    window.take_pois = window.take_pois || function(category) {
705        // checks
706        if(typeof category === 'undefined' || typeof markers === 'undefined' || markers.length==0 )  return false;
707        // initialize
708        var toret = [];
709        // i cycle all the pois
710        jQuery.each(markers,function(index,el){
711            // check if i have categories
712            if(typeof el.categories !== 'undefined' ) {
713                // is an array
714                jQuery.each(el.categories,function(index,cat){
715                    if(cat.slug == category){
716                        toret.push(el);
717                    }
718                });
719            }
720        });
721        return toret;
722    };
723
724    window.create_markers = window.create_markers || function(pois) {
725        // checks
726        if(typeof pois === 'undefined' )  return false;
727        // initialize
728        var toret = [];
729        window.visible_markers = [];
730        window.visible_infowindows_markers = [];
731        // cycle
732        jQuery.each(pois,function(index,el){
733            var is_hotel = (typeof el.coords != 'undefined');
734            // icon
735            var image = {
736                url: el.marker,
737                size: is_hotel ? new google.maps.Size(71, 93) : new google.maps.Size(44, 58),
738                anchor: is_hotel ? new google.maps.Point(30, 81) : new google.maps.Point(22, 52)
739            };
740            var marker = new google.maps.Marker({
741                position: new google.maps.LatLng(el.lat, el.lng),
742                map: null,
743                icon: image
744            });
745            var callback = (function(marker_id) {
746                return function() {
747                    if( typeof prev_infowindow != 'undefined') {
748                        prev_infowindow.close();
749                    }
750                    show_marker_infowindow(marker_id);
751                }
752            })(el.ID);
753            marker.addListener('click', callback);
754            // push markers
755            toret.push(marker);
756            visible_markers[el.ID] = marker;
757
758            // infowinfows
759            var marker_infowindow = new google.maps.InfoWindow({
760                content				: el.html
761            });
762            visible_infowindows_markers[el.ID] = marker_infowindow;
763        });
764        // return
765        return toret;
766    };
767
768    // show map markers
769    window.show_markers = window.show_markers || function(markers) {
770        // checks
771        if(typeof markers === 'undefined' )  return false;
772        // intialize
773        var bounds = new google.maps.LatLngBounds();
774        var toret = [];
775        var map = window.map;
776        // cycle
777        jQuery.each(markers,function(index,el){
778            el.setMap(map);
779            bounds.extend(el.getPosition());
780        });
781        if(markers.length>1) {
782            map.fitBounds(bounds);
783        } else {
784            map.setZoom(gmap_config.map_zoom);
785            map.setCenter(google.maps.LatLng(map_marker.lat,map_marker.lng));
786        }
787    };
788
789    // show marker infowindos
790    window.show_marker_infowindow = window.show_marker_infowindow || function(marker_id) {
791        // checks
792        if(typeof visible_infowindows_markers === 'undefined' || typeof marker_id === 'undefined')  return false;
793        var infowindow_to_open = visible_infowindows_markers[marker_id];
794        window.prev_infowindow = infowindow_to_open;
795        infowindow_to_open.open(map,visible_markers[marker_id]);
796    };
797    //
798    window.delete_markers = window.delete_markers || function(marker_id) {
799        // checks
800        if(typeof visible_markers === 'undefined' )  return false;
801        // cycle
802        jQuery.each(visible_markers,function(index,el){
803            if(typeof el !== 'undefined' ) {
804                el.setMap(null);
805            }
806        });
807    };
808    //
809    window.show_map_category = window.show_map_category || function(category) {
810        // reset
811        if(typeof visible_markers != 'undefined' && visible_markers.length>0) delete_markers(visible_markers);
812        // initialize
813        var markers_to_show = [];
814        // take pois
815        var pois = take_pois(category);
816        // hotel is always visible
817        pois.push(map_marker);
818        // create markers
819        var markers = create_markers(pois);
820        // adding the markers
821        markers_to_show = jQuery.merge(markers_to_show,markers);
822        // show markers in the map
823        show_markers(markers_to_show);
824    };
825
826    // function for google map
827    window.google_map = window.google_map || function() {
828        // starting up map template-part
829        map_id = 'map_canvas';
830        if ((jQuery('#'+map_id).length > 0)) {
831            var map_loaded = false;
832            // WINDOW SCROLL for home
833            if(jQuery('body').hasClass('homepage')) {
834                var map_offset = $('#preview_map').offset().top;
835                var window_h = $(window).height();
836                var window_scrolled = $(window).scrollTop();
837                if(map_offset<(window_h+window_scrolled) && !map_loaded) {
838                    initializeMap(map_id, gmap_config);
839                    map_loaded = true;
840                }
841                jQuery(window).scroll(function () {
842                    // check
843                    if(map_loaded) return;
844                    //
845                    var map_offset = $('#preview_map').offset().top;
846                    var window_h = $(window).height();
847                    var window_scrolled = $(window).scrollTop();
848                    if(map_offset<(window_h+window_scrolled)) {
849                        initializeMap(map_id, gmap_config);
850                        map_loaded = true;
851                    }
852                });
853            } else {
854                // go map
855                initializeMap(map_id, gmap_config);
856            }
857
858            // show category
859            jQuery('.map_infobox li a').on('click tap',function(){
860                var anchor = $(this);
861                var category = anchor.data('category');
862                if (anchor.hasClass('active')) {
863                    // reset map
864                    show_map_category('', map_id);
865                    anchor.removeClass('active');
866                } else {
867                    show_map_category(category, map_id);
868                    $('.category a.active').removeClass('active');
869                    anchor.addClass('active');
870                }
871            });
872
873            // travelmode selection
874            var button_itinerary_mode = jQuery('.itinerary_mode');
875            button_itinerary_mode.click(function (e) {
876                e.stopPropagation();
877                // this
878                var anchor = $(this);
879                // check
880                if (anchor.hasClass('active')) return false;
881                // reset
882                jQuery('.itinerary_mode.active').removeClass('active');
883                // adding class
884                anchor.addClass('active');
885            });
886
887            // calc route
888            jQuery('#calculate').on('click', function () {
889                calcRoute();
890            });
891
892            //this part handle the close_map button
893            jQuery('.close_map').click(function () {
894                jQuery('#map_directions').fadeOut(function () {
895                    directionsDisplay.setPanel(null);
896                    directionsDisplay.setMap(null);
897                    map.setZoom(parseInt(gmap_config.map_zoom));
898                    if(markers.length>1) {
899                        map.fitBounds(bounds);
900                    } else {
901                        map.setCenter(new google.maps.LatLng(map_marker.lat, map_marker.lng));
902                    }
903                });
904                jQuery('.itineraryPanelWrapper').remove();
905            });
906        }
907    };
908
909
910
911    window.showPoiDirections = window.showPoiDirections || function(lat,long) {
912        calcRoute(lat+','+long);
913    }
914
915    ////////////////////////////////////////////////////////////////////////////
916    // HOMEPAGE
917    ////////////////////////////////////////////////////////////////////////////
918
919    window.carousel_pages_home = window.carousel_pages_home || function(){
920        // vars
921        var wrap = $('#preview_pages .preview_pages_carousel');
922        // check
923        if (wrap.length === 0) return false;
924
925        wrap.on('init', function (event, slick) {
926            myLazyLoad.update();
927        });
928
929        wrap.on('afterChange', function (event, slick) {
930            myLazyLoad.update();
931        });
932
933        // go wrap
934        wrap.not('.slick-initialized').slick({
935            variableWidth: true,
936            centerMode: true,
937            rows: 0,
938            // centerPadding: 0,
939            prevArrow: '<div class="slick-prev"></div>',
940            nextArrow: '<div class="slick-next"></div>',
941            responsive: [
942                {
943                    breakpoint: 768,
944                    settings: {
945                        slidesToShow: 1,
946                        variableWidth: false,
947                        centerMode: false,
948                    }
949                },
950            ]
951        });
952    };
953
954    // popup function
955    window.pop_up = window.pop_up || function(){
956        // elems
957        var home_pop_up = jQuery("#popup");
958        if (home_pop_up.length === 0) return false;
959        // if (jQuery(window).width()<768) return false;
960        var html = home_pop_up.find('.popup_box');
961        setTimeout(function(){
962            jQuery.fancybox.open({
963                src : html,
964                type : 'inline',
965            });
966        },300);
967    };
968
969    window.social_pix = window.social_pix || function() {
970        // objs
971        var gallery_box = $('.social_pictures');
972        if (gallery_box.length === 0) return false;
973        var gallery = gallery_box.find('.social_carousel');
974        var avail_w = parseInt(gallery_box.width()*0.825,10);
975        var actual_slides = (is_mobile) ? avail_w : '250';
976        var sts = Math.floor(avail_w/actual_slides);
977        if (gallery.hasClass('slick-initialized')) {
978            return false;
979        }
980        gallery_box.on('init', function (event, slick) {
981            myLazyLoad.update();
982        });
983
984        //
985        var slickSettings = {
986            rows: 0,
987            slidesToShow: sts,
988            slidesToScroll: 1,
989            arrows: true,
990            centerMode: false,
991            dots: false,
992            autoplay: true,
993            prevArrow: gallery_box.find('.arrow .prev'),
994            nextArrow: gallery_box.find('.arrow .next'),
995            infinite: true,
996            variableWidth: true,
997            responsive: [{
998                breakpoint: 768,
999                settings: {
1000                    variableWidth: false
1001                }
1002            }]
1003        };
1004        gallery.slick(slickSettings);
1005
1006    };
1007
1008    ////////////////////////////////////////////////////////////////////////////
1009
1010    // menus functions
1011    window.menu_carousel = window.menu_carousel || function(){
1012        // vars
1013        var wrap = $('.menu_carousel');
1014        wrap.on('init', function (event, slick) {
1015            myLazyLoad.update();
1016        });
1017        if (wrap.size() > 0) {
1018            wrap.each(function(){
1019                var myItem = $(this);
1020                myItem.not('.slick-initialized').slick({
1021                    rows:0,
1022                    infinite: true,
1023                    speed: 300,
1024                    slide: '.child_wrap',
1025                    slidesToShow: 3,
1026                    slidesToScroll: 1,
1027                    centerMode: false,
1028                    variableWidth: false,
1029                    nextArrow: '<a href="javascript:;" class="arrow next"><span class="icon"></span></a>',
1030                    prevArrow: '<a href="javascript:;" class="arrow prev"><span class="icon"></span></a>',
1031                    dots: true,
1032                    arrow:true,
1033                    responsive: [
1034                        {
1035                            breakpoint: 768,
1036                            settings: {
1037                                slidesToShow: 1,
1038                                slidesToScroll: 1,
1039                            }
1040                        }
1041                    ]
1042                });
1043            });
1044        }
1045    };
1046
1047    // video function
1048    window.videos_manage = window.videos_manage || function() {
1049        var wrap = $('.video_carousel');
1050        if (wrap.size() > 0) {
1051            wrap.each(function(){
1052                var myItem = $(this);
1053                wrap.on('init', function (event, slick) {
1054                    myLazyLoad.update();
1055                });
1056                myItem.not('.slick-initialized').slick({
1057                    rows: 0,
1058                    infinite: true,
1059                    speed: 300,
1060                    slide: '.video',
1061                    slidesToShow: 2,
1062                    nextArrow: '<a href="javascript:;" class="arrow next"></a>',
1063                    prevArrow: '<a href="javascript:;" class="arrow prev"></a>',
1064                    dots: true,
1065                    variableWidth: false,
1066                    responsive: [
1067                        {
1068                            breakpoint: 768,
1069                            settings: {
1070                                slidesToShow: 1,
1071                                slidesToScroll: 1,
1072                                dots: false
1073                            }
1074                        }
1075                    ]
1076                });
1077            });
1078        }
1079    };
1080
1081    // bug not clickable days
1082    window.not_clickable_days_DC = window.not_clickable_days_DC || function() {
1083        var not_clickable_days = $(".fbw-calendar--week").children("[class=fbw-calendar--day]");
1084        $.each(not_clickable_days, function(){
1085            $(this).off();
1086        })
1087    };
1088
1089
1090    // openclose content
1091    // window.opencloseviewmore = window.opencloseviewmore || function() {
1092        var button = $('.view_more_content');
1093        button.click(function (e) {
1094            e.stopPropagation();
1095            // this
1096            var anchor = $(this);
1097            var more_text_wrap = $(this).parent();
1098            var more_text_box = $(this).parent().find('.more_text_box');
1099            // reset
1100            var more_text_box_opened = $('.more_text_box.opened');
1101            if (more_text_box_opened.length > 0) {
1102                more_text_box_opened.stop().animate({height: 0}, 300, function () {
1103                    more_text_box_opened.parent().find('.view_more_content').removeClass('open');
1104                    more_text_box_opened.removeClass('opened');
1105                    more_text_box_opened.parent().removeClass('opened');
1106                });
1107            }
1108            if ($(this).hasClass('open')) {
1109                more_text_box.stop().animate({height: 0}, 300, function () {
1110                    anchor.removeClass('open');
1111                    more_text_box.removeClass('opened');
1112                    more_text_wrap.removeClass('opened');
1113                });
1114            } else {
1115                var customHeight = $(this).parent().find('.more_text_box .more_text').outerHeight(true);
1116                more_text_box.stop().animate({height: customHeight}, 300, function () {
1117                    anchor.addClass('open');
1118                    more_text_box.addClass('opened');
1119                    more_text_wrap.addClass('opened');
1120                    setTimeout(function(){
1121                        var finalHeight = anchor.parent().find('.more_text_box .more_text').outerHeight(true);
1122                        // console.log(finalHeight);
1123                        more_text_box.stop().animate({height: finalHeight}, 300);
1124                    }, 500);
1125                });
1126
1127
1128            }
1129        })
1130    // };
1131
1132
1133    // function offers_carousel(){
1134    //     var wrap = $('.manual_offers_carousel');
1135    //
1136    //     if (wrap.size() > 0) {
1137    //         wrap.each(function(){
1138    //             var myItem = $(this);
1139    //             myItem.not('.slick-initialized').slick({
1140    //                 rows:0,
1141    //                 infinite: true,
1142    //                 speed: 300,
1143    //                 slide: '.single_offer',
1144    //                 slidesToShow: 3,
1145    //                 slidesToScroll: 1,
1146    //                 variableWidth: false,
1147    //                 nextArrow: '<a href="javascript:;" class="arrow next"><span class="icon"></span></a>',
1148    //                 prevArrow: '<a href="javascript:;" class="arrow prev"><span class="icon"></span></a>',
1149    //                 dots: true,
1150    //                 arrow:true,
1151    //                 responsive: [
1152    //                     {
1153    //                         breakpoint: 768,
1154    //                         settings: {
1155    //                             slidesToShow: 1,
1156    //                             slidesToScroll: 1,
1157    //                         }
1158    //                     }
1159    //                 ]
1160    //             });
1161    //             if(typeof myLazyLoad !== 'undefined'){
1162    //                 myLazyLoad.update();
1163    //             }
1164    //             wrap.on('afterChange', function(event, slick, direction){
1165    //                 //Fix because lazyloas is bugged with carouel
1166    //                 if(typeof slick !== 'undefined'
1167    //                     && typeof slick.currentSlide !=='undefined'
1168    //                     && slick.$slides !=='undefined'
1169    //                     && typeof slick.$slides[slick.currentSlide] !== 'undefined')
1170    //                 {
1171    //                     var currentSlide = $(slick.$slides[slick.currentSlide]).find('.lazy');
1172    //                     if (currentSlide && !currentSlide.data('was-processed')) {
1173    //                         var bg = currentSlide.data('src');
1174    //                         if (bg !== '') {
1175    //                             currentSlide.css('background-image', 'url('+bg+')');
1176    //                             currentSlide.data('was-processed', 'true');
1177    //                         }
1178    //                     }
1179    //                 }
1180    //             });
1181    //         });
1182    //     }
1183    // }
1184
1185
1186    // function getScrollbarWidth() {
1187    //     var outer = document.createElement("div");
1188    //     outer.style.visibility = "hidden";
1189    //     outer.style.width = "100px";
1190    //     outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
1191    //     document.body.appendChild(outer);
1192    //     var widthNoScroll = outer.offsetWidth;
1193    //     // force scrollbars
1194    //     outer.style.overflow = "scroll";
1195    //     // add innerdiv
1196    //     var inner = document.createElement("div");
1197    //     inner.style.width = "100%";
1198    //     outer.appendChild(inner);
1199    //     var widthWithScroll = inner.offsetWidth;
1200    //     // remove divs
1201    //     outer.parentNode.removeChild(outer);
1202    //     return widthNoScroll - widthWithScroll;
1203    // }
1204
1205
1206    ///////////////////////////////////
1207    ///////  END FUNCTIONS     /////////
1208    ///////////////////////////////////
1209
1210
1211    // WINDOW LOAD
1212    jQuery(window).load(function () {
1213        // detecting screen dimensions
1214        refresh_size_queries();
1215
1216        // gallery page
1217        Managegallery();
1218
1219        // homep pop up
1220        pop_up();
1221
1222
1223    });
1224
1225    // WINDOW RESIZE
1226    jQuery(window).resize(function () {
1227        // detecting screen dimensions
1228        refresh_size_queries();
1229        //
1230        headerScroll();
1231
1232    });
1233
1234    // WINDOW SCROLL
1235    jQuery(window).scroll(function () {
1236        // scroll_blur
1237        scroll_blur();
1238        // menu scroll
1239        headerScroll();
1240
1241        // page menu scrolling
1242        pageMenuScroll();
1243
1244    });
1245
1246    /////////////// DOM READY
1247    $(document).ready(function() {
1248        // lazzzzy
1249        window.myLazyLoad = new LazyLoad({
1250            elements_selector: ".lazy",
1251            // threshold: 100
1252        });
1253        // detecting screen dimensions
1254        refresh_size_queries();
1255
1256        // SLIDESHOW
1257        doSlideshow('.slideshow .cycle');
1258        slideshowHeight();
1259        scroll_blur();
1260
1261        // menu scroll
1262        headerScroll();
1263
1264        // mobile menu
1265        openSidebar();
1266
1267        // minigallery
1268        minigallery();
1269
1270        // submenus
1271        pageSubmenu();
1272        pageMenuScroll();
1273
1274        // gmap
1275        google_map();
1276
1277        // HOMEPAGE
1278        carousel_pages_home();
1279        social_pix();
1280
1281        // menu carousel
1282        menu_carousel();
1283
1284        // videos
1285        videos_manage();
1286
1287        // //Social connect
1288        // $('#guestaccount_box .close').on('click', function(){
1289        //     $('#guestaccount_box').fadeOut('fast');
1290        // });
1291
1292        // manual offers carousel
1293         // offers_carousel();
1294
1295        $('#main_book, .fbw-calendar--button').click(function(){
1296            not_clickable_days_DC();
1297        });
1298    });
1299
1300})(jQuery);

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.