PageSourceSearch

https://www.likewater.blue/wp-content/themes/h-code/assets/js/main-ver-1.9.8.js

js likewater.blue collected 2026-10-09 01:24:31 UTC 106,678 bytes, 2,385 lines download raw bytes

1"use strict";
2var $portfolio;
3var $ParallaxPortfolio;
4var $masonry_block;
5var $portfolio_selectors;
6var $Parallaxportfolio_selectors;
7var $blog;
8
9var isMobile = false;
10var isiPhoneiPad = false;
11
12if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
13    isMobile = true;
14}
15if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
16    isiPhoneiPad = true;
17}
18
19/* For remove conflict */
20( function( $ ) {
21
22    $(document).ready(function () {
23
24        HamburderMenuCustomScroll();
25        OnePageActiveOnScroll();
26        $(document).on("scroll", OnePageActiveOnScroll);
27
28        /*==============================================================*/
29        //Placeholder For IE - START CODE
30        /*==============================================================*/
31
32        $('input, textarea').placeholder({customClass:'my-placeholder'});
33        
34        /*==============================================================*/
35        //Placeholder For IE - START CODE
36        /*==============================================================*/
37        
38        /*==============================================================*/
39        //Smooth Scroll - START CODE
40        /*==============================================================*/
41        $('.inner-top').smoothScroll({
42            speed: 900,
43            offset: -68
44        });
45        /*==============================================================*/
46        //Smooth Scroll - END CODE
47        /*==============================================================*/
48
49        /*==============================================================*/
50        //Set Resize Header Menu - START CODE
51        /*==============================================================*/
52        SetResizeHeaderMenu();
53        /*==============================================================*/
54        //Set Resize Header Menu - END CODE
55        /*==============================================================*/
56
57        /*==============================================================*/
58        //Ipad And Mobile Icon Hover - START CODE
59        /*==============================================================*/
60        IpadMobileHover();
61        /*==============================================================*/
62        //Ipad And Mobile Icon Hover - END CODE
63        /*==============================================================*/
64
65        /*==============================================================*/
66        //For shopping cart- START CODE
67        /*==============================================================*/
68        
69        if (!isMobile) {
70            $(".search-cart-header .top-cart a.shopping-cart, .search-cart-header .cart-content").hover(function () {
71                $(".search-cart-header .cart-content").css('opacity', '1');
72                $(".search-cart-header .cart-content").css('visibility', 'visible');
73            }, function () {
74                $(".search-cart-header .cart-content").css('opacity', '0');
75                $(".search-cart-header .cart-content").css('visibility', 'hidden');
76            });
77
78            $(document).on({
79                mouseenter: function() {
80                    $(".search-cart-header .cart-content").css('opacity', '1');
81                    $(".search-cart-header .cart-content").css('visibility', 'visible');
82                },
83                mouseleave: function() {
84                    $(".search-cart-header .cart-content").css('opacity', '0');
85                    $(".search-cart-header .cart-content").css('visibility', 'hidden');
86                }
87            }, ".search-cart-header .top-cart a.shopping-cart, .search-cart-header .cart-content");
88
89        }
90        
91        if (isiPhoneiPad) {
92            $(".video-wrapper").css('display', 'none');
93        }
94
95        if (/Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
96            $( '.video-wrapper iframe' ).each(function () {
97                $(this).parents('.video-wrapper').addClass('display-none');
98            });
99
100            $( '.video-wrapper video' ).each(function () {
101                var VideoMuted = $(this).attr( 'muted' ); 
102                if ( typeof VideoMuted != "undefined" ) {
103                } else {
104                    $(this).parents('.video-wrapper').addClass('display-none');
105                }
106            });
107        }
108
109        $(".search-cart-header .top-cart a.shopping-cart").click(function () {
110            if(!isMobile){
111                var carturl = $(this).attr('href');
112                window.location = carturl;
113            }
114            if ($('.search-cart-header .cart-content').css('visibility') == 'visible') {
115                $(".search-cart-header .cart-content").css('opacity', '0');
116                $(".search-cart-header .cart-content").css('visibility', 'hidden');
117            }
118            else {
119                $(".search-cart-header .cart-content").css('opacity', '1');
120                $(".search-cart-header .cart-content").css('visibility', 'visible');
121
122            }
123        });
124
125        /*==============================================================*/
126        //Shrink nav on scroll - START CODE
127        /*==============================================================*/
128        if( !$( 'nav.navigation-menu, nav.navbar' ).hasClass( 'no-shrink-nav' ) && !$( 'nav.navbar' ).hasClass( 'non-sticky-header' ) ) {
129            if ($(window).scrollTop() > 10) {
130                $('nav.navigation-menu, nav.navbar').addClass('shrink-nav');
131            } else {
132                $('nav.navigation-menu, nav.navbar').removeClass('shrink-nav');
133            }
134        }
135        /*==============================================================*/
136        //Shrink nav on scroll - END CODE
137        /*==============================================================*/
138
139        // Add class in default menu
140        if( $( '.navbar .accordion-menu div' ).hasClass('default-menu-wrapper') ){
141            var nav_class = $( '.navbar .accordion-menu div.default-menu-wrapper' ).attr('class');
142            $( '.navbar .accordion-menu div.default-menu-wrapper' ).addClass('navbar-collapse collapse').removeClass( nav_class );
143            $( '.navbar .accordion-menu div.navbar-collapse > ul' ).addClass( nav_class );
144        }
145
146        $( '.custom-widget' ).each(function () {
147            if($(this).parents('.navbar, .pull-menu, footer').length <= 0) {
148               $(this).addClass('widget');
149            }
150        });
151
152        /*==============================================================*/
153        //Portfolio - START CODE
154        /*==============================================================*/
155        if (Modernizr.touch) {
156            // show the close overlay button
157            $(".close-overlay").removeClass("hidden");
158            // handle the adding of hover class when clicked
159            $(".porfilio-item").click(function (e) {
160                if (!$(this).hasClass("hover")) {
161                    $(this).addClass("hover");
162                }
163            });
164            // handle the closing of the overlay
165            $(".close-overlay").click(function (e) {
166                e.preventDefault();
167                e.stopPropagation();
168                if ($(this).closest(".porfilio-item").hasClass("hover")) {
169                    $(this).closest(".porfilio-item").removeClass("hover");
170                }
171            });
172        } else {
173            // handle the mouseenter functionality
174            $(".porfilio-item").mouseenter(function () {
175                $(this).addClass("hover");
176            })
177            // handle the mouseleave functionality
178            .mouseleave(function () {
179                $(this).removeClass("hover");
180            });
181        }
182
183        // use for portfolio sotring with masonry
184
185        var hidedefault = true;
186        var defaultvalue = false;
187        $portfolio = $('.masonry-items');
188        var portfolio_selector = $portfolio.parents( 'section' ).find('.portfolio-filter li.nav.active a').attr('data-filter');
189        
190        $portfolio.imagesLoaded(function () {
191            $portfolio.isotope({
192                itemSelector: 'li',
193                layoutMode: 'masonry',
194                filter: portfolio_selector
195            });
196        });
197
198        var default_arr = [];
199        var filter_arr = [];
200
201        $('.portfolio-filter > li.active > a').each(function( index ) {
202            var selector = $(this).attr('data-filter');
203            var uniqueid = $(this).attr('data-id');
204
205            if( uniqueid ){
206                filter_arr.push(uniqueid);
207                if( selector != '*'){
208                    hidedefault = false;
209                    $('.'+uniqueid).parent(".portfolio-infinite-scroll-pagination").infinitescroll('unbind');
210                }else{
211                    hidedefault = true;
212                    portfolioinfinite(uniqueid);
213                    $('.'+uniqueid).parent(".portfolio-infinite-scroll-pagination").infinitescroll('bind');
214                }
215            }else{
216                if( selector != '*'){
217                    hidedefault = false;
218                    $(".portfolio-infinite-scroll-pagination").infinitescroll('unbind');
219                }else{
220                    hidedefault = true;
221                    portfolioinfinite('');
222                    $(".portfolio-infinite-scroll-pagination").infinitescroll('bind');
223                }
224            }
225            default_selector(hidedefault);
226        });
227
228        function default_selector(hidedefault){
229            if( !hidedefault ) {
230                $portfolio.imagesLoaded(function () {
231                    $('.portfolio-filter, .masonry-items').each(function() {    
232                        if( $('#'+ $(this).attr( 'id' )+' > li.active > a').attr( 'data-id' ) != '' && typeof($('#'+ $(this).attr( 'id' )+' > li.active > a').attr( 'data-id' )) != "undefined" ){
233                            if( $.inArray( $('#'+ $(this).attr( 'id' )+' > li.active > a').attr( 'data-id' ), default_arr ) == -1 ){
234                                default_arr.push($('#'+ $(this).attr( 'id' )+' > li.active > a').attr( 'data-id' ));
235                            }
236                        }else if( $(this).attr( 'data-portfolio' ) != '' && typeof( $(this).attr( 'data-portfolio' ) ) != "undefined" ){
237                            if( $.inArray( $(this).attr( 'data-portfolio' ), default_arr ) == -1 ){
238                                default_arr.push($(this).attr( 'data-portfolio' ));
239                            }
240                        }else if( $(this).find("li.active > a").attr( 'data-uniqueid' ) != '' && typeof( $(this).find("li.active > a").attr( 'data-uniqueid' ) ) != "undefined" && $('ul.portfolio-filter').attr('id') ){
241                            if( $(this).find("li.active > a").attr( 'data-filter' ) != '*' ){
242                                default_arr.push($(this).find("li.active > a").attr( 'data-uniqueid' ));
243                                defaultvalue = true;
244                            }
245                        }
246                    });
247                    $(default_arr).each(function(key,value) {
248                        var portfolio_filter = $('.masonry-items.'+value);
249                        if( defaultvalue ){
250                            var data_id = $($('.'+ value)).find('li.nav.active a').attr( 'data-filter' );
251                        }else{
252                            var data_id = $($('#'+ value)).find('li.nav.active a').attr( 'data-filter' );
253                        }
254                        var portfolio_selector = data_id;
255                        if( portfolio_selector != '' && typeof(portfolio_selector) != 'undefined' ){
256                            $portfolio.imagesLoaded(function () {
257                                $('.'+ value).isotope({
258                                    layoutMode: 'masonry',
259                                    itemSelector: 'li',
260                                    filter: portfolio_selector
261                                });
262                            });
263                        }else{
264                            var portfolio_filter = $('.'+value);
265                            var portfolio_selector = portfolio_filter.find('li').attr("data-filter");
266                            portfolio_filter.imagesLoaded(function () {
267                                portfolio_filter.isotope({
268                                    itemSelector: 'li',
269                                    layoutMode: 'masonry',
270                                    filter: '*'
271                                });
272                            });
273                        }
274                    });
275                });
276            }
277        }
278
279        
280        // use for simple masonry ( for example /home-photography page )
281
282        $masonry_block = $('.masonry-block-items');
283        $masonry_block.imagesLoaded(function () {
284            $masonry_block.isotope({
285                itemSelector: 'li',
286                layoutMode: 'masonry'
287            });
288        });
289
290        $portfolio_selectors = $('.portfolio-filter > li > a');
291        $portfolio_selectors.on('click', function () {
292            var selector = $(this).attr('data-filter'); 
293            var uniqueid = $(this).attr('data-id');
294            if( uniqueid ){
295                if( $(this).attr( 'data-id' ) != '' ){
296                    $portfolio_selectors = $('#'+ $(this).attr( 'data-id' )+' > li > a');
297                    $portfolio_selectors.parent().removeClass('active');
298                    $(this).parent().addClass('active');
299                    $('.' + $(this).attr( 'data-id' )).isotope({filter: selector, masonry: { columnWidth: '.masonry-items li' }});                
300
301                }else{
302                    $portfolio_selectors.parent().removeClass('active');
303                    $(this).parent().addClass('active');
304                    $portfolio.isotope({filter: selector, masonry: { columnWidth: '.masonry-items li' }});
305                } 
306
307                if($(this).attr('data-filter') != '*'){
308                    $('.'+uniqueid).parent('.portfolio-infinite-scroll-pagination').infinitescroll('unbind');
309                }else{
310                    $('.'+uniqueid).parent('.portfolio-infinite-scroll-pagination').infinitescroll('bind');
311                }
312
313                var portfolio_arr = [];
314                $('.portfolio-filter').each(function () {
315                    if( $(this).attr('id') ){
316                        portfolio_arr.push($(this).attr('id'))
317                    }
318                    if( $(this).find('li.active a').attr('data-filter') == '*' ){
319                        uniqueid = $(this).find('li.active a').attr('data-id');
320                        $('.'+uniqueid).parent('.portfolio-infinite-scroll-pagination').infinitescroll('bind');
321                    }
322                });
323
324                $('.masonry-portfolio-grid').each(function () {
325                    var portfolio_select = $(this).attr("data-portfolio");
326                    if ( $.inArray( portfolio_select, portfolio_arr ) < 0 ) {
327                        $(this).parent('.portfolio-infinite-scroll-pagination').infinitescroll('retrieve');
328                    }
329                    var portfolio_select = $(this).attr("data-portfolio");
330                    var portfolio_uniq_id = $(this).attr("data-uniqueid");
331                    if( portfolio_select && typeof(portfolio_select) != 'undefined' ){
332                        portfolioinfinite(portfolio_select);
333                    }else if( portfolio_uniq_id && typeof( portfolio_uniq_id ) != 'undefined' ){
334                        portfolioinfinite(portfolio_uniq_id);
335                    }
336                });
337            }else{
338                $portfolio_selectors.parent().removeClass('active');
339                $(this).parent().addClass('active');
340                var selector = $(this).attr('data-filter');
341                if( selector != '*'){
342                    $(".portfolio-infinite-scroll-pagination").infinitescroll('unbind');
343                }else{
344                    $(".portfolio-infinite-scroll-pagination").infinitescroll('bind');
345                    portfolioinfinite('');
346                }
347                $portfolio.isotope({filter: selector, masonry: { columnWidth: '.masonry-items li' }});
348                }
349                return false;
350        });
351
352        $('.masonry-portfolio-grid').each(function () {
353            var portfolio_select = $(this).attr("data-portfolio");
354            if ( $.inArray( portfolio_select, filter_arr ) < 0 ) {
355                portfolioinfinite(portfolio_select);
356            }
357        });
358
359        $blog = $('.blog-masonry');
360        $blog.imagesLoaded(function () {
361
362            //ISOTOPE FUNCTION - FILTER PORTFOLIO FUNCTION
363            $blog.isotope({
364                itemSelector: '.blog-listing',
365                layoutMode: 'masonry'
366            });
367        });
368
369        /* Parallax Portfolio Shortcode Isotop */
370        $ParallaxPortfolio = $('.parallax-masonry-items');
371        var ParallaxPortfolioArrange, parallax_portfolio_selector = $ParallaxPortfolio.parents('section').find('.portfolio-filter li.nav.active a').attr('data-filter');
372        $ParallaxPortfolio.imagesLoaded(function () {
373            ParallaxPortfolioArrange = $ParallaxPortfolio.isotope({
374                itemSelector: '.parallax-portfolio-filter',
375                layoutMode: 'vertical',
376                filter: parallax_portfolio_selector
377            });
378            ParallaxPortfolioArrange.on('layoutComplete', onArrange);
379        });
380
381        $Parallaxportfolio_selectors = $('.hcode-parallax .portfolio-filter > li > a');
382        $Parallaxportfolio_selectors.on('click', function () {
383            $('.parallax-masonry-items').find('.parallax-portfolio').each(function () {
384                $(this).css({"background-attachment": "unset"});
385            });
386            $Parallaxportfolio_selectors.parent().removeClass('active');
387            $(this).parent().addClass('active');
388            var selector = $(this).attr('data-filter');
389            $ParallaxPortfolio.isotope({filter: selector, masonry: {columnWidth: '.parallax-masonry-items .parallax-portfolio-filter'}});
390            ParallaxPortfolioArrange.on('arrangeComplete', onArrange);
391            return false;
392        });
393
394        function onArrange() {
395            $('.parallax-masonry-items').find('.parallax-portfolio').each(function () {
396                $(this).css({"background-attachment": "fixed"});
397            });
398        }
399
400        $(window).resize(function () {
401            setTimeout(function () {
402                $portfolio.imagesLoaded( function() {
403                    $portfolio.isotope('layout');
404                });
405                $ParallaxPortfolio.imagesLoaded( function() {
406                    $ParallaxPortfolio.isotope('layout');
407                });
408                $blog.imagesLoaded( function() {
409                    $blog.isotope('layout');
410                });
411                $masonry_block.imagesLoaded( function() {
412                    $masonry_block.isotope('layout');
413                });
414            }, 500);
415        });
416        /*==============================================================*/
417        //Portfolio - END CODE
418        /*==============================================================*/
419
420        /*==============================================================*/
421        //Portfolio - Infinite Scroll
422        /*==============================================================*/
423
424        function portfolioinfinite(portfolio_val) {
425            if( portfolio_val ){
426                portfolio_val = '.'+portfolio_val;
427            }
428            var pagesNum = $('.masonry-items'+portfolio_val).parent().find("div.hcode
428-portfolio-infinite-scroll").attr('data-pagination');
429            $('.masonry-items'+portfolio_val).parent().infinitescroll({
430                nextSelector: 'div.hcode-portfolio-infinite-scroll a',
431                loading: {
432                    img: hcodeajaxurl.loading_image,
433                    msgText: '<div class="paging-loader" style="transform:scale(0.35);"><div class="circle"><div></div></div><div class="circle"><div></div></div><div class="circle"><div></div></div><div class="circle"><div></div></div></div>',
434                    finishedMsg: '<div class="finish-load">' + hcode_infinite_scroll_message.message + '</div>',
435                    speed: 'fast',
436                },
437                navSelector: 'div.hcode-portfolio-infinite-scroll',
438                contentSelector: $('.masonry-items'+portfolio_val).parent(),
439                itemSelector: '.masonry-items'+portfolio_val+' li',
440                maxPage: pagesNum,
441            }, function (newElements,opts) {
442                if( opts.state.currPage < opts.maxPage ){
443                    $('.masonry-items'+portfolio_val).parent().infinitescroll('bind');
444                }
445                //$('.hcode-portfolio-infinite-scroll').remove();
446                $('#infscr-loading').remove();
447                /* For new element set masonry */
448                var $newblogpost = $(newElements);
449                // append other items when they are loaded
450                $newblogpost.imagesLoaded( function() {
451                $('.masonry-items'+portfolio_val).append( $newblogpost )
452                  .isotope( 'appended', $newblogpost );
453                });
454
455                try {
456                    $(".fit-videos").fitVids();
457                }catch (err) { }
458
459                /* For Magnific Popup */
460                var lightboxgallerygroups = {};
461                $('.lightboxgalleryitem').each(function() {
462                  var id = $(this).attr('data-group');
463                  if(!lightboxgallerygroups[id]) {
464                    lightboxgallerygroups[id] = [];
465                  } 
466                  
467                  lightboxgallerygroups[id].push( this );
468                });
469
470                $.each(lightboxgallerygroups, function() {
471                    $(this).magnificPopup({
472                        type: 'image',
473                        closeOnContentClick: true,
474                        closeBtnInside: false,
475                        gallery: { enabled:true },
476                        image: {
477                            titleSrc: function (item) {
478                                var title = '';
479                                var lightbox_caption = '';
480                                if( item.el.attr('title') ){
481                                    title = item.el.attr('title');
482                                }
483                                if( item.el.attr('lightbox_caption') ){
484                                    lightbox_caption = '<span class="hcode-lightbox-caption">'+item.el.attr('lightbox_caption')+'</span>';
485                                }
486                                return title + lightbox_caption;
487                            }
488                        },
489                        // Remove close on popup bg v1.5
490                        callbacks: {
491                            open: function () {
492                                $.magnificPopup.instance.close = function() {
493                                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
494                                        $.magnificPopup.proto.close.call(this);
495                                    } else {
496                                        $('button.mfp-close').click(function() {
497                                            $.magnificPopup.proto.close.call(this);
498                                        });
499                                    }
500                                }
501                            }
502                        }
503                    });
504                });
505
506                $('.simple-ajax-popup-align-top').magnificPopup({
507                    type: 'ajax',
508                    alignTop: true,
509                    closeOnContentClick: false,
510                    fixedContentPos: true,
511                    closeBtnInside: false,
512                    callbacks: {
513                        open: function () {
514                            // Remove close on popup bg v1.5
515                            $.magnificPopup.instance.close = function() {
516                                if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
517                                    $.magnificPopup.proto.close.call(this);
518                                } else {
519                                    $( 'button.mfp-close' ).live( 'click', function() {
520                                        $.magnificPopup.proto.close.call(this);
521                                    });
522                                }
523                            }
524                        }
525                    }
526                });
527
528                $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
529                    disableOn: 700,
530                    type: 'iframe',
531                    mainClass: 'mfp-fade',
532                    removalDelay: 160,
533                    preloader: false,
534                    fixedContentPos: false,
535                    callbacks: {
536                        open: function () {
537                            if (!isMobile)
538                                $('body').addClass('overflow-hidden');
539
540                            // Remove close on popup bg v1.5
541                            $.magnificPopup.instance.close = function() {
542                                if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
543                                    $.magnificPopup.proto.close.call(this);
544                                } else {
545                                    $( 'button.mfp-close' ).live( 'click', function() {
546                                        $.magnificPopup.proto.close.call(this);
547                                    });
548                                }
549                            }
550                        },
551                        close: function () {
552                            if (!isMobile)
553                                $('body').removeClass('overflow-hidden');
554                        }
555                        // e.t.c.
556                    }
557                });
558            });
559        }
560
561        /*==============================================================*/
562        //Portfolio - End Infinite Scroll
563        /*==============================================================*/
564
565        /*==============================================================*/
566        //Set Parallax - START CODE
567        /*==============================================================*/
568        SetParallax();
569        /*==============================================================*/
570        //Set Parallax - END CODE
571        /*==============================================================*/
572
573        /*==============================================================*/
574        //Sliders owlCarousel - START CODE
575        /*==============================================================*/
576
577        // jQuery use in Post slide loop
578        $(".blog-gallery").owlCarousel({
579            nav: true, // Show next and prev buttons
580            autoplaySpeed: 300,
581            dotsSpeed: 400,
582            items: 1,
583            rtl: $("body").hasClass("rtl") ? true:false,
584            loop:true,
585            navText: ["<i class='fas fa-angle-left'></i>", "<i class='fas fa-angle-right'></i>"]
586        });
587        // jQuery use in hcode_feature_product_shop in Shop top five shortcode
588        $("#owl-demo-small").owlCarousel({
589            nav: true, // Show next and prev buttons
590            autoplaySpeed: 300,
591            dotsSpeed: 400,
592            items: 1,
593            rtl: $("body").hasClass("rtl") ? true:false,
594            loop:true,
595            navText: ["<i class='fas fa-angle-left'></i>", "<i class='fas fa-angle-right'></i>"]
596        });
597
598        /*==============================================================*/
599        //Sliders owlCarousel - END CODE
600        /*==============================================================*/
601
602        /*==============================================================*/
603        //Stop Closing magnificPopup on selected elements - START CODE
604        /*==============================================================*/
605
606        $(".owl-dots > .owl-dot").click(function (e) {
607            if ($(e.target).is('.mfp-close')){
608                return;
609            }else{
610                $(this).trigger('to.owl.carousel', [$(this).index(), 300]);
611                return false;
612            }
613        });
614        $(".owl-nav > .owl-prev").click(function (e) {
615            if ($(e.target).is('.mfp-close'))
616                return;
617            return false;
618        });
619        $(".owl-nav > .owl-next").click(function (e) {
620            if ($(e.target).is('.mfp-close'))
621                return;
622            return false;
623        });
624        /*==============================================================*/
625        //Stop Closing magnificPopup on selected elements - END CODE
626        /*==============================================================*/
627
628        /*==============================================================*/
629        // Woocommerce Product Thumbnail Slider - START CODE
630        /*==============================================================*/
631
632        
633            var sync1 = $(".hcode-single-big-product-thumbnail-carousel");
634            var sync2 = $(".hcode-single-product-thumbnail-carousel");
635
636            var slides = sync1.owlCarousel({
637                items: 1,
638                smartSpeed: 1000,
639                nav: true,
640                rtl: $("body").hasClass("rtl") ? true:false,
641                loop: true,
642                dots:false,
643                navText: ["<i class='fas fa-angle-left'></i>", "<i class='fas fa-angle-right'></i>"]
644            }).on('change.owl.carousel', syncPosition ).data('owl.carousel');
645            var thumbs = sync2.owlCarousel({
646                responsive:{
647                    0 : {
648                        items:1,
649                    },
650                    479 : {
651                        items:3
652                    }
653                },
654                dots:false,
655                rtl: $("body").hasClass("rtl") ? true:false,
656                loop: false,
657                nav: true,
658                navText: ["<i class='fas fa-angle-left'></i>", "<i class='fas fa-angle-right'></i>"],
659                responsiveRefreshRate : 100,
660                onInitialized : function(el){
661                  $(el.target).find(".owl-item").removeClass("active-slide").eq(0).addClass("active-slide");
662                }
663            }).on('click', '.owl-item', function(e) {
664                e.preventDefault(); 
665
666                var current = $(this).index();
667                var visibleItems = [];
668                
669                sync1.trigger("to.owl.carousel",current);
670                $(".hcode-single-product-thumbnail-carousel").find(".owl-item.active").each(function(index) {
671                    visibleItems.push($(this).index());
672                });
673                if($(".hcode-single-product-thumbnail-carousel").data("owl.carousel") !== undefined){
674                  center(current, visibleItems);
675                }
676                $(".hcode-single-product-thumbnail-carousel").find(".owl-item").removeClass("active-slide").eq(current).addClass("active-slide");
677            }).data('owl.carousel');
678
679            function syncPosition(e){
680                e.preventDefault(); 
681                if (e.namespace && e.property.name === 'position') {
682                    var current = e.relatedTarget.relative(e.property.value);
683                    var visibleItems = [];
684                    $(".hcode-single-product-thumbnail-carousel").find(".owl-item.active").each(function(index) {
685                        visibleItems.push($(this).index());
686                    });
687                    $(".hcode-single-product-thumbnail-carousel").find(".owl-item").removeClass("active-slide").eq(current).addClass("active-slide");
688                    if($(".hcode-single-product-thumbnail-carousel").data("owl.carousel") !== undefined){
689                      center(current, visibleItems);
690                    }
691                    if($(".hcode-single-product-thumbnail-carousel").find(".owl-item.active").length > 3 ){
692                        thumbs.to(e.relatedTarget.relative(e.property.value), 300, true);
693                    }
694                }
695            }
696
697            function center(number, visibleItems){
698                var sync2visible = visibleItems;
699                var num = number;
700                var found = false;
701                for(var i in sync2visible){
702                  if(num === sync2visible[i]){
703                    var found = true;
704                  }
705                }
706
707                if(found === false){
708                  if(num > sync2visible[sync2visible.length-1]){
709                    sync2.trigger("to.owl.carousel", num - sync2visible.length+2)
710                  }else{
711                    if(num - 1 === -1){
712                      num = 0;
713                    }
714                    sync2.trigger("to.owl.carousel", num);
715                  }
716                } else if(num === sync2visible[sync2visible.length-1]){
717                  sync2.trigger("to.owl.carousel", sync2visible[1])
718                } else if(num === sync2visible[0]){
719                  sync2.trigger("to.owl.carousel", num-1)
720                }
721            }
722
723            var owlCarousel = $('.owl-carousel');
724            owlCarousel.each(function(index) {
725                $(this).find('.owl-nav, .owl-dots').wrapAll("<div class='owl-controls'></div>");
726            }); 
727
728        /*==============================================================*/
729        // Woocommerce Product Thumbnail Slider - End CODE
730        /*==============================================================*/
731        
732        /*==============================================================*/
733        // Add "intro-page" Class in Intro Pages  - START CODE
734        /*==============================================================*/
735
736        if( $('section').hasClass('intro-page') ){
737            $('section').removeClass('intro-page');
738            $('body').addClass('intro-page');
739        }
740        /*==============================================================*/
741        // Add "intro-page" Class in Intro Pages  - End CODE
742        /*==============================================================*/
743
744        /*==============================================================*/
745        //WOW Animation  - START CODE
746        /*==============================================================*/
747
748        var wow = new WOW({
749            boxClass: 'wow',
750            animateClass: 'animated',
751            offset: 90,
752            mobile: true,
753            live: true
754        });
755        wow.init();
756        /*==============================================================*/
757        //WOW Animation  - END CODE
758        /*==============================================================*/
759
760        /*==============================================================*/
761        //accordion  - START CODE
762        /*==============================================================*/
763
764        $('.collapse').on('show.bs.collapse', function () {
765            var id = $(this).attr('id');
766            $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion');
767            $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-minus"></i>');
768        });
769        $('.collapse').on('hide.bs.collapse', function () {
770            var id = $(this).attr('id');
771            $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion');
772            $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-plus"></i>');
773        });
774        $('.nav.navbar-nav a.inner-link').click(function () {
775            $(this).parents('ul.navbar-nav').find('a.inner-link').removeClass('active');
776            $(this).addClass('active');
777            if ($('.navbar-header .navbar-toggle').is(':visible'))
778                $(this).parents('.navbar-collapse').collapse('hide');
779        });
780        $('.accordion-style2 .collapse').on('show.bs.collapse', function () {
781            var id = $(this).attr('id');
782            $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion');
783            $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-angle-up"></i>');
784        });
785        $('.accordion-style2 .collapse').on('hide.bs.collapse', function () {
786            var id = $(this).attr('id');
787            $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion');
788            $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-angle-down"></i>');
789        });
790        $('.accordion-style3 .collapse').on('show.bs.collapse', function () {
791            var id = $(this).attr('id');
792            $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion');
793            $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-angle-up"></i>');
794        });
795        $('.accordion-style3 .collapse').on('hide.bs.collapse', function () {
796            var id = $(this).attr('id');
797            $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion');
798            $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-angle-down"></i>');
799        });
800        /*==============================================================*/
801        //accordion - END CODE
802        /*==============================================================*/
803
804        /*==============================================================*/
805        //toggles  - START CODE
806        /*==============================================================*/
807
808        $('toggles .collapse').on('show.bs.collapse', function () {
809            var id = $(this).attr('id');
810            $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion');
811            $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-minus"></i>');
812        });
813        $('toggles .collapse').on('hide.bs.collapse', function () {
814            var id = $(this).attr('id');
815            $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion');
816            $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-plus"></i>');
817        });
818        $('.toggles-style2 .collapse').on('show.bs.collapse', function () {
819            var id = $(this).attr('id');
820            $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion');
821            $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-angle-up"></i>');
822        });
823        $('.toggles-style2 .collapse').on('hide.bs.collapse', function () {
824            var id = $(this).attr('id');
825            $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion');
826            $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-angle-down"></i>');
827        });
828        /*==============================================================*/
829        //toggles  - END CODE
830        /*==============================================================*/
831
832        /*==============================================================*/
833        //fit video  - START CODE
834        /*==============================================================*/
835        
836        try {
837            $(".fit-videos").fitVids();
838        }
839        catch (err) {
840
841        }
842
843        /*==============================================================*/
844        //fit video  - END CODE
845        /*==============================================================*/
846
847        /*==============================================================*/
848        //google map - mouse scrolling wheel behavior - START CODE
849        /*==============================================================*/
850        // you want to enable the pointer events only on click;
851
852        $('#map_canvas1').addClass('scrolloff'); // set the pointer events to none on doc ready
853        $('#canvas1').on('click', function () {
854            $('#map_canvas1').removeClass('scrolloff'); // set the pointer events true on click
855        });
856        // you want to disable pointer events when the mouse leave the canvas area;
857
858        $("#map_canvas1").mouseleave(function () {
859            $('#map_canvas1').addClass('scrolloff'); // set the pointer events to none when mouse leaves the map area
860        });
861        /*==============================================================*/
862        //google map - mouse scrolling wheel behavior - END CODE
863        /*==============================================================*/
864
865        /*==============================================================*/
866        //Search - START CODE
867        /*==============================================================*/
868        $("input.search-input").bind("keypress", function (event) {
869            if (event.which == 13 && !isMobile) {
870                $("button.search-button").click();
871                event.preventDefault();
872            }
873        });
874        $("input.search-input").bind("keyup", function (event) {
875            if ($(this).val() == null || $(this).val() == "") {
876                $(this).css({"border": "none", "border-bottom": "2px solid red"});
877            }
878            else {
879                $(this).css({"border": "none", "border-bottom": "2px solid #000"});
880            }
881        });
882        function validationSearchForm() {
883            var error = true;
884            $('#search-header input[type=text]').each(function (index) {
885                if (index == 0) {
886                    if ($(this).val() == null || $(this).val() == "") {
887                        $("#search-header").find("input:eq(" + index + ")").css({"border": "none", "border-bottom": "2px solid red"});
888                        error = false;
889                    }
890                    else {
891                        $("#search-header").find("input:eq(" + index + ")").css({"border": "none", "border-bottom": "2px solid #000"});
892                    }
893                }
894            });
895            return error;
896        }
897        $("form.search-form, form.search-form-result").submit(function (event) {
898            var error = validationSearchForm();
899            if (error) {
900                var action = $(this).attr('action');
901                action = action + '?' + $(this).serialize();
902                window.location = action;
903            }
904
905            event.preventDefault();
906        });
907
908        $('.navbar .navbar-collapse a.dropdown-toggle, .accordion-style1 .panel-heading a, .accordion-style2 .panel-heading a, .accordion-style3 .panel-heading a, .toggles .panel-heading a, .toggles-style2 .panel-heading a, .toggles-style3 .panel-heading a, a.carousel-control, .nav-tabs a[data-toggle="tab"], a.shopping-cart').click(function (e) {
909            e.preventDefault();
910        });
911        $('body').on('touchstart click', function (e) {
912            if ($(window).width() < 992) {
913                if (!$('.navbar-collapse').has(e.target).is('.navbar-collapse') && $('.navbar-collapse').hasClass('in') && !$(e.target).hasClass('navbar-toggle')) {
914                    $('.navbar-collapse').collapse('hide');
915                }
916            } else {
917                if (!$('.navbar-collapse').has(e.target).is('.navbar-collapse') && $('.navbar-collapse ul').hasClass('in')) {
918                    $('.navbar-collapse').find('a.dropdown-toggle').addClass('collapsed');
919                    $('.navbar-collapse').find('ul.dropdown-menu').removeClass('in');
920                    $('.navbar-collapse a.dropdown-toggle').removeClass('active');
921                }
922            }
923        });
924        $('.navbar-collapse a.dropdown-toggle').on('touchstart', function (e) {
925            $('.navbar-collapse a.dropdown-toggle').not(this).removeClass('active');
926            $('.navbar-collapse a.dropdown-toggle').parent('li').not(this).removeClass('open');
927            if ($(this).hasClass('active')){
928                $(this).removeClass('active');
929            } else {
930                $(this).addClass('active');
931                $(this).not('.megamenu-right-icon').parent('li').addClass('open');
932            }
933        });
934
935        $("button.navbar-toggle").click(function () {
936            if (isMobile) {
937                $(".search-cart-header .cart-content").css('opacity', '0');
938                $(".search-cart-header .cart-content").css('visibility', 'hidden');
939            }
940        });
941        $("a.dropdown-toggle").click(function () {
942            if (isMobile) {
943                $(".search-cart-header .cart-content").css('opacity', '0');
944                $(".search-cart-header .cart-content").css('visibility', 'hidden');
945            }
946        });
947
948
949        /*==============================================================*/
950        //Search - END CODE
951        /*==============================================================*/
952
953        /*==============================================================*/
954        //Parallax - START CODE
955        /*==============================================================*/
956
957        var $elem = $('#content');
958        $('#scroll_to_top').fadeIn('slow');
959        $('#nav_down').fadeIn('slow');
960        $(window).bind('scrollstart', function () {
961            $('#scroll_to_top,#nav_down').stop().animate({'opacity': '0.2'});
962        });
963        $(window).bind('scrollstop', function () {
964            $('#scroll_to_top,#nav_down').stop().animate({'opacity': '1'});
965        });
966        $('#nav_down').click(
967                function (e) {
968                    $('html, body').animate({scrollTop: $elem.height()}, 800);
969                }
970        );
971        $('#scroll_to_top').click(
972                function (e) {
973                    $('html, body').animate({scrollTop: '0px'}, 800);
974                }
975        );
976        /*==============================================================*/
977        //Parallax - END CODE
978        /*==============================================================*/
979
980        // pull-menu close on href click event in mobile devices
981        $( document ).on( 'click', '.pull-menu a.inner-link', function (e) {
982            if( !( $( this ).parents( '.hamburger-menu1' ).length > 0 ) || isMobile ) {
983                $('#close-button').click();
984            }
985        });
986
987        if( $('div').hasClass('feature_nav')){
988            $(".feature_nav .next").click(function () {
989                $(this).parent().parent().find('.owl-carousel').trigger('next.owl.carousel');
990            });
991            $(".feature_nav .prev").click(function () {
992                $(this).parent().parent().find('.owl-carousel').trigger('prev.owl.carousel');
993            });
994        }
995    });
996
997    /*==============================================================*/
998    // Counter Number Appear - START CODE
999    /*==============================================================*/
1000
1001    $(document).ready(function () {
1002        // Check counter div is visible then animate counter
1003        $('.counter-number').appear();
1004        $(document.body).on('appear', '.counter-number', function (e) {
1005            // this code is executed for each appeared element
1006            var element = $(this);
1007            if (!$(this).hasClass('appear')) {
1008                animatecounters(element);
1009                $(this).addClass('appear');
1010            }
1011        });
1012
1013        // Check chart div is visible then animate chart
1014        $('.chart').appear();
1015        $(document.body).on('appear', '.chart', function (e) {
1016            // this code is executed for each appeared element
1017            var element = $(this);
1018            if (!$(this).hasClass('appear')) {
1019                animatecharts(element);
1020                $(this).addClass('appear');
1021            }
1022        });
1023    });
1024
1025    /*==============================================================*/
1026    // Counter Number Appear - END CODE
1027    /*==============================================================*/
1028
1029    /*==============================================================*/
1030    //Counter Number - START CODE
1031    /*==============================================================*/
1032
1033    function animatecounters(element) {
1034         var getCounterNumber = $(element).attr('data-to');
1035         $({ ValuerHbcO: 0 }).delay(0).animate({ ValuerHbcO: getCounterNumber },
1036         {
1037             duration: 2000,
1038             easing: "swing",
1039             step: function (currentLeft) {
1040                 var roundNumber = Math.ceil( currentLeft );
1041                 $(element).text( roundNumber );
1042             }
1043         });
1044    }
1045    /*==============================================================*/
1046    //Counter Number - END CODE
1047    /*==============================================================*/
1048
1049    /*==============================================================*/
1050    //Chart Animated - START CODE
1051    /*==============================================================*/
1052
1053    function animatecharts(element) {
1054        element.data('easyPieChart').update(0);
1055        element.data('easyPieChart').update(element.attr("data-percent"));
1056    }
1057    /*==============================================================*/
1058    //Chart Animated - END CODE
1059    /*==============================================================*/
1060
1061    /*==============================================================*/
1062    //Navigation - START CODE
1063    /*==============================================================*/
1064    
1065    // Shrink nav on scroll
1066    $(window).scroll(function () {
1067        if( !$( 'nav.navigation-menu, nav.navbar' ).hasClass( 'no-shrink-nav' ) && !$( 'nav.navbar' ).hasClass( 'non-sticky-header' ) ) {
1068            if( $(window).scrollTop() > 10 ) {
1069                $('nav.navigation-menu, nav.navbar').addClass('shrink-nav');
1070                $('nav.hcode-nav-margin').removeClass('no-transition');
1071                    CenterLogoHeight();
1072                    marginNavbar();
1073            } else {
1074                $('nav.navigation-menu, nav.navbar').removeClass('shrink-nav');
1075                $('nav.hcode-nav-margin').addClass('no-transition');
1076                    CenterLogoHeight();
1077                    onloadmargin();
1078                    SetResizeContent();
1079                    marginNavbar();
1080            }
1081        }
1082    });
1083    // Resize Header Menu
1084    function SetResizeHeaderMenu() {
1085        var width = $('nav.navbar').children('div.container').width();
1086        $("ul.mega-menu-full").each(function () {
1087            $(this).css('width', width + 'px');
1088        });
1089    }
1090    /*==============================================================*/
1091    //Navigation - END CODE
1092    /*==============================================================*/
1093
1094
1095    /*==============================================================*/
1096    //Parallax - START CODE
1097    /*==============================================================*/
1098    // Parallax Fix Image Scripts 
1099
1100    $('.parallax-fix').each(function () {
1101        if ($(this).children('.parallax-background-img').length) {
1102            var imgSrc = $(this).children('.parallax-background-img').attr('src');
1103            $(this).css('background', 'url("' + imgSrc + '")');
1104            $(this).children('.parallax-background-img').remove();
1105            $(this).css('background-position', '50% 0%');
1106        }
1107
1108    });
1109    var IsParallaxGenerated = false;
1110    function SetParallax() {
1111
1112        if( isiPhoneiPad )
1113            return false;
1114
1115        if ($(window).width() > 1030 && !IsParallaxGenerated) {
1116            $('.parallax1').parallax("50%", 0.1);
1117            $('.parallax2').parallax("50%", 0.2);
1118            $('.parallax3').parallax("50%", 0.3);
1119            $('.parallax4').parallax("50%", 0.4);
1120            $('.parallax5').parallax("50%", 0.5);
1121            $('.parallax6').parallax("50%", 0.6);
1122            $('.parallax7').parallax("50%", 0.7);
1123            $('.parallax8').parallax("50%", 0.8);
1124            $('.parallax9').parallax("50%", 0.05);
1125            $('.parallax10').parallax("50%", 0.02);
1126            $('.parallax11').parallax("50%", 0.01);
1127            $('.parallax12').parallax("50%", 0.099);
1128            IsParallaxGenerated = true;
1129        }
1130    }
1131    /*==============================================================*/
1132    //Parallax - END CODE
1133    /*==============================================================*/
1134
1135    /*==============================================================*/
1136    //Mobile Toggle Control - START CODE
1137    /*==============================================================*/
1138
1139    $('.mobile-toggle').click(function () {
1140        $('nav').toggleClass('open-nav');
1141    });
1142    $('.dropdown-arrow').click(function () {
1143        if ($('.mobile-toggle').is(":visible")) {
1144            if ($(this).children('.dropdown').hasClass('open-nav')) {
1145                $(this).children('.dropdown').removeClass('open-nav');
1146            } else {
1147                $('.dropdown').removeClass('open-nav');
1148                $(this).children('.dropdown').addClass('open-nav');
1149            }
1150        }
1151    });
1152    /*==============================================================*/
1153    //Mobile Toggle Control - END CODE
1154    /*==============================================================*/
1155
1156    /*==============================================================*/
1157    //Contact Form Focus Remove Border- START CODE
1158    /*==============================================================*/
1159    $("form.wpcf7-form input").focus(function () {
1160        if ($(this).hasClass("wpcf7-not-valid")) {
1161            $(this).removeClass("wpcf7-not-valid");
1162            $(this).parent().find(".wpcf7-not-valid-tip").remove();
1163            $(this).parents().find(".wpcf7-validation-errors").css("display", "none"); 
1164        }
1165    });
1166    /*==============================================================*/
1167    //Contact Form Focus Remove Border- END CODE
1168    /*==============================================================*/
1169
1170    /*==============================================================*/
1171    //Position Fullwidth Subnavs fullwidth correctly - START CODE
1172    /*==============================================================*/
1173    $('.dropdown-fullwidth').each(function () {
1174        $(this).css('width', $('.row').width());
1175        var subNavOffset = -($('nav .row').innerWidth() - $('.menu').innerWidth() - 15);
1176        $(this).css('left', subNavOffset);
1177    });
1178    /*==============================================================*/
1179    //Position Fullwidth Subnavs fullwidth correctly - END CODE
1180    /*==============================================================*/
1181
1182    /*==============================================================*/
1183    //Smooth Scroll - START CODE
1184    /*==============================================================*/
1185    var scrollAnimationTime = 1200,
1186        scrollAnimation = 'easeInOutExpo';
1187    $('a.scrollto').bind('click.smoothscroll', function (event) {
1188        event.preventDefault();
1189        var target = this.hash;
1190        $('html, body').stop()
1191                .animate({
1192                    'scrollTop': $(target)
1193                            .offset()
1194                            .top
1195                }, scrollAnimationTime, scrollAnimation, function () {
1196                    window.location.hash = target;
1197                });
1198    });
1199    $(document).on("scroll", dynamic_height);
1200    $(document).on('click', 'inner-link', function () {
1201        dynamic_height();
1202    });
1203    function dynamic_height(){
1204        var header_offset = $(".navbar").attr('data-offset');
1205        var general_offset = 0;
1206        if ( typeof header_offset !== typeof undefined && header_offset !== false ) {
1207            var general_offset = header_offset;
1208        }    
1209        $('.inner-link').smoothScroll({
1210            speed: 900,
1211            offset: parseInt( general_offset )
1212        });
1213
1214    }
1215    
1216    // Inner links
1217    $(document).ready(function () {
1218        dynamic_height();
1219    });
1220
1221    $(document).ready(function () {
1222        // Stop Propagation After Button Click
1223        $('.scrollToDownSection .inner-link, .scrollToDownSection form').click(function(event) {
1224            event.stopPropagation();
1225        });
1226
1227        $('section.scrollToDownSection').click(function(){
1228           var section_id = $( $(this).attr('data-section-id') );
1229           $('html, body').animate({scrollTop: section_id.offset().top}, 800);
1230        });
1231    });
1232    // Single Product Readmore button link
1233    $('.woo-inner-link').click(function(){
1234        $(this).attr("data-toggle","tab");
1235        $("html,body").animate({scrollTop:$(".product-deails-tab").offset().top - 80 }, 1000);
1236        $(".nav-tabs-light li").removeClass("active");
1237        $(".nav-tabs-light li.description_tab ").addClass("active");
1238    });
1239
1240    /*==============================================================*/
1241    //Smooth Scroll - END CODE
1242    /*==============================================================*/
1243
1244    /*==============================================================*/
1245    //Full Screen Header - START CODE
1246    /*==============================================================*/
1247
1248    function SetResizeContent() {
1249        var $deductheight = 0;
1250        var $minheight = $(window).height();
1251        if( $(".parent-section section:first.full-screen, .parent-section section:first .full-screen").length > 0 && !$('body').hasClass('vc_editor') ) {
1252            var $miniheaderheight = $(".top-header-area").outerHeight();
1253            if( $miniheaderheight && $miniheaderheight != null ){
1254                if( $(window).width() > 767 ) {
1255                    $deductheight += $miniheaderheight;
1256                }else{
1257                    if( $('header').hasClass('mini-header-mobile') ){
1258                        $deductheight += $miniheaderheight;
1259                    }
1260                }
1261            }
1262            var admin_bar_height = $('#wpadminbar').outerHeight();
1263            if( admin_bar_height && admin_bar_height != null ){
1264                $deductheight += admin_bar_height;
1265            }
1266            if( !$(".parent-section").hasClass("content-top-space") ){
1267                var $headerheight = $(".navbar").outerHeight();
1268                if( $headerheight && $headerheight != null ){
1269                    $deductheight += $headerheight;
1270                }
1271            }
1272            var $titleheight = $(".page-title-section").outerHeight();
1273            if( $titleheight && $titleheight != null ){
1274                $deductheight += $titleheight;
1275            }
1276            $(".full-screen").css('min-height', $minheight);
1277            $(".parent-section section:first.full-screen, .parent-section section:first .full-screen").css('min-height', $minheight - $deductheight );
1278        } else {
1279            $(".full-screen").css('min-height', $minheight);
1280        }
1281
1282         var minwidth = $(window).width();
1283         $(".full-screen-width").css('min-width', minwidth);
1284
1285         $('.menu-first-level').each(function () {
1286            var menu_link = $(this).children('a');
1287            var dataurl = menu_link.attr('data-redirect-url');
1288            var datadefaulturl = menu_link.attr('data-default-url');
1289            if( $(this).hasClass('hcode-menu-ajax-popup') ){
1290                $(menu_link).removeAttr('data-toggle');
1291                $(this).children('a').attr('href', dataurl);
1292                $(this).removeClass('menu-first-level');
1293            } else {
1294                if (minwidth >= 992) {
1295                    $(menu_link).removeAttr('data-toggle');
1296                    $(this).children('a').attr('href', dataurl);
1297                } else {
1298                    $(menu_link).attr('data-toggle', 'collapse');
1299                    $(this).children('a').attr('href', datadefaulturl);
1300                }
1301            }
1302         });
1303
1304         if ($(window).width() <= 600) {
1305            $('#wpadminbar').css('position','fixed');
1306         } else {
1307            $('#wpadminbar').css('position','');
1308         }
1309    }
1310
1311    /* center logo container height */
1312    function CenterLogoHeight(){
1313        if( $(".navbar").hasClass("header-center-logo") ){
1314            var centerLogoHeight = $(".hcode-header-logo.center-logo").outerHeight();
1315            var menuHeight = $(".accordion-menu").outerHeight();
1316            if( centerLogoHeight || menuHeight ){
1317                var navContainerHeight = ( menuHeight > centerLogoHeight ) ? menuHeight : centerLogoHeight;
1318                $(".navbar").find(".nav-header-container").css('cssText', 'height: ' + navContainerHeight + 'px;');
1319            }
1320        }
1321
1322    }
1323
1324    CenterLogoHeight();
1325    SetResizeContent();
1326    /*==============================================================*/
1327    //Full Screen Header - END CODE
1328    /*==============================================================*/
1329
1330
1331    /*==============================================================*/
1332    //Window Resize Events - START CODE
1333    /*==============================================================*/
1334    $(window).resize(function () {
1335
1336        HamburderMenuCustomScroll();
1337        OnePageActiveOnScroll();
1338        //Position Fullwidth Subnavs fullwidth correctly
1339        $('.dropdown-fullwidth').each(function () {
1340            $(this).css('width', $('.row').width());
1341            var subNavOffset = -($('nav .row').innerWidth() - $('.menu').innerWidth() - 15);
1342            $(this).css('left', subNavOffset);
1343        });
1344        SetResizeContent();
1345        CenterLogoHeight();
1346        setTimeout(function () {
1347            SetResizeHeaderMenu();
1348        }, 200);
1349        if ($(window).width() >= 992 && $('.navbar-collapse').hasClass('in')) {
1350            $('.navbar-collapse').removeClass('in');
1351            //$('.navbar-collapse').removeClass('in').find('ul.dropdown-menu').removeClass('in').parent('li.dropdown').addClass('open');
1352            $('.navbar-collapse ul.dropdown-menu').each(function () {
1353                if ($(this).hasClass('in')) {
1354                    $(this).removeClass('in'); //.parent('li.dropdown').addClass('open');
1355                }
1356            });
1357            $('ul.navbar-nav > li.dropdown > a.dropdown-toggle').addClass('collapsed');
1358            $('.logo').focus();
1359            $('.navbar-collapse a.dropdown-toggle').removeClass('active');
1360        }
1361
1362        setTimeout(function () {
1363            SetParallax();
1364        }, 1000);
1365    });
1366    /*==============================================================*/
1367    //Window Resize Events - END CODE
1368    /*==============================================================*/
1369
1370    /*==============================================================*/
1371    //Countdown Timer - START CODE
1372    /*==============================================================*/
1373    $(document).ready(function () {
1374        $('.counter-hidden').each(function () {
1375            if($(this).hasClass('counter-underconstruction-date')){
1376                
1377                var $counter_date = $('.counter-underconstruction-date').html();
1378
1379                /* Get Counter taxts */
1380                var $CounterDay, $CounterHours, $CounterMinutes, $CounterSeconds = '';
1381                var CounterDayattr = $(this).parent().find('#counter-underconstruction').attr('data-days-text');
1382                if( typeof CounterDayattr !== typeof undefined && CounterDayattr !== false ) {
1383                    var $CounterDay = '<span>'+CounterDayattr+'</span>';
1384                }
1385                var CounterHoursattr = $(this).parent().find('#counter-underconstruction').attr('data-hours-text');
1386                if( typeof CounterHoursattr !== typeof undefined && CounterHoursattr !== false ) {
1387                    var $CounterHours = '<span>'+CounterHoursattr+'</span>';
1388                }
1389                var CounterMinutesattr = $(this).parent().find('#counter-underconstruction').attr('data-minutes-text');
1390                if( typeof CounterMinutesattr !== typeof undefined && CounterMinutesattr !== false ) {
1391                    var $CounterMinutes = '<span>'+CounterMinutesattr+'</span>';
1392                }
1393                var CounterSecondsattr = $(this).parent().find('#counter-underconstruction').attr('data-seconds-text');
1394                if( typeof CounterSecondsattr !== typeof undefined && CounterSecondsattr !== false ) {
1395                    var $CounterSeconds = '<span>'+CounterSecondsattr+'</span>';
1396                }
1397                
1398                $(this).parent().find('#counter-underconstruction').countdown($counter_date+' 00:00:00').on('update.countdown', function (event) {
1399                    var $this = $(this).parent().find('#counter-underconstruction').html(event.strftime('' + 
1400                        '<div class="counter-container"><div class="counter-box first"><div class="number">%-D</div>'+$CounterDay+'</div>' + 
1401                        '<div class="counter-box"><div class="number">%H</div>'+$CounterHours+'</div>' + 
1402                        '<div class="counter-box"><div class="number">%M</div>'+$CounterMinutes+'</div>' + 
1403                        '<div class="counter-box last"><div class="number">%S</div>'+$CounterSeconds+'</div></div>'))
1404                });
1405            }
1406        });
1407
1408        $('.counter-hidden').each(function () {
1409            if( $(this).hasClass('hcode-time-counter-date')){
1410                var $counter_date = $(this).html();
1411
1412                /* Get Counter taxts */
1413                var $CounterDay, $CounterHours, $CounterMinutes, $CounterSeconds = '';
1414                var CounterDayattr = $(this).parent().find('#hcode-time-counter').attr('data-days-text');
1415                if( typeof CounterDayattr !== typeof undefined && CounterDayattr !== false ) {
1416                    var $CounterDay = '<span>'+CounterDayattr+'</span>';
1417                }
1418                var CounterHoursattr = $(this).parent().find('#hcode-time-counter').attr('data-hours-text');
1419                if( typeof CounterHoursattr !== typeof undefined && CounterHoursattr !== false ) {
1420                    var $CounterHours = '<span>'+CounterHoursattr+'</span>';
1421                }
1422                var CounterMinutesattr = $(this).parent().find('#hcode-time-counter').attr('data-minutes-text');
1423                if( typeof CounterMinutesattr !== typeof undefined && CounterMinutesattr !== false ) {
1424                    var $CounterMinutes = '<span>'+CounterMinutesattr+'</span>';
1425                }
1426                var CounterSecondsattr = $(this).parent().find('#hcode-time-counter').attr('data-seconds-text');
1427                if( typeof CounterSecondsattr !== typeof undefined && CounterSecondsattr !== false ) {
1428                    var $CounterSeconds = '<span>'+CounterSecondsattr+'</span>';
1429                }
1430
1431                
1432                $(this).parent().find('#hcode-time-counter').countdown($counter_date+' 00:00:00').on('update.countdown', function (event) {
1433                    var $this = $(this).parent().find('#hcode-time-counter').html(event.strftime('' + 
1434                        '<div class="counter-container"><div class="counter-box first"><div class="number">%-D</div>'+$CounterDay+'</div>' + 
1435                        '<div class="counter-box"><div class="number">%H</div>'+$CounterHours+'</div>' + 
1436                        '<div class="counter-box"><div class="number">%M</div>'+$CounterMinutes+'</div>' + 
1437                        '<div class="counter-box last"><div class="number">%S</div>'+$CounterSeconds+'</div></div>'))
1438                });
1439            }
1440        });
1441    });
1442    /*==============================================================*/
1443    //Countdown Timer - END CODE
1444    /*==============================================================*/
1445
1446
1447    /*==============================================================*/
1448    //Scroll To Top - START CODE
1449    /*==============================================================*/
1450    $(window).scroll(function () {
1451        if ($(this)
1452                .scrollTop() > 100) {
1453            $('.scrollToTop')
1454                    .fadeIn();
1455        } else {
1456            $('.scrollToTop')
1457                    .fadeOut();
1458        }
1459    });
1460    //Click event to scroll to top
1461    $('.scrollToTop').click(function () {
1462        $('html, body').animate({
1463            scrollTop: 0
1464        }, 1000);
1465        return false;
1466    });
1467    /*==============================================================*/
1468    //Scroll To Top - END CODE
1469    /*==============================================================*/
1470
1471    $('nav ul.panel-group li.dropdown a.dropdown-toggle').click(function () {
1472
1473        if ($(this).parent('li').find('ul.dropdown-menu').length > 0) {
1474            $(this).parents('ul').find('li.dropdown-toggle').not($(this).parent('li')).removeClass('open');
1475            if ($(this).parent('li').hasClass('open')) {
1476                $(this).parent('li').removeClass('open');
1477            }
1478            else {
1479                $(this).parent('li').addClass('open');
1480            }
1481        }
1482    });
1483
1484    $('.hamburger-menu2 a.megamenu-right-icon, .hamburger-menu3 a.megamenu-right-icon').click(function () {
1485
1486        if ($(this).parents('li').find('ul.sub-menu').length > 0) {
1487            
1488            if ($(this).hasClass('open')) {
1489                $(this).removeClass('open');
1490                $(this).next().slideUp();
1491            }
1492            else {
1493                $(this).addClass('open');
1494                $(this).next().slideDown();
1495            }
1496        }
1497        return false;
1498    });
1499
1500    /*==============================================================*/
1501    //To Make Checkbox/Radio Active/Disabled  - START CODE
1502    /*==============================================================*/
1503
1504    $(".carousel .carousel-indicators > li:first-child").addClass("active");
1505    $(".carousel .carousel-inner > div:first-child").addClass("active");
1506
1507    $('span.optionsradios input[value=Disabled]').attr('disabled', 'disabled');
1508    $('span.optionscheckbox input[value=Disabled]').attr('disabled', 'disabled');
1509    /*==============================================================*/
1510    //To Make Checkbox/Radio Active/Disabled - END CODE
1511    /*==============================================================*/
1512
1513
1514    /*==============================================================*/
1515    // NewsLetter Validation - START CODE
1516    /*==============================================================*/
1517
1518    $('.submit_newsletter').click(function () {
1519        var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
1520        var current = $(this);
1521        var address = $(this).closest('form').find('.xyz_em_email').val();
1522        if(reg.test(address) == false) {
1523            //alert('Please check whether the email is correct.');
1524            current.closest('form').find('.xyz_em_email').addClass('newsletter-error');
1525        return false;
1526        }else{
1527        //document.subscription.submit();
1528        return true;
1529        }
1530    });
1531
1532    $('.xyz_em_email').on('focus', function(){
1533      $(this).removeClass('newsletter-error');
1534    });
1535
1536    /*==============================================================*/
1537    // NewsLetter Validation - END CODE
1538    /*==============================================================*/
1539
1540    /*==============================================================*/
1541    // Woocommerce Grid List View - START CODE
1542    /*==============================================================*/
1543    $('.hcode-product-grid-list-wrapper > a').click(function () {
1544        var set_product_view = $(this);
1545        var product_type = set_product_view.parents().find('.products');
1546
1547        if( set_product_view.hasClass('hcode-list-view')){
1548            product_type.addClass('product-list-view');
1549            product_type.removeClass('product-grid-view');
1550        }
1551        if( set_product_view.hasClass('hcode-grid-view') ){
1552            product_type.addClass('product-grid-view');
1553            product_type.removeClass('product-list-view');
1554        }
1555        set_product_view.parent().find('.active').removeClass('active');
1556        set_product_view.addClass('active');
1557
1558    });
1559
1560
1561    /*==============================================================*/
1562    // Woocommerce Grid List View - END CODE
1563    /*==============================================================*/
1564
1565    /*==============================================================*/
1566    // Woocommerce Add Minus Plus Icon In Price Arround - START CODE
1567    /*==============================================================*/
1568    $(document).ready(function () {
1569
1570        // Target quantity inputs on product pages
1571        $('input.qty:not(.product-quantity input.qty)').each(function () {
1572            var min = parseFloat($(this).attr('min'));
1573
1574            if (min && min > 0 && parseFloat($(this).val()) < min) {
1575                $(this).val(min);
1576            }
1577        });
1578
1579        $(document).on('click', '.plus, .minus', function () {
1580
1581            // when on checkout remove product via ajax. click on plus or minus remove disabled on update button. 
1582            $( 'div.woocommerce form input[name="update_cart"]' ).prop( 'disabled', false );
1583
1584            // Get values
1585            var $qty = $(this).closest('.quantity').find('.qty'),
1586              currentVal = parseFloat($qty.val()),
1587              max = parseFloat($qty.attr('max')),
1588              min = parseFloat($qty.attr('min')),
1589              step = $qty.attr('step');
1590
1591            // Format values
1592            if (!currentVal || currentVal === '' || currentVal === 'NaN') currentVal = 0;
1593            if (max === '' || max === 'NaN') max = '';
1594            if (min === '' || min === 'NaN') min = 0;
1595            if (step === 'any' || step === '' || step === undefined || parseFloat(step) === 'NaN') step = 1;
1596
1597            // Change the value
1598            if ($(this).is('.plus')) {
1599
1600                if (max && (max == currentVal || currentVal > max)) {
1601                    $qty.val(max);
1602                } else {
1603                    $qty.val(currentVal + parseFloat(step));
1604                }
1605
1606            } else {
1607
1608                if (min && (min == currentVal || currentVal < min)) {
1609                    $qty.val(min);
1610                } else if (currentVal > 0) {
1611                    $qty.val(currentVal - parseFloat(step));
1612                }
1613
1614            }
1615
1616            // Trigger change event
1617            $qty.trigger('change');
1618        });
1619    });
1620    /*==============================================================*/
1621    // Woocommerce Add Minus Plus Icon In Price Arround - END CODE
1622    /*==============================================================*/
1623
1624    /*==============================================================*/
1625    // Checkout Remove Close Event - START CODE
1626    /*==============================================================*/
1627    $(document).ready(function () {
1628        $(document).on('click', '.checkout-alert-remove', function () {
1629            var remove_parent = $(this).parent().parent();
1630            if( remove_parent.hasClass('alert-remove') ){
1631                remove_parent.remove();
1632            }
1633        });
1634    });
1635    /*==============================================================*/
1636    // Checkout Remove Close Event - END CODE
1637    /*==============================================================*/
1638
1639    /*==============================================================*/
1640    // Post Like Dislike Button JQuery - START CODE
1641    /*==============================================================*/
1642    $(document).ready(function () {
1643        $(document).on('click', '.sl-button', function() {
1644            var button = $(this);
1645            var post_id = button.attr('data-post-id');
1646            var security = button.attr('data-nonce');
1647            var iscomment = button.attr('data-iscomment');
1648            var allbuttons;
1649            if ( iscomment === '1' ) { /* Comments can have same id */
1650                allbuttons = $('.sl-comment-button-'+post_id);
1651            } else {
1652                allbuttons = $('.sl-button-'+post_id);
1653            }
1654            var loader = allbuttons.next('#sl-loader');
1655            if (post_id !== '') {
1656                $.ajax({
1657                    type: 'POST',
1658                    url: simpleLikes.ajaxurl,
1659                    data : {
1660                        action : 'process_simple_like',
1661                        post_id : post_id,
1662                        nonce : security,
1663                        is_comment : iscomment
1664                    },
1665                    beforeSend:function(){
1666                    },  
1667                    success: function(response){
1668                        var icon = response.icon;
1669                        var count = response.count;
1670                        allbuttons.html(icon+count);
1671                        if(response.status === 'unliked') {
1672                            var like_text = simpleLikes.like;
1673                            allbuttons.prop('title', like_text);
1674                            allbuttons.removeClass('liked');
1675                        } else {
1676                            var unlike_text = simpleLikes.unlike;
1677                            allbuttons.prop('title', unlike_text);
1678                            allbuttons.addClass('liked');
1679                        }
1680                        loader.empty();                 
1681                    }
1682                });
1683                
1684            }
1685            return false;
1686        });
1687    });
1688    /*==============================================================*/
1689    // Post Like Dislike Button JQuery - END CODE
1690    /*==============================================================*/
1691
1692
1693    /*==============================================================*/
1694    // Menu Icon Click jQuery - START CODE
1695    /*==============================================================*/
1696
1697    $(document).ready(function () {
1698         $( '.menu-first-level a.dropdown-toggle:first-of-type' ).bind( 'click', function (event) {
1699             var minwidth = $(window).width();
1700             if (minwidth >= 992) {
1701                var geturl = $(this).attr('href');
1702                if((typeof geturl) !== 'undefined' ){
1703                     if (event.ctrlKey || event.metaKey) {
1704                         if (geturl != '#' && geturl != '') {
1705                             window.open(geturl, '_blank');
1706                         }
1707                     } else {
1708                         if (geturl != '#' && geturl != '') {
1709                             if ($(this).attr('target') == '_blank') {
1710                                 window.open(geturl, '_blank');
1711                             } else {
1712                                 window.location.href = geturl;
1713                             }
1714                         }
1715                     }
1716                }
1717             } else {
1718                var geturl = $(this).attr('data-redirect-url');
1719                if((typeof geturl) !== 'undefined' ){
1720                     if (event.ctrlKey || event.metaKey) {
1721                         if (geturl != '#' && geturl != '') {
1722                             window.open(geturl, '_blank');
1723                         }
1724                     } else {
1725                         if (geturl != '#' && geturl != '') {
1726                             if ($(this).attr('target') == '_blank') {
1727                                 window.open(geturl, '_blank');
1728                             } else {
1729                                 window.location.href = geturl;
1730                             }
1731                         }
1732                     }
1733                 }
1734             }
1735         });
1736    });
1737    /*==============================================================*/
1738    // Menu Icon Click jQuery - END CODE
1739    /*==============================================================*/
1740
1741
1742    /*==============================================================*/
1743    // Menu Icon Add jQuery - START CODE
1744    /*==============================================================*/
1745    $(document).ready(function () {
1746        if($("li.menu-item-language").find("ul").first().length != 0){
1747            $("li.menu-item-language a:first").append("<i class='fas fa-angle-down'></i>");
1748        }
1749    });
1750    /*==============================================================*/
1751    // Menu Icon Add jQuery - END CODE
1752    /*==============================================================*/
1753
1754    /*==============================================================*/
1755    // Comment Validation - START CODE
1756    /*==============================================================*/
1757
1758    $(document).ready(function () {
1759      
1760        $(".comment-button").on("click", function () {
1761            var fields;
1762                fields = "";
1763            if($(this).parent().parent().find('#author').length == 1) {
1764                if ($("#author").val().length == 0 || $("#author").val().value == '')
1765                {
1766                    fields ='1';
1767                    $("#author").addClass("inputerror");
1768                }
1769            }
1770            if($(this).parent().parent().find('#comment').length == 1) {
1771                if ($("#comment").val().length == 0 || $("#comment").val().value == '')
1772                {
1773                    fields ='1';
1774                    $("#comment").addClass("inputerror");
1775                }
1776            }
1777            if($(this).parent().parent().find('#email').length == 1) {
1778                if ($("#email").val().length == 0 || $("#email").val().length =='')
1779                {
1780                    fields ='1';
1781                    $("#email").addClass("inputerror");
1782                }
1783                else
1784                    {
1785                        var re = new RegExp();
1786                        re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
1787                        var sinput ;
1788                        sinput= "" ;
1789                        sinput = $("#email").val();
1790                        if (!re.test(sinput))
1791                        {
1792                            fields ='1';
1793                            $("#email").addClass("inputerror");
1794                        }
1795                    }
1796            }
1797            if(fields !="")
1798            {
1799                return false;
1800            }           
1801            else
1802            {
1803                return true;
1804            }
1805        });
1806
1807    });
1808    $(".comment-field").on("focus",function(e){
1809        var id = $(this).attr("id");
1810        if( id ){
1811            $('#'+id).removeClass('inputerror');
1812        }
1813    });
1814    /*==============================================================*/
1815    // Comment Validation - END CODE
1816    /*==============================================================*/
1817
1818    var IpadMobileHover = function () {
1819    	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
1820    	    $('.icon-box > i').on('touchstart', function () {
1821    	        $(this).trigger('hover');
1822    	    }).on('touchend', function () {
1823    	        $(this).trigger('hover');
1824    	    });
1825    	}
1826    };
1827
1828    /*==============================================================*/
1829    // Slider Integrate into Tab - START CODE
1830    /*==============================================================*/
1831
1832    $(document).ready(function () {
1833        $('.nav-tabs a[data-toggle="tab"]').each(function () {
1834            var $this = $(this);
1835            $this.on('shown.bs.tab', function () {
1836                if( $('.masonry-items').length > 0 ) {
1837                    $('.masonry-items').imagesLoaded( function () {
1838                        $('.masonry-items').masonry({
1839                            itemSelector: 'li',
1840                            layoutMode: 'masonry'
1841                        });
1842                    });
1843                }
1844                if( $('.blog-masonry').length > 0 ) {
1845                    $('.blog-masonry').imagesLoaded( function () {
1846                        $('.blog-masonry').masonry({
1847                            itemSelector: 'div.blog-listing',
1848                            layoutMode: 'masonry'
1849                        });
1850                    });
1851                }
1852            });
1853        });
1854    });
1855
1856    /*==============================================================*/
1857    // Slider Integrate into Tab - END CODE
1858    /*==============================================================*/
1859
1860    /*==============================================================*/
1861    // Add extra class into menu - START CODE
1862    /*==============================================================*/
1863
1864    $(document).ready(function () {
1865        hcodeMobileMenuDynamicClass();
1866    });
1867
1868    $(window).resize(function () {
1869        hcodeMobileMenuDynamicClass();
1870    });
1871
1872    function hcodeMobileMenuDynamicClass() {
1873        if (window.matchMedia('(max-width: 991px)').matches) {
1874            $( '.accordion-menu' ).addClass( 'mobile-accordion-menu' );
1875        } else {
1876            $( '.accordion-menu' ).removeClass( 'mobile-accordion-menu' );
1877        }
1878    }
1879
1880    /*==============================================================*/
1881    // Add extra class into menu - END CODE
1882    /*==============================================================*/
1883
1884    /*==============================================================*/
1885    // Portfolio gallery popup - START CODE
1886    /*==============================================================*/
1887
1888    $(document).ready(function(){
1889
1890        $( "figcaption" ).on( "click", ".parent-gallery-popup", function() {
1891            if ( $(this).parents('li').find('.gallery-img').children().length > 0 ) {
1892                $(this).parents('li').find('a.lightboxgalleryitem').first().trigger('click');
1893            }
1894        });
1895
1896        $( "figure" ).on( "click", ".parallax-parent-gallery-popup", function() {
1897            if ( $(this).parents('.parallax-portfolio-gallery-parent').find('a.lightboxgalleryitem').length > 0 ) {
1898                $(this).parents('.parallax-portfolio-gallery-parent').find('a.lightboxgalleryitem').first().trigger('click');
1899            }
1900        });
1901
1902    });
1903
1904    /*==============================================================*/
1905    // Portfolio gallery popup - END CODE
1906    /*==============================================================*/
1907
1908
1909    /*==============================================================*/
1910    // Infinite Scroll jQuery - START CODE
1911    /*==============================================================*/
1912
1913    var pagesNum = $("div.hcode-infinite-scroll").attr('data-pagination');
1914    $(document).ready(function(){
1915        $('.infinite-scroll-pagination').infinitescroll({
1916            nextSelector: 'div.hcode-infinite-scroll a',
1917            loading: {
1918                img: hcodeajaxurl.loading_image,
1919                msgText: '<div class="paging-loader" style="transform:scale(0.35);"><div class="circle"><div></div></div><div class="circle"><div></div></div><div class="circle"><div></div></div><div class="circle"><div></div></div></div>',
1920                finishedMsg: '<div class="finish-load">' + hcode_infinite_scroll_message.message + '</div>',
1921                speed: 'fast',
1922            },
1923            navSelector: 'div.hcode-infinite-scroll',
1924            contentSelector: '.infinite-scroll-pagination',
1925            itemSelector: '.infinite-scroll-pagination div.blog-single-post',
1926            maxPage: pagesNum,
1927        }, function (newElements) {
1928            $('.hcode-infinite-scroll').remove();
1929            $('#infscr-loading').remove();
1930            /* For new element set masonry */
1931            var $newblogpost = $(newElements);
1932            // append other items when they are loaded
1933            $newblogpost.imagesLoaded( function() {
1934            $('.blog-masonry').append( $newblogpost )
1935              .isotope( 'appended', $newblogpost );
1936            });
1937
1938            try {
1939                $(".fit-videos").fitVids();
1940            }catch (err) { }
1941
1942            /* For owl slider */
1943            $(".blog-gallery").owlCarousel({
1944                nav: true, // Show next and prev buttons
1945                autoplaySpeed: 300,
1946                dotsSpeed: 400,
1947                rtl: $("body").hasClass("rtl") ? true:false,
1948                loop: true,
1949                items: 1,
1950                navText: ["<i class='fas fa-angle-left'></i>", "<i class='fas fa-angle-right'></i>"]
1951            });
1952            /* For Magnific Popup */
1953            var lightboxgallerygroups = {};
1954            $('.lightboxgalleryitem').each(function() {
1955              var id = $(this).attr('data-group');
1956              if(!lightboxgallerygroups[id]) {
1957                lightboxgallerygroups[id] = [];
1958              } 
1959              
1960              lightboxgallerygroups[id].push( this );
1961            });
1962
1963
1964            $.each(lightboxgallerygroups, function() {
1965                $(this).magnificPopup({
1966                    type: 'image',
1967                    closeOnContentClick: true,
1968                    closeBtnInside: false,
1969                    gallery: { enabled:true },
1970                    image: {
1971                        titleSrc: function (item) {
1972                            var title = '';
1973                            var lightbox_caption = '';
1974                            if( item.el.attr('title') ){
1975                                title = item.el.attr('title');
1976                            }
1977                            if( item.el.attr('lightbox_caption') ){
1978                                lightbox_caption = '<span class="hcode-lightbox-caption">'+item.el.attr('lightbox_caption')+'</span>';
1979                            }
1980                            return title + lightbox_caption;
1981                        }
1982                    },
1983                    // Remove close on popup bg v1.5
1984                    callbacks: {
1985                        open: function () {
1986                            $.magnificPopup.instance.close = function() {
1987                                if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
1988                                    $.magnificPopup.proto.close.call(this);
1989                                } else {
1990                                    $('button.mfp-close').click(function() {
1991                                        $.magnificPopup.proto.close.call(this);
1992                                    });
1993                                }
1994                            }
1995                        }
1996                    }
1997                });
1998            });
1999        });
2000    });
2001
2002
2003    /*==============================================================*/
2004    // Infinite Scroll jQuery - END CODE
2005    /*==============================================================*/
2006
2007    /*==============================================================
2008        Custom Scroll Bar - START CODE
2009     ==============================================================*/
2010
2011    function HamburderMenuCustomScroll() {
2012
2013        var windowHeight = $(window).height();
2014        $(".hamburger-menu1 .navbar-default").css('height', ( windowHeight / 2 ) );
2015
2016        $(".hamburger-menu1 .navbar-default").mCustomScrollbar({
2017            scrollInertia: 100,
2018            scrollButtons:{
2019                enable:false
2020            },
2021            keyboard:{
2022                enable: true
2023            },
2024            mouseWheel:{
2025                enable:true,
2026                scrollAmount:200
2027            },
2028            callbacks:{
2029                whileScrolling:function(){
2030                },
2031            }
2032        });
2033    }
2034
2035    /*==============================================================
2036        Custom Scroll Bar - END CODE
2037     ==============================================================*/
2038
2039    /*==============================================================
2040        Hamburger Menu 1 Auto Active Menu - START CODE
2041     ==============================================================*/
2042
2043    function OnePageActiveOnScroll(event){
2044
2045        var header_offset = $(".navbar").attr('data-offset');
2046        if ( typeof header_offset !== typeof undefined && header_offset !== false ) {
2047            var general_offset = header_offset;
2048        } else {
2049            var general_offset = 0;
2050        }
2051        var scrollPos = $(document).scrollTop();
2052        scrollPos -= parseInt( general_offset );
2053        scrollPos = ( scrollPos > 0 ) ? scrollPos : 0;
2054        
2055        $('.navigation-menu a.inner-link, .navbar a.inner-link').each(function () {
2056            var currLink = $(this);
2057            var hasPos  = currLink.attr("href").indexOf("#");
2058            if( hasPos > -1 ) {
2059                var res = currLink.attr("href").substring( hasPos );
2060                if( $( res ).length > 0 ) {
2061                    var refElement = $( res );
2062                    var offsetTop = refElement[0].offsetTop;
2063                    var offsetHeight = refElement[0].offsetHeight;
2064                    if (offsetTop <= scrollPos && offsetTop + offsetHeight > scrollPos) {
2065                        $('a.inner-link').removeClass("active");
2066                        currLink.addClass("active");
2067                    }
2068                    else{
2069                        currLink.removeClass("active");
2070                    }
2071                }
2072            }
2073        });
2074    }
2075
2076    /*==============================================================
2077        Hamburger Menu 1 Auto Active Menu - END CODE
2078     ==============================================================*/
2079
2080    /*==============================================================
2081       Bootstrap Slider In VC Front Editor - START CODE
2082    =============================================================*/
2083
2084    $(document).ready(function(){
2085        $( '.vc_editor .carousel' ).each(function() {
2086          $(this).find('.vc_element').addClass('item');
2087          $(this).find('.vc_element:first').addClass('active');
2088          $(this).find('.vc_element > .item').removeClass('item');
2089          $(this).find('.carousel-indicators li:first').addClass('active');
2090        });
2091
2092        /* */
2093        if( $( 'body').hasClass( 'vc_editor' ) ){
2094            $( '.vc_editor .hcode-remove-frontend-editor-position-style1' ).each(function() {
2095                $(this).parents('.vc_vc_column').addClass('remove-position-relative');
2096            });
2097            $( '.vc_editor .hcode-remove-frontend-editor-position-style2' ).each(function() {
2098                $(this).parents('.vc_vc_column').addClass('remove-position-relative-style2');
2099                $(this).parent().addClass('remove-position-relative-style2');
2100            });
2101            $( '.vc_editor section.fill' ).each(function() {
2102                $(this).parent().addClass('remove-position-relative-style2');
2103            });
2104            $( '.front-column-class' ).each(function() {
2105                $(this).removeClass('vc_col-sm-12');
2106            });
2107            
2108        }
2109        $( '.hcode-min-height-0px' ).each(function () {
2110            $(this).removeClass('hcode-min-height-0px');
2111            $(this).parent().addClass('hcode-min-height-0px ');
2112        });
2113
2114        $( '.wpb_column' ).each(function () {
2115
2116            var CurrentColumn = $(this);
2117            var DataVCFrontClass = $(this).attr( 'data-front-class' );
2118            if( DataVCFrontClass && $( 'body').hasClass( 'vc_editor' ) ){
2119                CurrentColumn.parent().addClass( DataVCFrontClass );
2120                CurrentColumn.removeClass( DataVCFrontClass );
2121                CurrentColumn.attr('class', '');
2122                CurrentColumn.addClass('wpb_column');
2123                CurrentColumn.addClass('hcode-column-container');
2124            }
2125            CurrentColumn.removeAttr( 'data-front-class' );
2126
2127            var DataPadding = $(this).attr( 'data-padding' );
2128            var DataMargin = $(this).attr( 'data-margin' );
2129            var DataMinHeight = $(this).attr( 'data-min-height' );
2130            var DataZindex = $(this).attr( 'data-z-index' );
2131            var DataBackground = $(this).attr( 'data-background' );
2132            
2133            if ( typeof DataPadding != "undefined" && DataPadding != '' ) {
2134                if( DataPadding && $( 'body').hasClass( 'vc_editor' ) ){
2135                    if( DataPadding ){
2136                        CurrentColumn.parent().css({ 'padding': DataPadding });
2137                    }
2138                }
2139                CurrentColumn.removeAttr( 'data-padding' );
2140            }
2141
2142            if ( typeof DataMargin != "undefined" && DataMargin != '' ) {
2143                if( DataMargin && $( 'body').hasClass( 'vc_editor' ) ){
2144                    if( DataMargin ){
2145                        CurrentColumn.parent().css({ 'margin': DataMargin });
2146                    }
2147                }
2148                CurrentColumn.removeAttr( 'data-margin' );
2149            }
2150
2151            if ( typeof DataMinHeight != "undefined" && DataMinHeight != '' ) {
2152                if( DataMinHeight && $( 'body').hasClass( 'vc_editor' ) ){
2153                    if( DataMinHeight ){
2154                        CurrentColumn.parent().css({ 'min-height': DataMinHeight });
2155                    }
2156                }
2157                CurrentColumn.removeAttr( 'data-min-height' );
2158            }
2159
2160            if ( typeof DataZindex != "undefined" && DataZindex != '' ) {
2161                if( DataZindex && $( 'body').hasClass( 'vc_editor' ) ){
2162                    if( DataZindex ){
2163                        CurrentColumn.parent().css({ 'z-index': DataZindex });
2164                    }
2165                }
2166                CurrentColumn.removeAttr( 'data-z-index' );
2167            }
2168
2169            if ( typeof DataBackground != "undefined" && DataBackground != '' ) {
2170                if( DataBackground && $( 'body').hasClass( 'vc_editor' ) ){
2171                    if( DataBackground ){
2172                        CurrentColumn.parent().css({ 'background': DataBackground });
2173                    }
2174                }
2175                CurrentColumn.removeAttr( 'data-background' );
2176            }
2177
2178            if( CurrentColumn.attr("style") && $( 'body').hasClass( 'vc_editor' ) ){
2179                CurrentColumn.removeAttr('style');
2180            }
2181        });
2182        
2183        /* For Shop Page slider */
2184        $( '.home-shop' ).parents( 'section.margin-top-81px' ).removeClass( 'margin-top-81px' );
2185    });
2186
2187    /*==============================================================
2188       Bootstrap Slider In VC Front Editor - END CODE
2189    =============================================================*/
2190
2191    /*==============================================================
2192       One Page Main JS - START CODE
2193    =============================================================*/
2194
2195    $(window).load(function () {
2196        init_scroll_navigate();
2197        $(window).trigger("scroll");
2198        $(window).trigger("resize");
2199    });
2200    function init_scroll_navigate() {
2201        var sections = $(".parent-section .row > section");
2202        var menu_links = $(".navbar-nav li a");
2203
2204        $(window).scroll(function () {
2205            setTimeout(function () {
2206                sections.filter(":in-viewport:first").each(function () {
2207                    var active_section = $(this);
2208                    var active_link = $('.navbar-nav li a[href="#' + active_section.attr("id") + '"]');
2209                    menu_links.removeClass("active");
2210                    active_link.addClass("active");
2211
2212                });
2213            }, 500);
2214        });
2215    }
2216
2217    /*==============================================================
2218       One Page Main JS - END CODE
2219    =============================================================*/
2220
2221    /*==============================================================
2222       Portfolio Filter JS - START CODE
2223    =============================================================*/
2224
2225    $( '.portfolio-filter > li > a' ).on( 'click', function (e) {
2226        if( $(window).width() < 768 ) {
2227        e.preventDefault();
2228        $('html,body').animate({
2229            scrollTop: $( this ).parents( 'section' ).find( '.content-section > .tab-content' ).offset().top - $('nav').outerHeight() },
2230        'slow');
2231        }
2232    });
2233
2234    /*==============================================================
2235       Portfolio Filter JS - END CODE
2236    =============================================================*/
2237
2238    /*==============================================================
2239       margin-top for first section. START CODE
2240    =============================================================*/
2241    function onloadmargin(){
2242        var topheight = admin_bar_height = header_height = 0;
2243        if( $('.navbar').hasClass('hcode-nav-margin') ){
2244            var header_height = $('.navbar').outerHeight();
2245        }
2246        if( $( '.top-header-area' ).length > 0 ){
2247            topheight = $('.top-header-area').outerHeight();
2248        }
2249        if( $('#wpadminbar').length > 0 && $('.navbar, .pull-menu-button').length < 1 ){
2250            var admin_bar_height = $('#wpadminbar').outerHeight();
2251        }
2252        if( header_height || topheight ){
2253            var margin_on_first_load = header_height + topheight + admin_bar_height;
2254            $( 'section:first' ).attr('data-nav-default-height', margin_on_first_load);
2255        }
2256    }
2257    $(document).ready(function () {
2258        onloadmargin();
2259        marginNavbar();
2260        marginFirstSection();
2261    });
2262
2263    $(window).resize(function (e) {
2264        setTimeout(function () {
2265            onloadmargin();
2266            marginNavbar();
2267            marginFirstSection();
2268        }, 300);
2269    });
2270
2271    function marginFirstSection() {
2272        var header_height = $('.navbar').outerHeight();
2273        if( $('.top-header-area').length > 0 || $('#wpadminbar').length > 0 ){
2274            var admin_bar_header_height = 0;
2275            var topheight = 0;
2276            if( $(window).width() > 767 ) {
2277                var topheight = $('.top-header-area').outerHeight();
2278            }else{
2279                if( $('header').hasClass('mini-header-mobile') ){
2280                    var topheight = $('.top-header-area').outerHeight();
2281                }
2282            }
2283            
2284            if( $('#wpadminbar').length > 0 && !$('body').hasClass('vc_editor') ){
2285                var admin_bar_height = $('#wpadminbar').outerHeight();
2286                admin_bar_header_height = topheight + admin_bar_height;
2287            }else{
2288                admin_bar_height = 0;
2289                admin_bar_header_height = topheight;
2290            }
2291            
2292            if( $(".navbar" ).length > 0 ){
2293                $(".navbar, .pull-menu-button").css("cssText", "top: " + admin_bar_header_height + "px !important;");
2294            }
2295            if( $(window).width() > 767 ) {
2296                if( $('.navbar' ).hasClass('shrink-nav') ){
2297                    $('.non-sticky-mini-header').css('cssText', 'top: ' + admin_bar_height + 'px !important;');
2298                }else{
2299                    $('.navbar, .pull-menu-button').css('cssText', 'top: ' + admin_bar_header_height + 'px !important;');
2300                }
2301            }else{
2302                if( $('.navbar' ).hasClass('shrink-nav') && $('.top-header-area').length < 1 ){
2303                    $('.navbar').css('cssText', 'top: '+ admin_bar_header_height + 'px !important;');
2304                }else{
2305                    if( $('header').hasClass('mini-header-mobile') ){
2306                        $('.navbar, .pull-menu-button').css('cssText', 'top: ' + admin_bar_header_height + 'px !important;');
2307                    }else{
2308                        var topheight = $('.mini-header-mobile .to
2308p-header-area').outerHeight();
2309                        $('.navbar, .pull-menu-button').css('cssText', 'top: ' + admin_bar_header_height + 'px !important;');
2310                    }
2311                }
2312            }
2313            header_height = header_height + topheight;
2314        }
2315        if( $('.navbar').hasClass('hcode-nav-margin') ){    
2316           header_height = header_height;
2317        }else{
2318            $( '.parent-section' ).addClass('content-top-space');
2319            if( $(window).width() > 767 ) {
2320                header_height = $('.top-header-area').outerHeight();
2321            }else{
2322                if( $('header').hasClass('mini-header-mobile') ){
2323                    header_height = $('.top-header-area').outerHeight();
2324                }else{
2325                    header_height = 0;
2326                }
2327            }
2328        }
2329        var header_height_section = $('section:first').attr('data-nav-default-height');
2330        if( typeof header_height_section !== typeof undefined && header_height_section !== false ) {
2331            $( 'section:first' ).css({ 'margin-top' : header_height_section + 'px'});
2332        }else{
2333            $( 'section:first' ).css({ 'margin-top' : header_height + 'px'});
2334        }
2335    }
2336    function marginNavbar() {
2337        var admin_bar_height = $('#wpadminbar').outerHeight();
2338        var admin_bar_header_height = 0;
2339        var topheight = 0;
2340        if( $('header').hasClass('no-sticky-mini-header') && !$('.navbar' ).hasClass('shrink-nav') ){
2341            if( $(window).width() > 767 ) {
2342                var topheight = $('.top-header-area').outerHeight();
2343            }else{
2344                if( $('header').hasClass('mini-header-mobile') ){
2345                    var topheight = $('.top-header-area').outerHeight();
2346                }
2347            }
2348            if( $('#wpadminbar').length > 0 ){
2349                admin_bar_header_height = topheight + admin_bar_height;
2350            }else{
2351                admin_bar_height = 0;
2352                admin_bar_header_height = topheight;
2353            }
2354        }else{
2355            if( !$('header').hasClass('no-sticky-mini-header') ){
2356                if ( $(window).width() > 767 ) {
2357                    topheight = $('.top-header-area').outerHeight();
2358                }
2359            }
2360            if( $(window).width() < 767 && $('header').hasClass('mini-header-mobile') ){
2361                var topheight = $('.top-header-area').outerHeight();
2362            }
2363            if( $('#wpadminbar').length > 0 && !$('body').hasClass('vc_editor') ){
2364                admin_bar_header_height = admin_bar_height + topheight;
2365            }else{
2366                admin_bar_height = 0;
2367                admin_bar_header_height = topheight;
2368            }
2369        }
2370        $('.navbar').css('cssText', 'top: ' + admin_bar_header_height + 'px !important;');
2371
2372        if( $( '.top-header-area' ).length > 0 ){
2373            $('.top-header-area').css('cssText', 'margin-top: ' + admin_bar_height + 'px !important;');
2374        }
2375
2376        var header_height = $('section:first').attr('data-nav-default-height');
2377        if( typeof header_height !== typeof undefined && header_height !== false ) {
2378            $('section:first').css({ 'margin-top' : header_height + 'px'});
2379        }
2380    }
2381    /*==============================================================
2382       margin-top for first section. END CODE
2383    =============================================================*/
2384
2385})( 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.