PageSourceSearch

https://live-talk.ru/wp-content/themes/eventmana-child/assets/js/hh_theme.js?ver=4.8.19

js live-talk.ru collected 2026-10-09 23:14:06 UTC 37,805 bytes, 1,011 lines download raw bytes

1'use strict';
2var theme = function ($) {
3
4    function filterContent(showClass) {
5        var filterContentContainer = $('.filter-content');
6
7        filterContentContainer.children(showClass).each(function(index, element) {
8            $(element).fadeIn(200);
9        });
10
11        filterContentContainer.children().not(showClass).each(function(index, element) {
12            $(element).fadeOut(200);
13        });
14    }
15
16    $('#filtrable-events a').click(function() {
17        filterContent($(this).data('filter'));
18    });
19
20    // prevent empty links
21    // ---------------------------------------------------------------------------------------
22    function handlePreventEmptyLinks() {
23        $('a[href="#"]').click(function (event) {
24            event.preventDefault();
25        });
26    }
27
28    // Placeholdem
29    // ---------------------------------------------------------------------------------------
30    // function handlePlaceholdem() {
31    //     Placeholdem(document.querySelectorAll('[placeholder]'));
32    // }
33
34    // BootstrapSelect
35    // ---------------------------------------------------------------------------------------
36    function handleBootstrapSelect() {
37        $('.selectpicker').selectpicker();
38    }
39
40    // add hover class for correct view on mobile devices
41    // ---------------------------------------------------------------------------------------
42    function handleHoverClass() {
43        var hover = $('.thumbnail');
44        hover.hover(
45                function () {
46                    $(this).addClass('hover');
47                },
48                function () {
49                    $(this).removeClass('hover');
50                }
51        );
52    }
53
54    // superfish menu
55    // ---------------------------------------------------------------------------------------
56    function handleSuperFish() {
57        $('ul.sf-menu').superfish();
58        $('ul.sf-menu a').click(function () {
59            $('body').scrollspy('refresh');
60        });
61        // fixed menu toggle
62        $('.menu-toggle').on('click', function () {
63            if ($('.navigation').hasClass('opened')) {
64                $(this).find('.fa').removeClass('fa-times').addClass('fa-bars');
65                $('.navigation').removeClass('opened').addClass('closed');
66            } else {
67                $(this).find('.fa').removeClass('fa-bars').addClass('fa-times');
68                $('.navigation').removeClass('closed').addClass('opened');
69            }
70        });
71        // submenu fix
72        $('.mobile-submenu').click(function () {
73            $(this).parent().toggleClass('mobile-submenu-open');
74        });
75        $('ul.sf-menu a').click(function () {
76            $('ul.sf-menu li').removeClass('mobile-submenu-open');
77        });
78    }
79
80    // Smooth scrolling
81    // ---------------------------------------------------------------------------------------
82    function handleSmoothScroll() {
83        $('.sf-menu a, .scroll-to').click(function () {
84
85            if ($(this).hasClass('btn-search-toggle')) {
86                //child-hack - удалено появление поиска, переопределено в hh_scripts
87            }
88            else {
89
90                //var headerH = $('header').outerHeight();
91                var headerH = 0;
92                $('.sf-menu a').removeClass('active');
93                $(this).addClass('active');
94                $('html, body').animate({
95                    scrollTop: $($(this).attr('href')).offset().top - headerH + 'px'
96                }, {
97                    duration: 1200,
98                    easing: 'easeInOutExpo'
99                });
100                return false;
101
102            }
103        });
104    }
105
106    // Text Rotater Start
107    // ---------------------------------------------------------------------------------------
108    (function ($) {
109        $.fn.extend({
110            rotaterator: function (options) {
111
112                var defaults = {
113                    fadeSpeed: 900,
114                    pauseSpeed: 100,
115                    child: null
116                };
117
118                var options = $.extend(defaults, options);
119
120                return this.each(function () {
121                    var o = options;
122                    var obj = $(this);
123                    var items = $(obj.children(), obj);
124                    items.each(function () {
125                        $(this).hide();
126                    })
127                    if (!o.child) {
128                        var next = $(obj).children(':first');
129                    } else {
130                        var next = o.child;
131                    }
132                    $(next).fadeIn(o.fadeSpeed, function () {
133                        $(next).delay(o.pauseSpeed).fadeOut(o.fadeSpeed, function () {
134                            var next = $(this).next();
135                            if (next.length == 0) {
136                                next = $(obj).children(':first');
137                            }
138                            $(obj).rotaterator({child: next, fadeSpeed: o.fadeSpeed, pauseSpeed: o.pauseSpeed});
139                        })
140                    });
141                });
142            }
143        });
144    })(jQuery);
145    // Text Rotater End
146
147
148
149    // prettyPhoto
150    // ---------------------------------------------------------------------------------------
151    function handlePrettyPhoto() {
152         $("a[rel^='prettyPhoto']").prettyPhoto({
153            // theme: 'facebook',
154            // slideshow: 5000,
155            // autoplay_slideshow: true
156        });
157         $("a[data-gal^='prettyPhoto']").prettyPhoto({
158            // theme: 'facebook',
159            // slideshow: 5000,
160            // autoplay_slideshow: true
161        });
162
163
164    }
165
166    // Scroll totop button
167    // ---------------------------------------------------------------------------------------
168    function handleToTopButton() {
169        $(window).scroll(function () {
170            if ($(this).scrollTop() > 1) {
171                $('.to-top').css({bottom: '15px'});
172            } else {
173                $('.to-top').css({bottom: '-100px'});
174            }
175        });
176        $('.to-top').click(function () {
177            $('html, body').animate({scrollTop: '0px'}, 800);
178            return false;
179        });
180    }
181
182    // preloader
183    // ---------------------------------------------------------------------------------------
184    $(window).load(function () {
185        $('#status').fadeOut();
186        $('#preloader').delay(200).fadeOut(100);
187    });
188
189    // Isotope
190    $(window).load(function () {
191
192        if ($().isotope) {
193            var tab_active = $('#filtrable-events').data('tab_active');
194            if(tab_active != ''){
195                $('.isotope.events').isotope({// initialize isotope
196                    filter: '.'+tab_active,
197                    itemSelector: '.isotope-item' // options...
198                            //,transitionDuration: 0 // disable transition
199                });
200            }else{
201                $('.isotope.events').isotope({// initialize isotope
202                    itemSelector: '.isotope-item' // options...
203                            //,transitionDuration: 0 // disable transition
204                });
205            }
206
207            $('#filtrable-events a').click(function () { // filter items when filter link is clicked
208                var selector = $(this).attr('data-filter');
209                $('#filtrable-events a').parent().removeClass('current');
210                $(this).parent().addClass('current');
211                $('.isotope.events').isotope({filter: selector});
212                $('.isotope').isotope('reLayout', $.waypoints('refresh')); // layout/reLayout
213                return false;
214            });
215        }
216        if ($().isotope) {
217            $('.isotope.gallery').isotope({// initialize isotope
218                itemSelector: '.isotope-item' // options...
219                        //,transitionDuration: 0 // disable transition
220            });
221            $('#filtrable-gallery a').click(function () { // filter items when filter link is clicked
222                var selector = $(this).attr('data-filter');
223                $('#filtrable-gallery a').parent().removeClass('current');
224                $(this).parent().addClass('current');
225                $('.isotope.gallery').isotope({filter: selector});
226                $('.isotope').isotope('reLayout', $.waypoints('refresh')); // layout/reLayout
227                return false;
228            });
229        }
230    });
231
232    $(window).resize(function () {
233        // Refresh isotope
234        if ($().isotope) {
235            $('.isotope').isotope('reLayout', $.waypoints('refresh')); // layout/relayout on window resize
236        }
237    });
238
239    // Shrink header on scroll
240    // ---------------------------------------------------------------------------------------
241    function handleAnimatedHeader() {
242        var header = $('.header.fixed');
243        function refresh() {
244            var scroll = $(window).scrollTop();
245            if (scroll >= 99) {
246                header.addClass('shrink');
247            } else {
248                header.removeClass('shrink');
249            }
250            $.waypoints('refresh');
251        }
252        ;
253        $(window).load(function () {
254            refresh();
255        });
256        $(window).scroll(function () {
257            refresh();
258        });
259        $(window).on('touchstart', function () {
260            refresh();
261        });
262        $(window).on('scrollstart', function () {
263            refresh();
264        });
265        $(window).on('scrollstop', function () {
266            refresh();
267        });
268        $(window).on('touchmove', function () {
269            refresh();
270        });
271
272    }
273
274    // handleTabsFAQ
275    // ---------------------------------------------------------------------------------------
276    function handleTabsFAQ() {
277        if ($('#tabs-faq').length) {
278            var tabs = $('#tabs-faq');
279            tabs.find('a').on('click', function () {
280                tabs.find('.fa-angle-right').removeClass('fa-angle-right').addClass('fa-plus');
281                $(this).find('.fa').removeClass('fa-plus').addClass('fa-angle-right');
282            });
283        }
284    }
285
286    // resize page
287    // ---------------------------------------------------------------------------------------
288    function resizePage() {
289        if ($('body').hasClass('boxed')) {
290            $('#main-slider').find('.page').each(function () {
291                $(this).removeAttr('style');
292            });
293        }
294
295        $('#main-slider').trigger('refresh');
296        $('.testimonials').trigger('refresh');
297        $('.partners-carousel .owl-carousel').trigger('refresh');
298        $('.partners-carousel-2 .owl-carousel').trigger('refresh');
299        $('.carousel-slider .owl-carousel').trigger('refresh');
300
301    }
302
303    // INIT FUNCTIONS
304    // ---------------------------------------------------------------------------------------
305    return {
306        onResize: function () {
307            resizePage();
308        },
309        init: function () {
310            handlePreventEmptyLinks();
311            // handlePlaceholdem();
312            handleBootstrapSelect();
313            handleHoverClass();
314            handleSuperFish();
315            handleSmoothScroll();
316            handlePrettyPhoto();
317            handleToTopButton();
318            handleAnimatedHeader();
319            handleTabsFAQ();
320        },
321        // Main Slider
322        initMainSlider: function () {
323            $('.main-slider').each(function(){
324
325                var autoplay = $(this).data('auto_slider');
326                var duration = $(this).data('duration');
327                var loop = $(this).data('loop');
328                var navigation = $(this).data('navigation');
329
330                $(this).owlCarousel({
331                    //items: 1,
332                    autoplay: autoplay,
333                    // autoplayTimeout: duration,
334                    autoplayHoverPause: true,
335                    loop: loop,
336                    margin: 0,
337                    dots: false,
338                    nav: navigation,
339                    navText: [
340                        "<i class='fa fa-caret-left'></i>",
341                        "<i class='fa fa-caret-right'></i>"
342                    ],
343                    responsiveRefreshRate: 100,
344                    responsive: {
345                        0: {items: 1},
346                        479: {items: 1},
347                        768: {items: 1},
348                        991: {items: 1},
349                        1024: {items: 1}
350                    }
351                });
352            });
353
354
355        },
356        // CountDown
357        initCountDown: function () {
358            $('.defaultCountdown').each(function(){
359                var years = $(this).data('years');
360                var months = $(this).data('months');
361                var weeks = $(this).data('weeks');
362                var days = $(this).data('days');
363                var hours = $(this).data('hours');
364                var minutes = $(this).data('minutes');
365                var seconds = $(this).data('seconds');
366
367                var year = $(this).data('year');
368                var month = $(this).data('month');
369                var week = $(this).data('week');
370                var day = $(this).data('day');
371                var hour = $(this).data('hour');
372                var minute = $(this).data('minute');
373                var second = $(this).data('second');
374
375                var end_date_y = $(this).data('end_date_y');
376                var end_date_m = $(this).data('end_date_m');
377                var end_date_d = $(this).data('end_date_d');
378                var end_date_h = $(this).data('end_date_h');
379                var end_date_i = $(this).data('end_date_i');
380
381                var timezone = $(this).data('timezone');
382                var display_format = $(this).data('display_format');
383
384
385                var austDay = new Date();
386                austDay = new Date(end_date_y, end_date_m, end_date_d, end_date_h, end_date_i);
387               $(this).countdown({
388                    labels: [years,months,weeks,days,hours,minutes,seconds],
389                    labels1: [year,month,week,day,hour,minute,second],
390                    until: austDay,
391                    timezone: timezone,
392                    format: display_format
393                });
394            });
395
396
397        },
398        // Images carousel
399        initImageCarousel: function () {
400            $('.owl-carousel .img-carousel').each(function(){
401
402                var autoplay = $(this).data('autoplay');
403                var duration = $(this).data('duration');
404                var loop = $(this).data('loop');
405                var navigation = $(this).data('navigation');
406                $(this).owlCarousel({
407                    autoplay: autoplay,
408                    loop: loop,
409                    autoplayTimeout: duration,
410                    autoplayHoverPause: true,
411                    margin: 0,
412                    dots: true,
413                    nav: navigation,
414                    navText: [
415                        "<i class='fa fa-angle-left'></i>",
416                        "<i class='fa fa-angle-right'></i>"
417                    ],
418                    responsive: {
419                        0: {items: 1},
420                        479: {items: 1},
421                        768: {items: 1},
422                        991: {items: 1},
423                        1024: {items: 1}
424                    }
425                });
426            });
427
428        },
429        initCorouselSlider4: function () {
430            $('.carousel-slider .owl-carousel.slide-4').each(function(){
431                var autoplay = $(this).data('autoplay');
432                var item_slide = $(this).data('item_slide');
433                var duration = $(this).data('duration');
434                var navigation = $(this).data('navigation');
435                var loop = $(this).data('loop');
436
437                $(this).owlCarousel({
438                    autoplay: autoplay,
439                    loop: loop,
440                    autoplayTimeout: duration,
441                    autoplayHoverPause: true,
442                    margin: 30,
443                    dots: false,
444                    nav: navigation,
445                    navText: [
446                        "<i class='fa fa-caret-left'></i>",
447                        "<i class='fa fa-caret-right'></i>"
448                    ],
449                    responsive: {
450                        0: {items: 1},
451                        479: {items: 2},
452                        767: {items: 2},
453                        991: {items: 3},
454                        1024: {items: item_slide}
455                    }
456                });
457            });
458
459
460        },
461        initSpeaker: function () {
462            $('.carousel-slider .owl-carousel.speaker').each(function(){
463                var autoplay = $(this).data('autoplay');
464                var item_slide = $(this).data('item_slide');
465                var duration = $(this).data('duration');
466                var navigation = $(this).data('navigation');
467                var loop = $(this).data('loop');
468
469                $(this).owlCarousel({
470                    autoplay: autoplay,
471                    loop: loop,
472                    autoplayTimeout: duration,
473                    autoplayHoverPause: true,
474                    margin: 30,
475                    dots: false,
476                    nav: navigation,
477                    navText: [
478                        "<i class='fa fa-caret-left'></i>",
479                        "<i class='fa fa-caret-right'></i>"
480                    ],
481                    responsive: {
482                        0: {items: 1},
483                        479: {items: 2},
484                        767: {items: 2},
485                        991: {items: 3},
486                        1024: {items: item_slide}
487                    }
488                });
489            });
490
491
492        },
493        initLatestblog: function () {
494            $('.carousel-slider .owl-carousel.latestblog').each(function(){
495                var autoplay = $(this).data('autoplay');
496                var item_slide = $(this).data('item_slide');
497                var duration = $(this).data('duration');
498                var navigation = $(this).data('navigation');
499                var loop = $(this).data('loop');
500
501                $(this).owlCarousel({
502                    autoplay: autoplay,
503                    loop: loop,
504                    autoplayHoverPause: true,
505                    autoplayTimeout: duration,
506                    margin: 30,
507                    dots: false,
508                    nav: navigation,
509                    navText: [
510                        "<i class='fa fa-caret-left'></i>",
511                        "<i class='fa fa-caret-right'></i>"
512                    ],
513                    responsive: {
514                        0: {items: 1},
515                        479: {items: 2},
516                        767: {items: 2},
517                        991: {items: 3},
518                        1024: {items: item_slide}
519                    }
520                });
521            });
522
523
524        },
525        initCorouselSlider3: function () {
526            $('.carousel-slider .owl-carousel.slide-3').owlCarousel({
527                autoplay: true,
528                loop: true,
529                margin: 30,
530                dots: false,
531                nav: true,
532                navText: [
533                    "<i class='fa fa-caret-left'></i>",
534                    "<i class='fa fa-caret-right'></i>"
535                ],
536                responsive: {
537                    0: {items: 1},
538                    479: {items: 2},
539                    767: {items: 2},
540                    991: {items: 3},
541                    1024: {items: 3}
542                }
543            });
544
545        },
546        // Partners Slider
547        initPartnerSlider: function () {
548            $(".partners-carousel .owl-carousel").each(function(){
549                var autoplay = $(this).data('auto');
550                var itemslide = $(this).data('itemslide');
551                var show_nav = $(this).data('show_nav');
552                var loop = $(this).data('loop');
553                var autoplaytimeout = $(this).data('autoplaytimeout');
554
555                $(this).owlCarousel({
556                      autoplay: autoplay,
557                      loop: loop,
558                      autoplayHoverPause: true,
559                      margin: 25,
560                      dots: false,
561                      nav: show_nav,
562                      autoplayTimeout: autoplaytimeout,
563                      navText: [
564                          "<i class='fa fa-caret-left'></i>",
565                          "<i class='fa fa-caret-right'></i>"
566                      ],
567                      responsive: {
568                          0:    {items: 1},
569                          479:  {items: 2},
570                          768:  {items: 3},
571                          991:  {items: 4},
572                          1024: {items: itemslide}
573                      }
574                });
575            });
576        },
577        // Partners Slider
578        initPartnerSlider2: function () {
579            $('.partners-carousel-2 .owl-carousel').owlCarousel({
580                autoplay: true,
581                loop: true,
582                margin: 25,
583                dots: false,
584                nav: true,
585                navText: [
586                    "<i class='fa fa-caret-left'></i>",
587                    "<i class='fa fa-caret-right'></i>"
588                ],
589                responsive: {
590                    0: {items: 1},
591                    479: {items: 2},
592                    768: {items: 3},
593                    991: {items: 5},
594                    1024: {items: 5}
595                }
596            });
597        },
598        // Partners Slider
599        initEventCarousel: function () {
600            $('.event-carousel .owl-carousel').owlCarousel({
601                autoplay: false,
602                loop: false,
603                margin: 25,
604                dots: true,
605                nav: true,
606                navText: [
607                    "<i class='fa fa-caret-left'></i>",
608                    "<i class='fa fa-caret-right'></i>"
609                ],
610                responsive: {
611                    0: {items: 1},
612                    479: {items: 1},
613                    768: {items: 2},
614                    991: {items: 3},
615                    1024: {items: 4}
616                }
617            });
618        },
619        // Main Slider
620
621        // Testimonials
622        initTestimonials: function () {
623            $('.testimonials').each(function(){
624
625                var autoplay = $(this).data('autoplay');
626                var duration = $(this).data('duration');
627                var dots = $(this).data('dots');
628                var loop = $(this).data('loop');
629
630                $(this).owlCarousel({
631                    items: 1,
632                    autoplay: autoplay,
633                    autoplayTimeout: duration,
634                    loop: loop,
635                    dots: dots,
636                    nav: false,
637                    navText: [
638                        "<i class='fa fa-caret-left'></i>",
639                        "<i class='fa fa-caret-right'></i>"
640                    ]
641                });
642            });
643
644        },
645        // Animation on Scroll
646        initAnimation: function () {
647            var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
648            if (isMobile == false) {
649                $('*[data-animation]').addClass('animated');
650                $('.animated').waypoint(function (down) {
651                    var elem = $(this);
652                    var animation = elem.data('animation');
653                    if (!elem.hasClass('visible')) {
654                        var animationDelay = elem.data('animation-delay');
655                        if (animationDelay) {
656                            setTimeout(function () {
657                                elem.addClass(animation + ' visible');
658                            }, animationDelay);
659                        } else {
660                            elem.addClass(animation + ' visible');
661                        }
662                    }
663                }, {
664                    offset: $.waypoints('viewportHeight')
665                            //offset: 'bottom-in-view'
666                            //offset: '95%'
667                });
668            }
669            // Refresh Waypoints on tab click / animation
670            $('#tabs-lv1 li a[data-toggle="tab"]').on('shown.bs.tab', function () {
671                $.waypoints('refresh');
672            });
673            $('#tabs-lv2 li a[data-toggle="tab"]').on('shown.bs.tab', function () {
674                $.waypoints('refresh');
675            });
676        },
677        // Google map
678        initGoogleMap: function () {
679
680                $('.google-map').each(function(){
681
682                    var map;
683                    var marker;
684                    var zoom = $(this).data('zoom');
685                    var latitude = $(this).data('latitude');
686                    var longitude = $(this).data('longitude');
687                    var defineid = $(this).data('defineid');
688                    var marker_title = $(this).data('marker_title');
689
690                    function initialize() {
691                        var mapOptions = {
692                            scrollwheel: false,
693                            zoom: zoom,
694                            center: new google.maps.LatLng(latitude, longitude)
695                        };
696                        map = new google.maps.Map(document.getElementById(defineid), mapOptions);
697                        marker = new google.maps.Marker({
698                            position: new google.maps.LatLng(latitude, longitude),
699                            map: map,
700                            title: marker_title
701                        });
702                    }
703                    //google.maps.event.addDomListener(window, "load", initialize);
704                });
705
706
707
708        },
709        slideshow_height: function(){
710
711            var win_w = $(window).width();
712            var win_h = $(window).height();
713
714            var height_desk = $("#main-slider.main-slider-multi-bg").data('height_desk');
715            var height_ipad = $("#main-slider.main-slider-multi-bg").data('height_ipad');
716            var height_mobile = $("#main-slider.main-slider-multi-bg").data('height_mobile');
717
718
719
720            if(win_w < 768){
721                $('#main-slider.main-slider-multi-bg .item').css('height', height_mobile);
722                $('#main-slider.main-slider-multi-bg .item').css('min-height', height_mobile);
723            }else if (win_w >= 768 && win_w < 991){
724                $('#main-slider.main-slider-multi-bg .item').css('height', height_ipad);
725                $('#main-slider.main-slider-multi-bg .item').css('min-height', height_ipad);
726            }else{
727                $('#main-slider.main-slider-multi-bg .item').css('height', height_desk);
728                $('#main-slider.main-slider-multi-bg .item').css('min-height', height_desk);
729            }
730        }
731
732
733
734    };
735
736
737
738}(jQuery);
739
740
741jQuery(document).ready(function () {
742    jQuery('#rotate').rotaterator({fadeSpeed: 1200, pauseSpeed: 500});
743// Google map
744// ---------------------------------------------------------------------------------------
745if (typeof google === 'object' && typeof google.maps === 'object') {
746    if (jQuery('#map-canvas1').length) {
747
748        var lat1 = jQuery('#map-canvas1').data('lat1').split(',');
749        var lat1_title = jQuery('#map-canvas1').data('lat1_title');
750
751        var lat2 =jQuery('#map-canvas1').data('lat2').split(',');
752        var lat2_title =jQuery('#map-canvas1').data('lat2_title');
753
754        var lat3 =jQuery('#map-canvas1').data('lat3').split(',');
755        var lat3_title =jQuery('#map-canvas1').data('lat3_title');
756
757        var lat4 =jQuery('#map-canvas1').data('lat4').split(',');
758        var lat4_title =jQuery('#map-canvas1').data('lat4_title');
759
760        var lat5 =jQuery('#map-canvas1').data('lat5').split(',');
761        var lat5_title =jQuery('#map-canvas1').data('lat5_title');
762
763        var lat6 =jQuery('#map-canvas1').data('lat6').split(',');
764        var lat6_title =jQuery('#map-canvas1').data('lat6_title');
765
766        var lat7 =jQuery('#map-canvas1').data('lat7').split(',');
767        var lat7_title =jQuery('#map-canvas1').data('lat7_title');
768
769        var lat8 =jQuery('#map-canvas1').data('lat8').split(',');
770        var lat8_title =jQuery('#map-canvas1').data('lat8_title');
771
772
773        var map;
774        var marker1, marker2, marker3, marker4, marker5, marker6,marker7, marker8;
775        var infowindow;
776
777        var image = jQuery('#map-canvas1').data('img');
778        // var image = 'wp-content/themes/eventmana/assets/img/icon-google-map.png'; // marker icon
779        google.maps.event.addDomListener(window, 'load', function () {
780
781            var mapOptions = {
782                scrollwheel: false,
783                zoom: 10,
784                center: new google.maps.LatLng(lat1[0],lat1[1]) // map coordinates
785            };
786
787
788
789            map = new google.maps.Map(document.getElementById('map-canvas1'),
790                mapOptions);
791
792            if(lat1.length>0){
793                marker1 = new google.maps.Marker({
794                    position: new google.maps.LatLng(lat1[0],lat1[1]), // marker coordinates
795                    map: map,
796                    icon: image,
797                    title: lat1_title
798                });
799            }
800
801            if(lat2.length>0){
802                marker2 = new google.maps.Marker({
803                    position: new google.maps.LatLng(lat2[0],lat2[1]), // marker coordinates
804                    map: map,
805                    icon: image,
806                    title: lat2_title
807                });
808            }
809            if(lat3.length>0){
810                marker3 = new google.maps.Marker({
811                    position: new google.maps.LatLng(lat3[0],lat3[1]), // marker coordinates
812                    map: map,
813                    icon: image,
814                    title: lat3_title
815                });
816            }
817
818            if(lat4.length>0){
819                marker4 = new google.maps.Marker({
820                    position: new google.maps.LatLng(lat4[0],lat4[1]), // marker coordinates
821                    map: map,
822                    icon: image,
823                    title: lat4_title
824                });
825            }
826
827            if(lat5.length>0){
828                marker5 = new google.maps.Marker({
829                    position: new google.maps.LatLng(lat5[0],lat5[1]), // marker coordinates
830                    map: map,
831                    icon: image,
832                    title: lat5_title
833                });
834            }
835
836            if(lat6.length>0){
837                marker6 = new google.maps.Marker({
838                    position: new google.maps.LatLng(lat6[0],lat6[1]), // marker coordinates
839                    map: map,
840                    icon: image,
841                    title: lat6_title
842                });
843            }
844
845            if(lat7.length>0){
846                marker7 = new google.maps.Marker({
847                    position: new google.maps.LatLng(lat7[0],lat7[1]), // marker coordinates
848                    map: map,
849                    icon: image,
850                    title: lat7_title
851                });
852            }
853
854            if(lat8.length>0){
855                marker8 = new google.maps.Marker({
856                    position: new google.maps.LatLng(lat8[0],lat8[1]), // marker coordinates
857                    map: map,
858                    icon: image,
859                    title: lat8_title
860                });
861            }
862
863
864
865            if(lat1.length>0){
866                var infowindow1 = new google.maps.InfoWindow({
867                    content: lat1_title
868                });
869
870                google.maps.event.addListener(marker1, 'click', function() {
871                    infowindow1.open(map,marker1);
872                });
873            }
874            // more markers
875            if(lat2.length>0){
876                var infowindow2 = new google.maps.InfoWindow({
877                    content: lat2_title
878                });
879                google.maps.event.addListener(marker2, 'click', function() {
880                    infowindow2.open(map,marker2);
881                });
882            }
883            if(lat3.length>0){
884                var infowindow3 = new google.maps.InfoWindow({
885                    content: lat3_title
886                });
887                google.maps.event.addListener(marker3, 'click', function() {
888                    infowindow3.open(map,marker3);
889                });
890            }
891
892            if(lat4.length>0){
893                var infowindow4 = new google.maps.InfoWindow({
894                    content: lat4_title
895                });
896                google.maps.event.addListener(marker4, 'click', function() {
897                    infowindow4.open(map,marker4);
898                });
899            }
900            if(lat5.length>0){
901                var infowindow5 = new google.maps.InfoWindow({
902                    content: lat5_title
903                });
904                google.maps.event.addListener(marker5, 'click', function() {
905                    infowindow5.open(map,marker5);
906                });
907            }
908            if(lat6.length>0){
909                var infowindow6 = new google.maps.InfoWindow({
910                    content: lat6_title
911                });
912                google.maps.event.addListener(marker6, 'click', function() {
913                    infowindow6.open(map,marker6);
914                });
915            }
916            if(lat7.length>0){
917                var infowindow7 = new google.maps.InfoWindow({
918                    content: lat7_title
919                });
920                google.maps.event.addListener(marker7, 'click', function() {
921                    infowindow7.open(map,marker7);
922                });
923            }
924            if(lat8.length>0){
925                var infowindow8 = new google.maps.InfoWindow({
926                    content: lat8_title
927                });
928                google.maps.event.addListener(marker8, 'click', function() {
929                    infowindow8.open(map,marker8);
930                });
931            }
932            // open marker when google map init
933            function initialize() {
934                google.maps.event.trigger(marker1, 'click');
935            }
936            initialize();
937
938            /*
939             * The google.maps.event.addListener() event waits for
940             * the creation of the infowindow HTML structure 'domready'
941             * and before the opening of the infowindow defined styles
942             * are applied.
943             */
944                google.maps.event.addListener(infowindow, 'domready', function () {
945
946                    // Reference to the DIV which receives the contents of the infowindow using jQuery
947                    var iwOuter = $('.gm-style-iw');
948
949                    /* The DIV we want to change is above the .gm-style-iw DIV.
950                     * So, we use jQuery and create a iwBackgroun
950d variable,
951                     * and took advantage of the existing reference to .gm-style-iw for the previous DIV with .prev().
952                     */
953                    var iwBackground = iwOuter.prev();
954
955                    // Remove the background shadow DIV
956                    iwBackground.children(':nth-child(2)').css({'display': 'none'});
957
958                    // Remove the white background DIV
959                    iwBackground.children(':nth-child(4)').css({'display': 'none'});
960
961                    // Moves the infowindow 115px to the right.
962                    iwOuter.parent().parent().css({left: '10px'});
963
964                    // Moves the shadow arrow // hide
965                    iwBackground.children(':nth-child(1)').attr('style', function (i, s) {
966                        return s + 'display: none !important;'
967                    });
968
969                    // Moves the arrow 76px to the left margin
970                    iwBackground.children(':nth-child(3)').attr('style', function (i, s) {
971                        return s + 'left: 80px !important; margin-top: -10px; z-index: 0;'
972                    });
973
974                    // Changes the desired color for the tail outline.
975                    // The outline of the tail is composed of two descendants of div which contains the tail.
976                    // The .find('div').children() method refers to all the div which are direct descendants of the previous div.
977                    iwBackground.children(':nth-child(3)').find('div').children().css({'box-shadow': 'rgba(255, 255, 255, 0.1) 0px 1px 6px', 'z-index': '1'});
978
979                    // Taking advantage of the already established reference to
980                    // div .gm-style-iw with iwOuter variable.
981                    // You must set a new variable iwCloseBtn.
982                    // Using the .next() method of JQuery you reference the following div to .gm-style-iw.
983                    // Is this div that groups the close button elements.
984                    var iwCloseBtn = iwOuter.next();
985
986                    // Apply the desired effect to the close button
987                    iwCloseBtn.css({
988                        opacity: '1',
989                        right: '48px', top: '14px',
990                        width: '19px', height: '19px',
991                        border: '3px solid #ffffff',
992                        'border-radius': '17px',
993                        'background-color': '#ffffff'
994                    });
995
996                    // The API automatically applies 0.7 opacity to the button after the mouseout event.
997                    // This function reverses this event to the desired value.
998                    iwCloseBtn.mouseout(function () {
999                        $(this).css({opacity: '1'});
1000                    });
1001
1002                });
1003
1004            //
1005
1006        });
1007
1008    }
1009}
1010
1011});

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.