PageSourceSearch

https://www.intechboating.com/js/main.js

js intechboating.com collected 2026-10-10 01:55:14 UTC 90,948 bytes, 2,574 lines download raw bytes

1"use strict";
2var lastScroll = 0;
3
4//check for browser os
5var isMobile = false;
6var isiPhoneiPad = false;
7if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
8    isMobile = true;
9}
10
11if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
12    isiPhoneiPad = true;
13}
14
15function SetMegamenuPosition() {
16    if ($(window).width() > 991) {
17        setTimeout(function () {
18            var totalHeight = $('nav.navbar').outerHeight();
19            $('.mega-menu').css({top: totalHeight});
20            if ($('.navbar-brand-top').length === 0)
21                $('.dropdown.simple-dropdown > .dropdown-menu').css({top: totalHeight});
22        }, 200);
23    } else {
24        $('.mega-menu').css('top', '');
25        $('.dropdown.simple-dropdown > .dropdown-menu').css('top', '');
26    }
27}
28
29function pad(d) {
30    return (d < 10) ? '0' + d.toString() : d.toString();
31}
32
33function isIE() {
34    var ua = window.navigator.userAgent;
35    var msie = ua.indexOf("MSIE ");
36    if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))  // If Internet Explorer, return version number
37    {
38        return true;
39    } else  // If another browser, return 0
40    {
41        return false;
42    }
43}
44
45//page title space
46function setPageTitleSpace() {
47    if ($('.navbar').hasClass('navbar-top') || $('nav').hasClass('navbar-fixed-top')) {
48        if ($('.top-space').length > 0) {
49            var top_space_height = $('.navbar').outerHeight();
50            if ($('.top-header-area').length > 0) {
51                top_space_height = top_space_height + $('.top-header-area').outerHeight();
52            }
53            $('.top-space').css('margin-top', top_space_height + "px");
54        }
55    }
56}
57
58//swiper button position in auto height slider
59function setButtonPosition() {
60    if ($(window).width() > 767 && $(".swiper-auto-height-container").length > 0) {
61        var leftPosition = parseInt($('.swiper-auto-height-container .swiper-slide').css('padding-left'));
62        var bottomPosition = parseInt($('.swiper-auto-height-container .swiper-slide').css('padding-bottom'));
63        var bannerWidth = parseInt($('.swiper-auto-height-container .slide-banner').outerWidth());
64        $('.navigation-area').css({'left': bannerWidth + leftPosition + 'px', 'bottom': bottomPosition + 'px'});
65    } else if ($(".swiper-auto-height-container").length > 0) {
66        $('.navigation-area').css({'left': '', 'bottom': ''});
67    }
68}
69
70$(window).on("scroll", init_scroll_navigate);
71function init_scroll_navigate() {
72    
73    /*==============================================================
74     One Page Main JS - START CODE
75     =============================================================*/
76    var menu_links = $(".navbar-nav li a");
77    var scrollPos = $(document).scrollTop();
78    scrollPos = scrollPos + 60;
79    menu_links.each(function () {
80        var currLink = $(this);
81        var hasPos = currLink.attr("href").indexOf("#");
82        if (hasPos > -1) {
83            var res = currLink.attr("href").substring(hasPos);
84            if ($(res).length > 0) {
85                var refElement = $(res);
86                if (refElement.offset().top <= scrollPos && refElement.offset().top + refElement.height() > scrollPos) {
87                    menu_links.not(currLink).removeClass("active");
88                    currLink.addClass("active");
89                } else {
90                    currLink.removeClass("active");
91                }
92            }
93        }
94    });
95
96    /*==============================================================*/
97    //background color slider Start
98    /*==============================================================*/
99    var $window = $(window),
100            $body = $('.bg-background-fade'),
101            $panel = $('.color-code');
102    var scroll = $window.scrollTop() + ($window.height() / 2);
103    $panel.each(function () {
104        var $this = $(this);
105        if ($this.position().top <= scroll && $this.position().top + $this.height() > scroll) {
106            $body.removeClass(function (index, css) {
107                return (css.match(/(^|\s)color-\S+/g) || []).join(' ');
108            });
109            $body.addClass('color-' + $(this).data('color'));
110        }
111    });
112
113    /* ===================================
114     sticky nav Start
115     ====================================== */
116    var headerHeight = $('nav').outerHeight();
117    if (!$('header').hasClass('no-sticky')) {
118        if ($(document).scrollTop() >= headerHeight) {
119            $('header').addClass('sticky');
120
121        } else if ($(document).scrollTop() <= headerHeight) {
122            $('header').removeClass('sticky');
123            setTimeout(function () {
124                setPageTitleSpace();
125            }, 500);
126        }
127        SetMegamenuPosition();
128    }
129
130    /* ===================================
131     header appear on scroll up
132     ====================================== */
133    var st = $(this).scrollTop();
134    if (st > lastScroll) {
135        $('.sticky').removeClass('header-appear');
136    //  $('.dropdown.on').removeClass('on').removeClass('open').find('.dropdown-menu').fadeOut(100);
137    } else
138        $('.sticky').addClass('header-appear');
139    lastScroll = st;
140    if (lastScroll <= headerHeight)
141        $('header').removeClass('header-appear');
142}
143
144/*==============================================================
145 parallax text - START CODE
146 ==============================================================*/
147function parallax_text() {
148    var window_width = $(window).width();
149    if (window_width > 1024) {
150        if ($('.swiper-auto-slide .swiper-slide').length !== 0) {
151            $(document).on("mousemove", ".swiper-auto-slide .swiper-slide", function (e) {
152                var positionX = e.clientX;
153                var positionY = e.clientY;
154                positionX = Math.round(positionX / 10) - 80;
155                positionY = Math.round(positionY / 10) - 40;
156                $(this).find('.parallax-text').css({'transform': 'translate(' + positionX + 'px,' + positionY + 'px)', 'transition-duration': '0s'});
157            });
158
159            $(document).on("mouseout", ".swiper-auto-slide .swiper-slide", function (e) {
160                $('.parallax-text').css({'transform': 'translate(0,0)', 'transition-duration': '0.5s'});
161            });
162        }
163    }
164}
165
166/*==============================================================*/
167//Search - START CODE
168/*==============================================================*/
169function ScrollStop() {
170    return false;
171}
172function ScrollStart() {
173    return true;
174}
175function validationSearchForm() {
176    var error = true;
177    $('#search-header input[type=text]').each(function (index) {
178        if (index === 0) {
179            if ($(this).val() === null || $(this).val() === "") {
180                $("#search-header").find("input:eq(" + index + ")").css({"border": "none", "border-bottom": "2px solid red"});
181                error = false;
182            } else {
183                $("#search-header").find("input:eq(" + index + ")").css({"border": "none", "border-bottom": "2px solid #000"});
184            }
185        }
186    });
187    return error;
188}
189
190/*==============================================================
191 //Parallax - START CODE
192 ==============================================================*/
193function stellarParallax() {
194    if ($(window).width() > 1024) {
195        $.stellar();
196    } else {
197        $.stellar('destroy');
198        $('.parallax').css('background-position', '');
199    }
200}
201
202
203/*==============================================================
204 full screen START CODE
205 ==============================================================*/
206function fullScreenHeight() {
207    var element = $(".full-screen");
208    var $minheight = $(window).height();
209    element.parents('section').imagesLoaded(function () {
210        if ($(".top-space .full-screen").length > 0) {
211            var $headerheight = $("header nav.navbar").outerHeight();
212            $(".top-space .full-screen").css('min-height', $minheight - $headerheight);
213        } else {
214            element.css('min-height', $minheight);
215        }
216    });
217
218    var minwidth = $(window).width();
219    $(".full-screen-width").css('min-width', minwidth);
220
221    var sidebarNavHeight = $('.sidebar-nav-style-1').height() - $('.logo-holder').parent().height() - $('.footer-holder').parent().height() - 10;
222    $(".sidebar-nav-style-1 .nav").css('height', (sidebarNavHeight));
223    var style2NavHeight = parseInt($('.sidebar-part2').height() - parseInt($('.sidebar-part2 .sidebar-middle').css('padding-top')) - parseInt($('.sidebar-part2 .sidebar-middle').css('padding-bottom')) - parseInt($(".sidebar-part2 .sidebar-middle .sidebar-middle-menu .nav").css('margin-bottom')));
224    $(".sidebar-part2 .sidebar-middle .sidebar-middle-menu .nav").css('height', (style2NavHeight));
225
226
227}
228
229function SetResizeContent() {
230    //    all function call
231    SetMegamenuPosition();
232    setPageTitleSpace();
233    setButtonPosition();
234    parallax_text();
235    stellarParallax();
236    fullScreenHeight();
237//    navClick();
238}
239
240/* ===================================
241 START RESIZE
242 ====================================== */
243$(window).resize(function (event) {
244    setTimeout(function () {
245        SetResizeContent();
246    }, 500);
247    $('.menu-back-div').each(function(){$(this).attr('style', '');});
248    $('.navbar-collapse').collapse('hide');
249    
250    event.preventDefault();
251});
252
253/* ===================================
254 START READY
255 ====================================== */
256$(document).ready(function () {
257    "use strict";
258
259    // Active class to current menu for only html
260    var pgurl = window.location.href.substr(window.location.href.lastIndexOf("/") + 1);
261    var $hash = window.location.hash.substring(1);
262
263    if ($hash) {
264        $hash = "#" + $hash;
265        pgurl = pgurl.replace($hash, "");
266    } else {
267        pgurl = pgurl.replace("#", "");
268    }
269
270    $(".nav li a").each(function () {
271        if ($(this).attr("href") == pgurl || $(this).attr("href") == pgurl + '.html') {
272            $(this).parent().addClass("active");
273            $(this).parents('li.dropdown').addClass("active");
274        }
275    });
276    $(window).scroll(function () {
277        if ($(this).scrollTop() > 150)
278            $('.scroll-top-arrow').fadeIn('slow');
279        else
280            $('.scroll-top-arrow').fadeOut('slow');
281    });
282    //Click event to scroll to top
283    $(document).on('click', '.scroll-top-arrow', function () {
284        $('html, body').animate({scrollTop: 0}, 800);
285        return false;
286    });
287
288    /* ===================================
289     swiper slider
290     ====================================== */
291    var swiperFull = new Swiper('.swiper-full-screen', {
292        loop: true,
293        slidesPerView: 1,
294        preventClicks: false,
295        allowTouchMove: true,
296        pagination: {
297            el: '.swiper-full-screen-pagination',
298            clickable: true
299        },
300        autoplay: {
301            delay: 5000
302        },
303        keyboard: {
304            enabled: true
305        },
306        navigation: {
307            nextEl: '.swiper-button-next',
308            prevEl: '.swiper-button-prev'
309        },
310        on: {
311            resize: function () {
312                swiperFull.update();
313            }
314        }
315    });
316
317    var swiperAutoFade = new Swiper('.swiper-auto-fade', {
318        allowTouchMove: true,
319        loop: true,
320        slidesPerView: 1,
321        preventClicks: false,
322        effect: 'fade',
323        autoplay: {
324            delay: 5000
325        },
326        keyboard: {
327            enabled: true
328        },
329        navigation: {
330            nextEl: '.swiper-button-next',
331            prevEl: '.swiper-button-prev'
332        },
333        pagination: {
334            el: '.swiper-auto-pagination',
335            clickable: true
336        },
337        on: {
338            resize: function () {
339                swiperAutoFade.update();
340            }
341        }
342    });
343
344    var swiperSecond = new Swiper('.swiper-slider-second', {
345        allowTouchMove: true,
346        slidesPerView: 1,
347        preventClicks: false,
348        keyboard: {
349            enabled: true
350        },
351        navigation: {
352            nextEl: '.swiper-button-next',
353            prevEl: '.swiper-button-prev'
354        },
355        pagination: {
356            el: '.swiper-pagination-second',
357            clickable: true
358        },
359        on: {
360            resize: function () {
361                swiperSecond.update();
362            }
363        }
364    });
365
366    var swiperThird = new Swiper('.swiper-slider-third', {
367        allowTouchMove: true,
368        slidesPerView: 1,
369        preventClicks: false,
370        keyboard: {
371            enabled: true
372        },
373        navigation: {
374            nextEl: '.swiper-button-next',
375            prevEl: '.swiper-button-prev'
376        },
377        pagination: {
378            el: '.swiper-pagination-third',
379            clickable: true
380        },
381        on: {
382            resize: function () {
383                swiperThird.update();
384            }
385        }
386    });
387
388     /*==============================================================
389     navegacao datas linha do tempo
390     ==============================================================*/
391
392    $(document).on('click', '.linha_do_tempo .linha-datas a', function () {
393        //e.preventDefault();
394        $('.linha_do_tempo .linha-datas a').removeClass('ativo');
395        $(this).addClass('ativo');
396        var nuSlide = $(this).index();
397        swiperThird.slideTo(nuSlide, 300);
398    });
399
400
401
402    var swiperNumber = new Swiper('.swiper-number-pagination', {
403        allowTouchMove: true,
404        preventClicks: false,
405        autoplay: {
406            delay: 4000,
407            disableOnInteraction: true
408        },
409        pagination: {
410            el: '.swiper-number',
411            clickable: true,
412            renderBullet: function (index, className) {
413                return '<span class="' + className + '">' + pad((index + 1)) + '</span>';
414            }
415        },
416        on: {
417            resize: function () {
418                swiperNumber.update();
419            }
420        }
421    });
422
423    var swiperVerticalPagination = new Swiper('.swiper-vertical-pagination', {
424        allowTouchMove: true,
425        direction: 'vertical',
426        slidesPerView: 1,
427        spaceBetween: 0,
428        preventClicks: false,
429        mousewheel: {
430            mousewheel: true,
431            sensitivity: 1,
432            releaseOnEdges: true
433        },
434        navigation: {
435            nextEl: '.swiper-button-next',
436            prevEl: '.swiper-button-prev'
437        },
438        pagination: {
439            el: '.swiper-pagination-vertical',
440            clickable: true
441        },
442        on: {
443            resize: function () {
444                swiperVerticalPagination.update();
445            }
446        }
447    });
448
449    var swiperClients = new Swiper('.swiper-slider-clients', {
450        allowTouchMove: true,
451        slidesPerView: 4,
452        paginationClickable: true,
453        preventClicks: true,
454        autoplay: {
455            delay: 3000,
456            disableOnInteraction: true
457        },
458        pagination: {
459            el: null
460        },
461        breakpoints: {
462            1199: {
463                slidesPerView: 3
464            },
465            991: {
466                slidesPerView: 2
467            },
468            767: {
469                slidesPerView: 1
470            }
471        },
472        on: {
473            resize: function () {
474                swiperClients.update();
475            }
476        }
477    });
478
479    var swiperClients2 = new Swiper('.swiper-slider-clients-second', {
480        allowTouchMove: true,
481        slidesPerView: 4,
482        paginationClickable: true,
483        preventClicks: true,
484        autoplay: {
485            delay: 3000,
486            disableOnInteraction: true
487        },
488        pagination: {
489            el: null
490        },
491        breakpoints: {
492            1199: {
493                slidesPerView: 3
494            },
495            991: {
496                slidesPerView: 2
497            },
498            767: {
499                slidesPerView: 1
500            }
501        },
502        on: {
503            resize: function () {
504                swiperClients2.update();
505            }
506        }
507    });
508
509    var swiperThreeSlides = new Swiper('.swiper-three-slides', {
510        allowTouchMove: true,
511        slidesPerView: 3,
512        preventClicks: false,
513        pagination: {
514            el: '.swiper-pagination-three-slides',
515            clickable: true
516        },
517        autoplay: {
518            delay: 3000
519        },
520        keyboard: {
521            enabled: true
522        },
523        navigation: {
524            nextEl: '.swiper-three-slide-next',
525            prevEl: '.swiper-three-slide-prev'
526        },
527        breakpoints: {
528            991: {
529                slidesPerView: 2
530            },
531            767: {
532                slidesPerView: 1
533            }
534        },
535        on: {
536            resize: function () {
537                swiperThreeSlides.update();
538            }
539        }
540    });
541
542    var swiperFourSlides = new Swiper('.swiper-four-slides', {
543        allowTouchMove: true,
544        slidesPerView: 4,
545        preventClicks: false,
546        pagination: {
547            el: '.swiper-pagination-four-slides',
548            clickable: true
549        },
550        autoplay: {
551            delay: 3000
552        },
553        keyboard: {
554            enabled: true
555        },
556        navigation: {
557            nextEl: '.swiper-button-next',
558            prevEl: '.swiper-button-prev'
559        },
560        breakpoints: {
561            1199: {
562                slidesPerView: 3
563            },
564            991: {
565                slidesPerView: 2
566            },
567            767: {
568                slidesPerView: 1
569            }
570        },
571        on: {
572            resize: function () {
573                swiperFourSlides.update();
574            }
575        }
576    });
577
578    var swiperDemoHeaderStyle = new Swiper('.swiper-demo-header-style', {
579        allowTouchMove: true,
580        loop: true,
581        slidesPerView: 4,
582        preventClicks: true,
583        slidesPerGroup: 4,
584        pagination: {
585            el: '.swiper-pagination-demo-header-style',
586            clickable: true
587        },
588        autoplay: {
589            delay: 3000
590        },
591        keyboard: {
592            enabled: true
593        },
594        navigation: {
595            nextEl: '.swiper-button-next',
596            prevEl: '.swiper-button-prev'
597        },
598        breakpoints: {
599            1199: {
600                slidesPerGroup: 2,
601                slidesPerView: 2
602            },
603            767: {
604                slidesPerGroup: 1,
605                slidesPerView: 1
606            }
607        },
608        on: {
609            resize: function () {
610                swiperDemoHeaderStyle.update();
611            }
612        }
613    });
614
615    var $swiperAutoSlideIndex = 0;
616    var swiperAutoSlide = new Swiper('.swiper-auto-slide', {
617        allowTouchMove: true,
618        slidesPerView: 'auto',
619        centeredSlides: true,
620        spaceBetween: 80,
621        preventClicks: false,
622        observer: true,
623        speed: 1000,
624        pagination: {
625            el: null
626        },
627        scrollbar: {
628            el: '.swiper-scrollbar',
629            draggable: true,
630            hide: false,
631            snapOnRelease: true
632        },
633        autoplay: {
634            delay: 3000
635        },
636        mousewheel: {
637            invert: false
638        },
639        keyboard: {
640            enabled: true
641        },
642        navigation: {
643            nextEl: '.swiper-next-style2',
644            prevEl: '.swiper-prev-style2'
645        },
646        breakpoints: {
647            1199: {
648                spaceBetween: 60
649            },
650            960: {
651                spaceBetween: 30
652            },
653            767: {
654                spaceBetween: 15
655            }
656        },
657        on: {
658            resize: function () {
659                swiperAutoSlide.update();
660            }
661        }
662    });
663
664    if ($(window).width() > 767) {
665        var swiperBottomScrollbarFull = new Swiper('.swiper-bottom-scrollbar-full', {
666            allowTouchMove: true,
667            slidesPerView: 'auto',
668            grabCursor: true,
669            preventClicks: false,
670            spaceBetween: 30,
671            keyboardControl: true,
672            speed: 1000,
673            pagination: {
674                el: null
675            },
676            scrollbar: {
677                el: '.swiper-scrollbar',
678                draggable: true,
679                hide: false,
680                snapOnRelease: true
681            },
682            mousewheel: {
683                enable: true
684            },
685            keyboard: {
686                enabled: true
687            },
688            navigation: {
689                nextEl: '.swiper-button-next',
690                prevEl: '.swiper-button-prev'
691            }
692        });
693    }
694
695    var swiperAutoHieght = new Swiper('.swiper-auto-height-container', {
696        allowTouchMove: true,
697        effect: 'fade',
698        loop: true,
699        autoHeight: true,
700        pagination: {
701            el: '.swiper-auto-height-pagination',
702            clickable: true
703        },
704        autoplay: {
705            delay: 3000
706        },
707        navigation: {
708            nextEl: '.swiper-button-next',
709            prevEl: '.swiper-button-prev'
710        },
711        on: {
712            resize: function () {
713                swiperAutoHieght.update();
714            }
715        }
716    });
717
718    var swiperMultyRow = new Swiper('.swiper-multy-row-container', {
719        allowTouchMove: true,
720        slidesPerView: 4,
721        spaceBetween: 15,
722        pagination: {
723            el: '.swiper-multy-row-pagination',
724            clickable: true
725        },
726        autoplay: {
727            delay: 3000,
728            disableOnInteraction: true
729        },
730        navigation: {
731            nextEl: '.swiper-portfolio-next',
732            prevEl: '.swiper-portfolio-prev'
733        },
734        breakpoints: {
735            991: {
736                slidesPerView: 2
737            },
738            767: {
739                slidesPerView: 1
740            }
741        },
742        on: {
743            resize: function () {
744                swiperMultyRow.update();
745            }
746        }
747    });
748
749    var swiperBlog = new Swiper('.swiper-blog', {
750        allowTouchMove: true,
751        slidesPerView: "auto",
752        centeredSlides: true,
753        spaceBetween: 15,
754        preventClicks: false,
755        loop: true,
756        loopedSlides: 3,
757        pagination: {
758            el: '.swiper-blog-pagination',
759            clickable: true
760        },
761        autoplay: {
762            delay: 5000,
763            disableOnInteraction: true
764        },
765        navigation: {
766            nextEl: '.swiper-button-next',
767            prevEl: '.swiper-button-prev'
768        },
769        on: {
770            resize: function () {
771                swiperBlog.update();
772            }
773        }
774    });
775
776    var swiperPresentation = new Swiper('.swiper-presentation', {
777        allowTouchMove: true,
778        slidesPerView: 4,
779        centeredSlides: true,
780        spaceBetween: 30,
781        preventClicks: true,
782        loop: true,
783        loopedSlides: 6,
784        pagination: {
785            el: '.swiper-presentation-pagination',
786            clickable: true
787        },
788        autoplay: {
789            delay: 3000,
790            disableOnInteraction: true
791        },
792        keyboard: {
793            enabled: true
794        },
795        navigation: {
796            nextEl: '.swiper-button-next',
797            prevEl: '.swiper-button-prev'
798        },
799        breakpoints: {
800            991: {
801                spaceBetween: 15,
802                slidesPerView: 2
803            },
804            767: {
805                slidesPerView: 1
806            }
807        },
808        on: {
809            resize: function () {
810                swiperPresentation.update();
811            }
812        }
813    });
814
815    var resizeId;
816
817    $(window).resize(function () {
818        if ($(".swiper-auto-slide").length > 0 && swiperAutoSlide) {
819            $swiperAutoSlideIndex = swiperAutoSlide.activeIndex;
820            swiperAutoSlide.detachEvents();
821            swiperAutoSlide.destroy(true, false);
822            swiperAutoSlide = undefined;
823            $(".swiper-auto-slide .swiper-wrapper").css("transform", "").css("transition-duration", "");
824            $(".swiper-auto-slide .swiper-slide").css("margin-right", "");
825
826            setTimeout(function () {
827                swiperAutoSlide = new Swiper('.swiper-auto-slide', {
828                    allowTouchMove: true,
829                    slidesPerView: 'auto',
830                    centeredSlides: true,
831                    spaceBetween: 80,
832                    preventClicks: false,
833                    mousewheelControl: true,
834                    observer: true,
835                    speed: 1000,
836                    pagination: {
837                        el: null
838                    },
839                    scrollbar: {
840                        el: '.swiper-scrollbar',
841                        draggable: true,
842                        hide: false,
843                        snapOnRelease: true
844                    },
845                    autoplay: {
846                        delay: 3000
847                    },
848                    keyboard: {
849                        enabled: true
850                    },
851                    navigation: {
852                        nextEl: '.swiper-next-style2',
853                        prevEl: '.swiper-prev-style2'
854                    },
855                    breakpoints: {
856                        1199: {
857                            spaceBetween: 60
858                        },
859                        960: {
860                            spaceBetween: 30
861                        },
862                        767: {
863                            spaceBetween: 15
864                        }
865                    },
866                    on: {
867                        resize: function () {
868                            swiperAutoSlide.update();
869                        }
870                    }
871                });
872
873                swiperAutoSlide.slideTo($swiperAutoSlideIndex, 1000, false);
874            }, 1000);
875        }
876
877        if ($(".swiper-bottom-scrollbar-full").length > 0) {
878            clearTimeout(resizeId);
879            resizeId = setTimeout(doneResizing, 1000);
880        }
881
882        /* update all swiper on window resize */
883
884        setTimeout(function () {
885            if ($('.swiper-full-screen').length > 0 && swiperFull)
886            {
887                swiperFull.update();
888            }
889
890            if ($('.swiper-auto-fade').length > 0 && swiperAutoFade)
891            {
892                swiperAutoFade.update();
893            }
894
895            if ($('.swiper-slider-second').length > 0 && swiperSecond)
896            {
897                swiperSecond.update();
898            }
899
900            if ($('.swiper-slider-third').length > 0 && swiperThird)
901            {
902                swiperThird.update();
903            }
904
905            if ($('.swiper-number-pagination').length > 0 && swiperNumber)
906            {
907                swiperNumber.update();
908            }
909
910            if ($('.swiper-vertical-pagination').length > 0 && swiperVerticalPagination)
911            {
912                swiperVerticalPagination.update();
913            }
914
915            if ($('.swiper-slider-clients').length > 0 && swiperClients)
916            {
917                swiperClients.update();
918            }
919
920            if ($('.swiper-slider-clients-second').length > 0 && swiperClients2)
921            {
922                swiperClients2.update();
923            }
924
925            if ($('.swiper-three-slides').length > 0 && swiperThreeSlides)
926            {
927                swiperThreeSlides.update();
928            }
929
930            if ($('.swiper-four-slides').length > 0 && swiperFourSlides)
931            {
932                swiperFourSlides.update();
933            }
934
935            if ($('.swiper-demo-header-style').length > 0 && swiperDemoHeaderStyle)
936            {
937                swiperDemoHeaderStyle.update();
938            }
939
940            if ($('.swiper-auto-slide').length > 0 && swiperAutoSlide)
941            {
942                swiperAutoSlide.update();
943            }
944
945            if ($('.swiper-auto-height-container').length > 0 && swiperAutoHieght)
946            {
947                swiperAutoHieght.update();
948            }
949
950            if ($('.swiper-multy-row-container').length > 0 && swiperMultyRow)
951            {
952                swiperMultyRow.update();
953            }
954
955            if ($('.swiper-blog').length > 0 && swiperBlog)
956            {
957                swiperBlog.update();
958            }
959
960            if ($('.swiper-presentation').length > 0 && swiperPresentation)
961            {
962                swiperPresentation.update();
963            }
964
965        }, 500);
966        if (isIE()) {
967            setTimeout(function () {
968                if ($('.swiper-full-screen').length > 0 && swiperFull)
969                {
970                    swiperFull.update();
971                }
972
973                if ($('.swiper-auto-fade').length > 0 && swiperAutoFade)
974                {
975                    swiperAutoFade.update();
976                }
977
978                if ($('.swiper-slider-second').length > 0 && swiperSecond)
979                {
980                    swiperSecond.update();
981                }
982
983                if ($('.swiper-slider-third').length > 0 && swiperThird)
984                {
985                    swiperThird.update();
986                }
987
988                if ($('.swiper-number-pagination').length > 0 && swiperNumber)
989                {
990                    swiperNumber.update();
991                }
992
993                if ($('.swiper-vertical-pagination').length > 0 && swiperVerticalPagination)
994                {
995                    swiperVerticalPagination.update();
996                }
997
998                if ($('.swiper-slider-clients').length > 0 && swiperClients)
999                {
1000                    swiperClients.update();
1001                }
1002
1003                if ($('.swiper-slider-clients-second').length > 0 && swiperClients2)
1004                {
1005                    swiperClients2.update();
1006                }
1007
1008                if ($('.swiper-three-slides').length > 0 && swiperThreeSlides)
1009                {
1010                    swiperThreeSlides.update();
1011                }
1012
1013                if ($('.swiper-four-slides').length > 0 && swiperFourSlides)
1014                {
1015                    swiperFourSlides.update();
1016                }
1017
1018                if ($('.swiper-demo-header-style').length > 0 && swiperDemoHeaderStyle)
1019                {
1020                    swiperDemoHeaderStyle.update();
1021                }
1022
1023                if ($('.swiper-auto-slide').length > 0 && swiperAutoSlide)
1024                {
1025                    swiperAutoSlide.update();
1026                }
1027
1028                if ($('.swiper-auto-height-container').length > 0 && swiperAutoHieght)
1029                {
1030                    swiperAutoHieght.update();
1031                }
1032
1033                if ($('.swiper-multy-row-container').length > 0 && swiperMultyRow)
1034                {
1035                    swiperMultyRow.update();
1036                }
1037
1038                if ($('.swiper-blog').length > 0 && swiperBlog)
1039                {
1040                    swiperBlog.update();
1041                }
1042
1043                if ($('.swiper-presentation').length > 0 && swiperPresentation)
1044                {
1045                    swiperPresentation.update();
1046                }
1047
1048            }, 500);
1049        }
1050
1051    });
1052
1053    function doneResizing() {
1054        if (swiperBottomScrollbarFull) {
1055            swiperBottomScrollbarFull.detachEvents();
1056            swiperBottomScrollbarFull.destroy(true, true);
1057            swiperBottomScrollbarFull = undefined;
1058        }
1059
1060        $(".swiper-bottom-scrollbar-full .swiper-wrapper").css("transform", "").css("transition-duration", "");
1061        $(".swiper-bottom-scrollbar-full .swiper-slide").css("margin-right", "");
1062        $('.swiper-bottom-scrollbar-full .swiper-wrapper').removeAttr('style');
1063        $('.swiper-bottom-scrollbar-full .swiper-slide').removeAttr('style');
1064
1065        if ($(window).width() > 767) {
1066            setTimeout(function () {
1067                swiperBottomScrollbarFull = new Swiper('.swiper-bottom-scrollbar-full', {
1068                    allowTouchMove: true,
1069                    slidesPerView: 'auto',
1070                    grabCursor: true,
1071                    preventClicks: false,
1072                    spaceBetween: 30,
1073                    keyboardControl: true,
1074                    speed: 1000,
1075                    pagination: {
1076                        el: null
1077                    },
1078                    scrollbar: {
1079                        el: '.swiper-scrollbar',
1080                        draggable: true,
1081                        hide: false,
1082                        snapOnRelease: true
1083                    },
1084                    mousewheel: {
1085                        enable: true
1086                    },
1087                    keyboard: {
1088                        enabled: true
1089                    },
1090                    navigation: {
1091                        nextEl: '.swiper-button-next',
1092                        prevEl: '.swiper-button-prev'
1093                    }
1094                });
1095            }, 500);
1096        }
1097    }
1098
1099   
1100
1101
1102
1103    /*==============================================================
1104     smooth scroll
1105     ==============================================================*/
1106
1107    var scrollAnimationTime = 1200, scrollAnimation = 'easeInOutExpo';
1108    $(document).on('click.smoothscroll', 'a.scrollto', function (event) {
1109        event.preventDefault();
1110        var target = this.hash;
1111        if ($(target).length != 0) {
1112            $('html, body').stop()
1113                    .animate({
1114                        'scrollTop': $(target)
1115                                .offset()
1116                                .top
1117                    }, scrollAnimationTime, scrollAnimation, function () {
1118                        window.location.hash = target;
1119                    });
1120        }
1121    });
1122
1123    /*==============================================================
1124     humburger menu one page navigation
1125     ==============================================================*/
1126
1127    if ($('.full-width-pull-menu').length > 0) {
1128        $(document).on('click', '.full-width-pull-menu .inner-link', function (e) {
1129            //$('body').removeClass('overflow-hidden position-fixed');
1130            $(".full-width-pull-menu .close-button-menu").trigger("click");
1131            var _this = $(this);
1132            setTimeout(function () {
1133                var target = _this.attr("href");
1134                if ($(target).length > 0) {
1135                    $('html, body').stop()
1136                            .animate({
1137                                'scrollTop': $(target).offset().top
1138                            });
1139                }
1140            }, 500);
1141        });
1142    }
1143
1144    // Inner links
1145    if ($('.navbar-top').length > 0 || $('.navbar-scroll-top').length > 0 || $('.navbar-top-scroll').length > 0) {
1146        $('.inner-link').smoothScroll({
1147            speed: 900,
1148            offset: 0
1149        });
1150    } else {
1151        $('.inner-link').smoothScroll({
1152            speed: 900,
1153            offset: -59
1154        });
1155    }
1156
1157    $('.section-link').smoothScroll({
1158        speed: 900,
1159        offset: 1
1160    });
1161
1162    /*==============================================================*/
1163    //PieChart For Onepage - START CODE
1164    /*==============================================================*/
1165    if ($('.chart1').length > 0) {
1166        $('.chart1').appear();
1167        $('.chart1').easyPieChart({
1168            barColor: '#929292',
1169            trackColor: '#d9d9d9',
1170            scaleColor: false,
1171            easing: 'easeOutBounce',
1172            scaleLength: 1,
1173            lineCap: 'round',
1174            lineWidth: 3, //12
1175            size: 150, //110
1176            animate: {
1177                duration: 2000,
1178                enabled: true
1179            },
1180            onStep: function (from, to, percent) {
1181                $(this.el).find('.percent').text(Math.round(percent));
1182            }
1183        });
1184        $(document.body).on('appear', '.chart1', function (e) {
1185            // this code is executed for each appeared element
1186            if (!$(this).hasClass('appear')) {
1187                $(this).addClass('appear');
1188                $(this).data('easyPieChart').update(0).update($(this).data('percent'));
1189            }
1190        });
1191    }
1192
1193    if ($('.chart2').length > 0) {
1194        $('.chart2').appear();
1195        $('.chart2').easyPieChart({
1196            easing: 'easeOutCirc',
1197            barColor: '#ff214f',
1198            trackColor: '#c7c7c7',
1199            scaleColor: false,
1200            scaleLength: 1,
1201            lineCap: 'round',
1202            lineWidth: 2, //12
1203            size: 120, //110
1204            animate: {
1205                duration: 2000,
1206                enabled: true
1207            },
1208            onStep: function (from, to, percent) {
1209                $(this.el).find('.percent').text(Math.round(percent));
1210            }
1211        });
1212        $(document.body).on('appear', '.chart2', function (e) {
1213            // this code is executed for each appeared element
1214            if (!$(this).hasClass('appear')) {
1215                $(this).addClass('appear');
1216                $(this).data('easyPieChart').update(0).update($(this).data('percent'));
1217            }
1218        });
1219    }
1220
1221    if ($('.chart3').length > 0) {
1222        $('.chart3').appear();
1223        $('.chart3').easyPieChart({
1224            easing: 'easeOutCirc',
1225            barColor: '#ff214f',
1226            trackColor: '',
1227            scaleColor: false,
1228            scaleLength: 1,
1229            lineCap: 'round',
1230            lineWidth: 3, //12
1231            size: 140, //110
1232            animate: {
1233                duration: 2000,
1234                enabled: true
1235            },
1236            onStep: function (from, to, percent) {
1237                $(this.el).find('.percent').text(Math.round(percent));
1238            }
1239        });
1240        $(document.body).on('appear', '.chart3', function (e) {
1241            // this code is executed for each appeared element
1242            if (!$(this).hasClass('appear')) {
1243                $(this).addClass('appear');
1244                $(this).data('easyPieChart').update(0).update($(this).data('percent'));
1245            }
1246        });
1247    }
1248
1249    /*==============================================================
1250     portfolio filter
1251     ==============================================================*/
1252    var $portfolio_filter = $('.portfolio-grid');
1253    $portfolio_filter.imagesLoaded(function () {
1254        $portfolio_filter.isotope({
1255            layoutMode: 'masonry',
1256            itemSelector: '.grid-item',
1257            percentPosition: true,
1258            masonry: {
1259                columnWidth: '.grid-sizer'
1260            }
1261        });
1262        $portfolio_filter.isotope();
1263    });
1264    var $grid_selectors = $('.portfolio-filter > li > a');
1265    $grid_selectors.on('click', function () {
1266        $grid_selectors.parent().removeClass('active');
1267        $(this).parent().addClass('active');
1268        var selector = $(this).attr('data-filter');
1269        $portfolio_filter.find('.grid-item').removeClass('animated').css("visibility", ""); // avoid problem to filter after sorting
1270        $portfolio_filter.find('.grid-item').each(function () {
1271            /* remove perticular element from WOW array when you don't want animation on element after DOM lead */
1272            wow.removeBox(this);
1273            $(this).css("-webkit-animation", "none");
1274            $(this).css("-moz-animation", "none");
1275            $(this).css("-ms-animation", "none");
1276            $(this).css("animation", "none");
1277        });
1278        $portfolio_filter.isotope({filter: selector});
1279        return false;
1280    });
1281    $(window).resize(function () {
1282        if (!isMobile && !isiPhoneiPad) {
1283            $portfolio_filter.imagesLoaded(function () {
1284                setTimeout(function () {
1285                    $portfolio_filter.find('.grid-item').removeClass('wow').removeClass('animated'); // avoid problem to filter after window resize
1286                    $portfolio_filter.isotope('layout');
1287                }, 300);
1288            });
1289        }
1290    });
1291    var $blog_filter = $('.blog-grid');
1292    $blog_filter.imagesLoaded(function () {
1293        $blog_filter.isotope({
1294            layoutMode: 'masonry',
1295            itemSelector: '.grid-item',
1296            percentPosition: true,
1297            masonry: {
1298                columnWidth: '.grid-sizer'
1299            }
1300        });
1301    });
1302    $(window).resize(function () {
1303        setTimeout(function () {
1304            $blog_filter.find('.grid-item').removeClass('wow').removeClass('animated'); // avoid problem to filter after window resize
1305            $blog_filter.isotope('layout');
1306        }, 300);
1307    });
1308
1309    /*==============================================================
1310     lightbox gallery
1311     ==============================================================*/
1312    $('.lightbox-gallery').magnificPopup({
1313        delegate: 'a',
1314        type: 'image',
1315        tLoading: 'Loading image #%curr%...',
1316        mainClass: 'mfp-fade',
1317        fixedContentPos: true,
1318        closeBtnInside: false,
1319        gallery: {
1320            enabled: true,
1321            navigateByImgClick: true,
1322            preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
1323        }
1324    });
1325    /* for group gallery */
1326    var lightboxgallerygroups = {};
1327    $('.lightbox-group-gallery-item').each(function () {
1328        var id = $(this).attr('data-group');
1329        if (!lightboxgallerygroups[id]) {
1330            lightboxgallerygroups[id] = [];
1331        }
1332        lightboxgallerygroups[id].push(this);
1333    });
1334    $.each(lightboxgallerygroups, function () {
1335        $(this).magnificPopup({
1336            type: 'image',
1337            closeOnContentClick: true,
1338            closeBtnInside: false,
1339            gallery: {enabled: true}
1340        });
1341    });
1342
1343    $('.lightbox-portfolio').magnificPopup({
1344        delegate: '.gallery-link',
1345        type: 'image',
1346        tLoading: 'Loading image #%curr%...',
1347        mainClass: 'mfp-fade',
1348        fixedContentPos: true,
1349        closeBtnInside: false,
1350        gallery: {
1351            enabled: true,
1352            navigateByImgClick: false,
1353            preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
1354        }
1355    });
1356    /*==============================================================
1357     single image lightbox - zoom animation
1358     ==============================================================*/
1359    $('.single-image-lightbox').magnificPopup({
1360        type: 'image',
1361        closeOnContentClick: true,
1362        fixedContentPos: true,
1363        closeBtnInside: false,
1364        mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side
1365        image: {
1366            verticalFit: true
1367        },
1368        zoom: {
1369            enabled: true,
1370            duration: 300 // don't foget to change the duration also in CSS
1371        }
1372    });
1373    /*==============================================================
1374     zoom gallery
1375     ==============================================================*/
1376    $('.zoom-gallery').magnificPopup({
1377        delegate: 'a',
1378        type: 'image',
1379        mainClass: 'mfp-with-zoom mfp-img-mobile',
1380        fixedContentPos: true,
1381        closeBtnInside: false,
1382        image: {
1383            verticalFit: true,
1384            titleSrc: function (item) {
1385                return item.el.attr('title');
1386            }
1387        },
1388        gallery: {
1389            enabled: true
1390        },
1391        zoom: {
1392            enabled: true,
1393            duration: 300, // don't foget to change the duration also in CSS
1394            opener: function (element) {
1395                return element.find('img');
1396            }
1397        }
1398    });
1399    /*==============================================================*/
1400    //Modal popup - START CODE
1401    /*==============================================================*/
1402    $('.modal-popup').magnificPopup({
1403        type: 'inline',
1404        preloader: false,
1405        // modal: true,
1406        blackbg: true,
1407        callbacks: {
1408            open: function () {
1409                $('html').css('margin-right', 0);
1410            }
1411        }
1412    });
1413    $(document).on('click', '.popup-modal-dismiss', function (e) {
1414        e.preventDefault();
1415        $.magnificPopup.close();
1416    });
1417
1418    /*==============================================================*/
1419    //Modal popup - zoom animation - START CODE
1420    /*==============================================================*/
1421    $('.popup-with-zoom-anim').magnificPopup({
1422        type: 'inline',
1423        fixedContentPos: false,
1424        fixedBgPos: true,
1425        overflowY: 'auto',
1426        closeBtnInside: true,
1427        preloader: false,
1428        midClick: true,
1429        removalDelay: 300,
1430        blackbg: true,
1431        mainClass: 'my-mfp-zoom-in'
1432    });
1433
1434    $('.popup-with-move-anim').magnificPopup({
1435        type: 'inline',
1436        fixedContentPos: false,
1437        fixedBgPos: true,
1438        overflowY: 'auto',
1439        closeBtnInside: true,
1440        preloader: false,
1441        midClick: true,
1442        removalDelay: 300,
1443        blackbg: true,
1444        mainClass: 'my-mfp-slide-bottom'
1445    });
1446
1447    /*==============================================================
1448     popup with form
1449     ==============================================================*/
1450    $('.popup-with-form').magnificPopup({
1451        type: 'inline',
1452        preloader: false,
1453        closeBtnInside: false,
1454        fixedContentPos: true,
1455        focus: '#name',
1456        callbacks: {
1457            beforeOpen: function () {
1458                if ($(window).width() < 700) {
1459                    this.st.focus = false;
1460                } else {
1461                    this.st.focus = '#name';
1462                }
1463            }
1464        }
1465    });
1466    /*==============================================================
1467     video magnific popup
1468     ==============================================================*/
1469
1470    $('.popup-youtube, .popup-vimeo, .popup-googlemap').magnificPopup({
1471        disableOn: 700,
1472        type: 'iframe',
1473        mainClass: 'mfp-fade',
1474        removalDelay: 160,
1475        preloader: false,
1476        fixedContentPos: "auto",
1477        closeBtnInside: false
1478    });
1479    /*==============================================================
1480     ajax magnific popup for onepage portfolio
1481     ==============================================================*/
1482    $('.ajax-popup').magnificPopup({
1483        type: 'ajax',
1484        alignTop: true,
1485        fixedContentPos: true,
1486        overflowY: 'scroll', // as we know that popup content is tall we set scroll overflow by default to avoid jump
1487        callbacks: {
1488            open: function () {
1489                $('.navbar .collapse').removeClass('show');
1490                $('.navbar a.dropdown-toggle').addClass('collapsed');
1491            }
1492        }
1493    });
1494
1495    /*==============================================================
1496     mega menu width 
1497     ===============================================================*/
1498    $("ul.mega-menu-full").each(function (idx, elm) {
1499        var megaMenuWidth = 0;
1500        $(this).children('li').each(function (idx, elm) {
1501            var LIheight = 0;
1502            megaMenuWidth += $(this).outerWidth();
1503        });
1504        $(this).width(megaMenuWidth + 95);
1505        megaMenuWidth = 0;
1506    });
1507    /*==============================================================
1508     fit videos
1509     ==============================================================*/
1510    $(".fit-videos").fitVids();
1511
1512    /*==============================================================
1513     form to email
1514     ==============================================================*/
1515    $("#success-subscribe-newsletter").hide();
1516    $("#success-subscribe-newsletter2").hide();
1517    $("#success-contact-form").hide();
1518    $("#success-project-contact-form").hide();
1519    $("#success-contact-form-2").hide();
1520    $("#success-contact-form-3").hide();
1521    $("#success-project-contact-form-4").hide();
1522
1523    //Subscribe newsletter form
1524    $(document).on("click", '#button-subscribe-newsletter', function () {
1525        var error = ValidationsubscribenewsletterForm();
1526        if (error) {
1527            $.ajax({
1528                type: "POST",
1529                url: "email-templates/subscribe-newsletter.php",
1530                data: $("#subscribenewsletterform").serialize(),
1531                success: function (result) {
1532                    // Un-comment below code to redirect user to thank you page.
1533                    //window.location.href="thank-you.html";
1534
1535                    $('input[type=text],textarea').each(function () {
1536                        $(this).val('');
1537                    });
1538                    $("#success-subscribe-newsletter").html(result);
1539                    $("#success-subscribe-newsletter").fadeIn("slow");
1540                    $('#success-subscribe-newsletter').delay(4000).fadeOut("slow");
1541                }
1542            });
1543        }
1544    });
1545
1546    function ValidationsubscribenewsletterForm() {
1547        var error = true;
1548        $('#subscribenewsletterform input[type=text]').each(function (index) {
1549            if (index == 0) {
1550                if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) {
1551                    $("#subscribenewsletterform").find("input:eq(" + index + ")").addClass("required-error");
1552                    error = false;
1553                } else {
1554                    $("#subscribenewsletterform").find("input:eq(" + index + ")").removeClass("required-error");
1555                }
1556            }
1557
1558        });
1559        return error;
1560    }
1561
1562    $(document).on("click", '#button-subscribe-newsletter2', function () {
1563        var error = ValidationsubscribenewsletterForm2();
1564        if (error) {
1565            $.ajax({
1566                type: "POST",
1567                url: "email-templates/subscribe-newsletter.php",
1568                data: $("#subscribenewsletterform2").serialize(),
1569                success: function (result) {
1570                    // Un-comment below code to redirect user to thank you page.
1571                    //window.location.href="thank-you.html";
1572
1573                    $('input[type=text],textarea').each(function () {
1574                        $(this).val('');
1575                    });
1576                    $("#success-subscribe-newsletter2").html(result);
1577                    $("#success-subscribe-newsletter2").fadeIn("slow");
1578                    $('#success-subscribe-newsletter2').delay(4000).fadeOut("slow");
1579
1580
1581                }
1582            });
1583        }
1584    });
1585
1586    function ValidationsubscribenewsletterForm2() {
1587        var error = true;
1588        $('#subscribenewsletterform2 input[type=text]').each(function (index) {
1589            if (index == 0) {
1590                if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) {
1591                    $("#subscribenewsletterform2").find("input:eq(" + index + ")").addClass("required-error");
1592                    error = false;
1593                } else {
1594                    $("#subscribenewsletterform2").find("input:eq(" + index + ")").removeClass("required-error");
1595                }
1596            }
1597        });
1598        return error;
1599    }
1600
1601    //Contact us form
1602    $(document).on("click", '#contact-us-button', function () {
1603        var error = ValidationContactForm();
1604        if (error) {
1605            $.ajax({
1606                type: "POST",
1607                url: "email-templates/contact.php",
1608                data: $("#contact-form").serialize(),
1609                success: function (result) {
1610                    // Un-comment below code to redirect user to thank you page.
1611                    //window.location.href="thank-you.html";
1612
1613                    $('input[type=text],textarea').each(function () {
1614                        $(this).val('');
1615                    });
1616                    $("#success-contact-form").html(result);
1617                    $("#success-contact-form").fadeIn("slow");
1618                    $('#success-contact-form').delay(4000).fadeOut("slow");
1619                }
1620            });
1621        }
1622    });
1623    function ValidationContactForm() {
1624        var error = true;
1625        $('#contact-form input[type=text]').each(function (index) {
1626            if (index == 0) {
1627                if ($(this).val() == null || $(this).val() == "") {
1628                    $("#contact-form").find("input:eq(" + index + ")").addClass("required-error");
1629                    error = false;
1630                } else {
1631                    $("#contact-form").find("input:eq(" + index + ")").removeClass("required-error");
1632                }
1633            } else if (index == 1) {
1634                if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) {
1635                    $("#contact-form").find("input:eq(" + index + ")").addClass("required-error");
1636                    error = false;
1637                } else {
1638                    $("#contact-form").find("input:eq(" + index + ")").removeClass("required-error");
1639                }
1640            }
1641
1642        });
1643        return error;
1644    }
1645
1646    //Contact us form 2
1647    $('#contact-us-button-2').on("click", function () {
1648        var error = ValidationContactForm2();
1649        if (error) {
1650            $.ajax({
1651                type: "POST",
1652                url: "email-templates/contact.php",
1653                data: $("#contact-form-2").serialize(),
1654                success: function (result) {
1655                    // Un-comment below code to redirect user to thank you page.
1656                    //window.location.href="thank-you.html";
1657
1658                    $('input[type=text],textarea').each(function () {
1659                        $(this).val('');
1660                    });
1661                    $("#success-contact-form-2").html(result);
1662                    $("#success-contact-form-2").fadeIn("slow");
1663                    $('#success-contact-form-2').delay(4000).fadeOut("slow");
1664                }
1665            });
1666        }
1667    });
1668    function ValidationContactForm2() {
1669        var error = true;
1670        $('#contact-form-2 input[type=text]').each(function (index) {
1671            if (index == 0) {
1672                if ($(this).val() == null || $(this).val() == "") {
1673                    $("#contact-form-2").find("input:eq(" + index + ")").addClass("required-error");
1674                    error = false;
1675                } else {
1676                    $("#contact-form-2").find("input:eq(" + index + ")").removeClass("required-error");
1677                }
1678            } else if (index == 1) {
1679                if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) {
1680                    $("#contact-form-2").find("input:eq(" + index + ")").addClass("required-error");
1681                    error = false;
1682                } else {
1683                    $("#contact-form-2").find("input:eq(" + index + ")").removeClass("required-error");
1684                }
1685            }
1686        });
1687        return error;
1688    }
1689
1690    //Contact us form 3
1691
1692    $(document).on("click", '#contact-us-button-3', function () {
1693        var error = ValidationContactForm3();
1694        if (error) {
1695            $.ajax({
1696                type: "POST",
1697                url: "email-templates/contact.php",
1698                data: $("#contact-form-3").serialize(),
1699                success: function (result) {
1700                    // Un-comment below code to redirect user to thank you page.
1701                    //window.location.href="thank-you.html";
1702                    $('input[type=text],textarea').each(function () {
1703                        $(this).val('');
1704                    });
1705                    $("#success-contact-form-3").html(result);
1706                    $("#success-contact-form-3").fadeIn("slow");
1707                    $('#success-contact-form-3').delay(4000).fadeOut("slow");
1708                }
1709            });
1710        }
1711    });
1712    function ValidationContactForm3() {
1713        var error = true;
1714        $('#contact-form-3 input[type=text]').each(function (index) {
1715            if (index == 0) {
1716                if ($(this).val() == null || $(this).val() == "") {
1717                    $("#contact-form-3").find("input:eq(" + index + ")").addClass("required-error");
1718                    error = false;
1719                } else {
1720                    $("#contact-form-3").find("input:eq(" + index + ")").removeClass("required-error");
1721                }
1722            } else if (index == 1) {
1723                if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) {
1724                    $("#contact-form-3").find("input:eq(" + index + ")").addClass("required-error");
1725                    error = false;
1726                } else {
1727                    $("#contact-form-3").find("input:eq(" + index + ")").removeClass("required-error");
1728                }
1729            }
1730
1731        });
1732        return error;
1733    }
1734
1735    //Project Contact us form
1736    $(document).on("click", '#project-contact-us-button', function (e) {
1737        e.preventDefault();
1738        var error = ValidationProjectContactForm();
1739        if (error) {
1740            $.ajax({
1741                type: "POST",
1742                url: "../forms/envia_contato.php",
1743                data: $("#project-contact-form").serialize(),
1744                success: function (result) {
1745                    // Un-comment below code to redirect user to thank you page.
1746                    //window.location.href="thank-you.html";
1747
1748                    $('input[type=text],textarea').each(function () {
1749                        $(this).val('');
1750                    });
1751                    $("#success-project-contact-form").html(result);
1752                    $("#success-project-contact-form").fadeIn("slow");
1753                    $('#success-project-contact-form').delay(4000).fadeOut("slow");
1754                }
1755            });
1756        }
1757    });
1758    function ValidationProjectContactForm() {
1759        var error = true;
1760        $('#project-contact-form input[type=text]').each(function (index) {
1761            if (index == 0) {
1762                if ($(this).val() == null || $(this).val() == "") {
1763                    $("#project-contact-form").find("input:eq(" + index + ")").addClass("required-error");
1764                    error = false;
1765                } else {
1766                    $("#project-contact-form").find("input:eq(" + index + ")").removeClass("required-error");
1767                }
1768            } else if (index == 2) {
1769                if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) {
1770                    $("#project-contact-form").find("input:eq(" + index + ")").addClass("required-error");
1771                    error = false;
1772                } else {
1773                    $("#project-contact-form").find("input:eq(" + index + ")").removeClass("required-error");
1774                }
1775            }
1776
1777        });
1778        return error;
1779    }
1780
1781    //Project Contact us form 2
1782    $(document).on("click", '#project-contact-us-4-button', function () {
1783        var error = ValidationProjectContactForm4();
1784        if (error) {
1785            $.ajax({
1786                type: "POST",
1787                url: "email-templates/project-contact.php",
1788                data: $("#project-contact-form-4").serialize(),
1789                success: function (result) {
1790                    // Un-comment below code to redirect user to thank you page.
1791                    //window.location.href="thank-you.html";
1792
1793                    $('input[type=text],textarea').each(function () {
1794                        $(this).val('');
1795                    });
1796                    $("#success-project-contact-form-4").html(result);
1797                    $("#success-project-contact-form-4").fadeIn("slow");
1798                    $('#success-project-contact-form-4').delay(4000).fadeOut("slow");
1799                }
1800            });
1801        }
1802    });
1803    function ValidationProjectContactForm4() {
1804        var error = true;
1805        $('#project-contact-form-4 input[type=text]').each(function (index) {
1806            if (index == 0) {
1807                if ($(this).val() == null || $(this).val() == "") {
1808                    $("#project-contact-form-4").find("input:eq(" + index + ")").addClass("required-error");
1809                    error = false;
1810                } else {
1811                    $("#project-contact-form-4").find("input:eq(" + index + ")").removeClass("required-error");
1812                }
1813            } else if (index == 2) {
1814                if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) {
1815                    $("#project-contact-form-4").find("input:eq(" + index + ")").addClass("required-error");
1816                    error = false;
1817                } else {
1818                    $("#project-contact-form-4").find("input:eq(" + index + ")").removeClass("required-error");
1819                }
1820            }
1821        });
1822        return error;
1823    }
1824
1825    /*==============================================================
1826     wow animation - on scroll
1827     ==============================================================*/
1828    var wow = new WOW({
1829        boxClass: 'wow',
1830        animateClass: 'animated',
1831        offset: 0,
1832        mobile: false,
1833        live: true
1834    });
1835    $(window).imagesLoaded(function () {
1836        wow.init();
1837    });
1838    /*==============================================================
1839     counter
1840     ==============================================================*/
1841    $(function ($) {
1842        animatecounters();
1843    });
1844    function animatecounters() {
1845        $('.timer').each(count);
1846        function count(options) {
1847            var $this = $(this);
1848            options = $.extend({}, options || {}, $this.data('countToOptions') || {});
1849            $this.countTo(options);
1850        }
1851    }
1852    /* ===================================
1853     counter number reset while scrolling
1854     ====================================== */
1855    $('.timer').appear();
1856    $(document.body).on('appear', '.timer', function (e) {
1857        // this code is executed for each appeared element
1858        if (!$(this).hasClass('appear')) {
1859            animatecounters();
1860            $(this).addClass('appear');
1861        }
1862    });
1863    $('.countdown').countdown($('.countdown').attr("data-enddate")).on('update.countdown', function (event) {
1864        $(this).html(event.strftime('' + '<div class="counter-container"><div class="counter-box first"><div class="number">%-D</div><span>Day%!d</span></div>' + '<div class="counter-box"><div class="number">%H</div><span>Hours</span></div>' + '<div class="counter-box"><div class="number">%M</div><span>Minutes</span></div>' + '<div class="counter-box last"><div class="number">%S</div><span>Seconds</span></div></div>'));
1865    });
1866
1867    /* ===================================
1868     left nav
1869     ====================================== */
1870    $(document).on('click', '.right-menu-button', function (e) {
1871        $('body').toggleClass('left-nav-on');
1872    });
1873
1874    /*==============================================================*/
1875    //    hamburger menu 
1876    /*==============================================================*/
1877    $(document).on('click', '.btn-hamburger', function () {
1878        $('.hamburger-menu').toggleClass('show-menu');
1879        $('body').removeClass('show-menu');
1880    });
1881
1882    /*==============================================================*/
1883    //sidebar nav open
1884    /*==============================================================*/
1885    $(document).on('click', '#mobileToggleSidenav', function () {
1886        $(this).closest('nav').toggleClass('sidemenu-open');
1887    });
1888
1889    /*=================================
1890     //justified Gallery
1891     =================================*/
1892    $(document).imagesLoaded(function () {
1893        if ($(".justified-gallery").length > 0) {
1894            $(".justified-gallery").justifiedGallery({
1895                rowHeight: 400,
1896                maxRowHeight: false,
1897                captions: true,
1898                margins: 10,
1899                waitThumbnailsLoad: true
1900            });
1901        }
1902    });
1903
1904    $('.atr-nav').on("click", function () {
1905        $(".atr-div").append("<a class='close-cross' href='#'>X</a>");
1906        $(".atr-div").animate({
1907            width: "toggle"
1908        });
1909    });
1910
1911    $('.close-cross').on("click", function () {
1912        $(".atr-div").hide();
1913    });
1914
1915    var menuRight = document.getElementById('cbp-spmenu-s2'),
1916            showRightPush = document.getElementById('showRightPush'),
1917            body = document.body;
1918    if (showRightPush) {
1919        showRightPush.onclick = function () {
1920            classie.toggle(this, 'active');
1921            if (menuRight)
1922                classie.toggle(menuRight, 'cbp-spmenu-open');
1923        };
1924    }
1925
1926    var test = document.getElementById('close-pushmenu');
1927    if (test) {
1928        test.onclick = function () {
1929            classie.toggle(this, 'active');
1930            if (menuRight)
1931                classie.toggle(menuRight, 'cbp-spmenu-open');
1932        };
1933    }
1934
1935    //blog page header animation
1936    $(".blog-header-style1 li").hover(function () {
1937        $('.blog-header-style1 li.blog-column-active').removeClass('blog-column-active');
1938        $(this).addClass('blog-column-active');
1939    }, function () {
1940        $(this).removeClass('blog-column-active');
1941        $('.blog-header-style1 li:first-child').addClass('blog-column-active');
1942    });
1943
1944    /*==============================================================*/
1945    //big menu open close start
1946    /*==============================================================*/
1947    $('.big-menu-open').on("click", function () {
1948        $('.big-menu-right').addClass("open");
1949    });
1950
1951    $('.big-menu-close').on("click", function () {
1952        $('.big-menu-right').removeClass("open");
1953    });
1954
1955    /*==============================================================
1956     instagramfeed
1957     ==============================================================*/
1958    if ($('#instaFeed-style1').length != 0) {
1959        var instaFeedStyle1 = new Instafeed({
1960            target: 'instaFeed-style1',
1961            get: 'user',
1962            userId: 5640046896,
1963            limit: '8',
1964            accessToken: '5640046896.1677ed0.f7cd85767e124a9f9f8d698cb33252a0',
1965            resolution: "low_resolution",
1966            error: {
1967                template: '<div class="col-12"><span class=text-center>No Images Found</span></div>'
1968            },
1969            template: '<div class="col-lg-3 col-md-6 instafeed-style1"><a class="insta-link" href="{{link}}" target="_blank"><img src="{{image}}" class="insta-image" /><div class="insta-counts"><span><i class="ti-heart"></i> <span class="count-number">{{likes}}</span></span><span><i class="ti-comment"></i> <span class="count-number">{{comments}}</span></span></div></a></div>'
1970        });
1971        instaFeedStyle1.run();
1972    }
1973
1974    if ($('#instaFeed-aside').length != 0) {
1975        var instaFeedAside = new Instafeed({
1976            target: 'instaFeed-aside',
1977            get: 'user',
1978            userId: 5640046896,
1979            limit: '6',
1980            accessToken: '5640046896.1677ed0.f7cd85767e124a9f9f8d698cb33252a0',
1981            resolution: "low_resolution",
1982            error: {
1983                template: '<div class="col-12"><span class=text-center>No Images Found</span></div>'
1984            },
1985            template: '<li><figure><a href="{{link}}" target="_blank"><img src="{{image}}" class="insta-image" /><span class="insta-counts"><i class="ti-heart"></i>
1985{{likes}}</span></a></figure></li>'
1986        });
1987        instaFeedAside.run();
1988    }
1989
1990    if ($('#instaFeed-footer').length != 0) {
1991        var instaFeedFooter = new Instafeed({
1992            target: 'instaFeed-footer',
1993            get: 'user',
1994            userId: 5640046896,
1995            limit: '6',
1996            accessToken: '5640046896.1677ed0.f7cd85767e124a9f9f8d698cb33252a0',
1997            resolution: "low_resolution",
1998            error: {
1999                template: '<div class="col-12"><span class=text-center>No Images Found</span></div>'
2000            },
2001            template: '<li><figure><a href="{{link}}" target="_blank"><img src="{{image}}" class="insta-image" /><span class="insta-counts"><i class="ti-heart"></i><span>{{likes}}</span></span></a></figure></li>'
2002        });
2003        instaFeedFooter.run();
2004    }
2005
2006    /*==============================================================*/
2007    //revolution Start 
2008    /*==============================================================*/
2009    /* ================================
2010     home-creative-studio
2011     ================================*/
2012    if ($("#rev_slider_151_1").revolution == undefined) {
2013        revslider_showDoubleJqueryError("#rev_slider_151_1");
2014    } else {
2015        $("#rev_slider_151_1").show().revolution({
2016            sliderType: "standard",
2017            jsFileLocation: "revolution/js/",
2018            sliderLayout: "fullscreen",
2019            dottedOverlay: "none",
2020            delay: 9000,
2021            navigation: {
2022                keyboardNavigation: "off",
2023                keyboard_direction: "vertical",
2024                mouseScrollNavigation: "off",
2025                mouseScrollReverse: "default",
2026                onHoverStop: "off",
2027                touch: {
2028                    touchenabled: "on",
2029                    swipe_threshold: 75,
2030                    swipe_min_touches: 1,
2031                    swipe_direction: "horizontal",
2032                    drag_block_vertical: false
2033                },
2034                arrows: {
2035                    style: "uranus",
2036                    enable: true,
2037                    hide_onmobile: false,
2038                    hide_over: 479,
2039                    hide_onleave: false,
2040                    tmp: '',
2041                    left: {
2042                        h_align: "left",
2043                        v_align: "center",
2044                        h_offset: 0,
2045                        v_offset: 0
2046                    },
2047                    right: {
2048                        h_align: "right",
2049                        v_align: "center",
2050                        h_offset: 0,
2051                        v_offset: 0
2052                    }
2053                }
2054            },
2055            responsiveLevels: [1240, 1024, 778, 480],
2056            visibilityLevels: [1240, 1024, 778, 480],
2057            gridwidth: [1240, 1024, 778, 480],
2058            gridheight: [868, 768, 960, 720],
2059            lazyType: "none",
2060            scrolleffect: {
2061                blur: "on",
2062                maxblur: "20",
2063                on_slidebg: "on",
2064                direction: "top",
2065                multiplicator: "2",
2066                multiplicator_layers: "2",
2067                tilt: "10",
2068                disable_on_mobile: "off"
2069            },
2070            parallax: {
2071                type: "scroll",
2072                origo: "slidercenter",
2073                speed: 400,
2074                levels: [5, 10, 15, 20, 25, 30, 35, 40, 45, 46, 47, 48, 49, 50, 51, 55]
2075            },
2076            shadow: 0,
2077            spinner: "spinner3",
2078            stopLoop: "off",
2079            stopAfterLoops: -1,
2080            stopAtSlide: -1,
2081            shuffle: "off",
2082            autoHeight: "off",
2083            fullScreenAutoWidth: "off",
2084            fullScreenAlignForce: "off",
2085            fullScreenOffsetContainer: "",
2086            fullScreenOffset: "0px",
2087            hideThumbsOnMobile: "off",
2088            hideSliderAtLimit: 0,
2089            hideCaptionAtLimit: 0,
2090            hideAllCaptionAtLilmit: 0,
2091            debugMode: false,
2092            fallbacks: {
2093                simplifyAll: "off",
2094                nextSlideOnWindowFocus: "off",
2095                disableFocusListener: false
2096            }
2097        });
2098    }
2099
2100    /* ================================
2101     home-classic-web-agency
2102     ================================*/
2103    if ($("#rev_slider_1174_1").revolution == undefined) {
2104        revslider_showDoubleJqueryError("#rev_slider_1174_1");
2105    } else {
2106        $("#rev_slider_1174_1").show().revolution({
2107            sliderType: "hero",
2108            jsFileLocation: "revolution/js/",
2109            sliderLayout: "fullscreen",
2110            dottedOverlay: "none",
2111            delay: 9000,
2112            navigation: {
2113            },
2114            responsiveLevels: [1240, 1024, 778, 480],
2115            visibilityLevels: [1240, 1024, 778, 480],
2116            gridwidth: [1240, 1024, 778, 480],
2117            gridheight: [868, 768, 960, 720],
2118            lazyType: "none",
2119            parallax: {
2120                type: "scroll",
2121                origo: "slidercenter",
2122                speed: 400,
2123                levels: [10, 15, 20, 25, 30, 35, 40, -10, -15, -20, -25, -30, -35, -40, -45, 55]
2124            },
2125            shadow: 0,
2126            spinner: "off",
2127            autoHeight: "off",
2128            fullScreenAutoWidth: "off",
2129            fullScreenAlignForce: "off",
2130            fullScreenOffsetContainer: "",
2131            disableProgressBar: "on",
2132            hideThumbsOnMobile: "off",
2133            hideSliderAtLimit: 0,
2134            hideCaptionAtLimit: 0,
2135            hideAllCaptionAtLilmit: 0,
2136            debugMode: false,
2137            fallbacks: {
2138                simplifyAll: "off",
2139                disableFocusListener: false
2140            }
2141        });
2142    }
2143
2144    /* ================================
2145     home-classic-corporate
2146     ================================*/
2147    if ($("#rev_slider_1078_1").revolution == undefined) {
2148        revslider_showDoubleJqueryError("#rev_slider_1078_1");
2149    } else {
2150        $("#rev_slider_1078_1").show().revolution({
2151            sliderType: "standard",
2152            jsFileLocation: "revolution/js/",
2153            sliderLayout: "fullscreen",
2154            dottedOverlay: "none",
2155            delay: 9000,
2156            navigation: {
2157                keyboardNavigation: "on",
2158                keyboard_direction: "horizontal",
2159                mouseScrollNavigation: "off",
2160                mouseScrollReverse: "default",
2161                onHoverStop: "off",
2162                touch: {
2163                    touchenabled: "on",
2164                    swipe_threshold: 75,
2165                    swipe_min_touches: 1,
2166                    swipe_direction: "horizontal",
2167                    drag_block_vertical: false
2168                }
2169                ,
2170                arrows: {
2171                    style: "zeus",
2172                    enable: true,
2173                    hide_onmobile: true,
2174                    hide_under: 600,
2175                    hide_onleave: true,
2176                    hide_delay: 200,
2177                    hide_delay_mobile: 1200,
2178                    tmp: '<div class="tp-title-wrap">  	<div class="tp-arr-imgholder"></div> </div>',
2179                    left: {
2180                        h_align: "left",
2181                        v_align: "center",
2182                        h_offset: 30,
2183                        v_offset: 0
2184                    },
2185                    right: {
2186                        h_align: "right",
2187                        v_align: "center",
2188                        h_offset: 30,
2189                        v_offset: 0
2190                    }
2191                }
2192                ,
2193                bullets: {
2194                    enable: true,
2195                    hide_onmobile: false,
2196                    hide_under: 300,
2197                    style: "hermes",
2198                    hide_onleave: false,
2199                    hide_delay: 200,
2200                    hide_delay_mobile: 1200,
2201                    direction: "horizontal",
2202                    h_align: "center",
2203                    v_align: "bottom",
2204                    h_offset: 0,
2205                    v_offset: 30,
2206                    space: 8,
2207                    tmp: '<span class="tp-bullet-img-wrap">  <span class="tp-bullet-image"></span></span><span class="tp-bullet-title">{{title}}</span>'
2208                }
2209            },
2210            viewPort: {
2211                enable: true,
2212                outof: "pause",
2213                visible_area: "80%",
2214                presize: false
2215            },
2216            responsiveLevels: [1240, 1024, 778, 480],
2217            visibilityLevels: [1240, 1024, 778, 480],
2218            gridwidth: [1240, 1024, 778, 480],
2219            gridheight: [600, 600, 500, 400],
2220            lazyType: "none",
2221            parallax: {
2222                type: "mouse",
2223                origo: "slidercenter",
2224                speed: 2000,
2225                levels: [2, 3, 4, 5, 6, 7, 12, 16, 10, 50, 46, 47, 48, 49, 50, 55]
2226            },
2227            shadow: 0,
2228            spinner: "off",
2229            stopLoop: "off",
2230            stopAfterLoops: -1,
2231            stopAtSlide: -1,
2232            shuffle: "off",
2233            autoHeight: "off",
2234            hideThumbsOnMobile: "off",
2235            hideSliderAtLimit: 0,
2236            hideCaptionAtLimit: 0,
2237            hideAllCaptionAtLilmit: 0,
2238            debugMode: false,
2239            fallbacks: {
2240                simplifyAll: "off",
2241                nextSlideOnWindowFocus: "off",
2242                disableFocusListener: false
2243            }
2244        });
2245    }
2246
2247    /*==============================================================*/
2248    //magnificPopup Start 
2249    /*==============================================================*/
2250    $('.header-search-form').magnificPopup({
2251        mainClass: 'mfp-fade',
2252        closeOnBgClick: true,
2253        preloader: false,
2254        // for white backgriund
2255        fixedContentPos: false,
2256        closeBtnInside: false,
2257        callbacks: {
2258            open: function () {
2259                setTimeout(function () {
2260                    $('.search-input').focus();
2261                }, 500);
2262                $('#search-header').parent().addClass('search-popup');
2263                if (!isMobile) {
2264                    $('body').addClass('overflow-hidden');
2265                    //$('body').addClass('position-fixed');
2266                    $('body').addClass('width-100');
2267                    document.onmousewheel = ScrollStop;
2268                } else {
2269                    $('body, html').on('touchmove', function (e) {
2270                        e.preventDefault();
2271                    });
2272                }
2273            },
2274            close: function () {
2275                if (!isMobile) {
2276                    $('body').removeClass('overflow-hidden');
2277                    //$('body').removeClass('position-fixed');
2278                    $('body').removeClass('width-100');
2279                    $('#search-header input[type=text]').each(function (index) {
2280                        if (index == 0) {
2281                            $(this).val('');
2282                            $("#search-header").find("input:eq(" + index + ")").css({"border": "none", "border-bottom": "2px solid rgba(255,255,255,0.5)"});
2283                        }
2284                    });
2285                    document.onmousewheel = ScrollStart;
2286                } else {
2287                    $('body, html').unbind('touchmove');
2288                }
2289            }
2290        }
2291    });
2292
2293    $("input.search-input").on("keypress", function (event) {
2294        if (event.which == 13 && !isMobile) {
2295            $("button.search-button").trigger("click");
2296            event.preventDefault();
2297        }
2298    });
2299
2300    $("input.search-input").on("keyup", function (event) {
2301        if ($(this).val() == null || $(this).val() == "") {
2302            $(this).css({"border": "none", "border-bottom": "2px solid red"});
2303        } else {
2304            $(this).css({"border": "none", "border-bottom": "2px solid rgba(255,255,255,0.5)"});
2305        }
2306    });
2307
2308    $("form.search-form, form.search-form-result").submit(function (event) {
2309        var error = validationSearchForm();
2310        if (error) {
2311            var action = $(this).attr('action');
2312            action = action == '#' || action == '' ? 'blog-grid-3columns.html' : action;
2313            action = action + '?' + $(this).serialize();
2314            window.location = action;
2315        }
2316
2317        event.preventDefault();
2318    });
2319
2320    $(document).on("click", '.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', function (e) {
2321        e.preventDefault();
2322    });
2323
2324    $(document).on('touchstart click', 'body', function (e) {
2325        if ($(window).width() < 992) {
2326            if (!$('.navbar-collapse').has(e.target).is('.navbar-collapse') && $('.navbar-collapse').hasClass('show') && !$(e.target).hasClass('navbar-toggle')) {
2327                $('.navbar-collapse').collapse('hide');
2328            }
2329        } else {
2330            if (!$('.navbar-collapse').has(e.target).is('.navbar-collapse') && $('.navbar-collapse').hasClass('show')) {
2331                $('.navbar-collapse').find('a.dropdown-toggle').addClass('collapsed');
2332                $('.navbar-collapse').find('ul.dropdown-menu').removeClass('show');
2333                $('.navbar-collapse a.dropdown-toggle').removeClass('active');
2334            }
2335        }
2336    });
2337
2338    $('.navbar-collapse a.dropdown-toggle').on('touchstart', function (e) {
2339        $('.navbar-collapse a.dropdown-toggle').not(this).removeClass('active');
2340        if ($(this).hasClass('active'))
2341            $(this).removeClass('active');
2342        else
2343            $(this).addClass('active');
2344    });
2345
2346    $('button.navbar-toggle').on("click", function (e) {
2347        if (isMobile) {
2348            $(".cart-content").css('opacity', '0');
2349            $(".cart-content").css('visibility', 'hidden');
2350        }
2351    });
2352
2353    $('a.dropdown-toggle').on("click", function (e) {
2354        if (isMobile) {
2355            $(".cart-content").css('opacity', '0');
2356            $(".cart-content").css('visibility', 'hidden');
2357        }
2358    });
2359
2360    $(document).on('touchstart click', '.navbar-collapse [data-toggle="dropdown"]', function (event) {
2361
2362        var $innerLinkLI = $(this).parents('ul.navbar-nav').find('li.dropdown a.inner
2362-link').parent('li.dropdown');
2363        if (!$(this).hasClass('inner-link') && !$(this).hasClass('dropdown-toggle') && $innerLinkLI.hasClass('show')) {
2364            $innerLinkLI.removeClass('show');
2365        }
2366        var target = $(this).attr('target');
2367        if ($(window).width() <= 991 && $(this).attr('href') && $(this).attr('href').indexOf("#") <= -1 && !$(event.target).is('i')) {
2368            if (event.ctrlKey || event.metaKey) {
2369                window.open($(this).attr('href'), "_blank");
2370                return false;
2371            } else if (!target)
2372                window.location = $(this).attr('href');
2373            else
2374                window.open($(this).attr('href'), target);
2375
2376        } else if ($(window).width() > 991 && $(this).attr('href').indexOf("#") <= -1) {
2377            if (event.ctrlKey || event.metaKey) {
2378                window.open($(this).attr('href'), "_blank");
2379                return false;
2380            } else if (!target)
2381                window.location = $(this).attr('href');
2382            else
2383                window.open($(this).attr('href'), target);
2384
2385        } else if ($(window).width() <= 991 && $(this).attr('href') && $(this).attr('href').length > 1 && $(this).attr('href').indexOf("#") >= 0 && $(this).hasClass('inner-link')) {
2386            $(this).parents('ul.navbar-nav').find('li.dropdown').not($(this).parent('.dropdown')).removeClass('show');
2387            if ($(this).parent('.dropdown').hasClass('show')) {
2388                $(this).parent('.dropdown').removeClass('show');
2389            } else {
2390                $(this).parent('.dropdown').addClass('show');
2391            }
2392            $(this).toggleClass('active');
2393        }
2394    });
2395
2396    /* ===================================
2397     skillbar
2398     ====================================== */
2399    $('.skillbar').appear();
2400    $('.skillbar').skillBars({
2401        from: 0,
2402        speed: 4000,
2403        interval: 100,
2404        decimals: 0
2405    });
2406
2407    $(document.body).on('appear', '.skillbar', function (e) {
2408        // this code is executed for each appeared element
2409        if (!$(this).hasClass('appear')) {
2410            $(this).addClass('appear');
2411            $(this).find('.skillbar-bar').css("width", "0%");
2412            $(this).skillBars({
2413                from: 0,
2414                speed: 4000,
2415                interval: 100,
2416                decimals: 0
2417            });
2418        }
2419    });
2420
2421    /*==============================================================*/
2422    //Set Resize Header Menu - START CODE
2423    /*==============================================================*/
2424    $('nav.full-width-pull-menu ul.panel-group li.dropdown a.dropdown-toggle').on("click", function (e) {
2425        if ($(this).parent('li').find('ul.dropdown-menu').length > 0) {
2426            if ($(this).parent('li').hasClass('show')) {
2427                $(this).parent('li').removeClass('show');
2428            } else {
2429                $(this).parent('li').addClass('show');
2430            }
2431        }
2432    });
2433
2434    /*==============================================================*/
2435    //accordion  - START CODE
2436    /*==============================================================*/
2437    $('.accordion-style1 .collapse').on('show.bs.collapse', function () {
2438        var id = $(this).attr('id');
2439        $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion');
2440        $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-minus"></i>');
2441    });
2442
2443    $('.accordion-style1 .collapse').on('hide.bs.collapse', function () {
2444        var id = $(this).attr('id');
2445        $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion');
2446        $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-plus"></i>');
2447    });
2448
2449    $( document ).on( 'click', '.nav.navbar-nav a.inner-link', function (e) {
2450        $(this).parents('ul.navbar-nav').find('a.inner-link').removeClass('active');
2451        var $this = $(this);        
2452        $(this).parents('.navbar-collapse').collapse('hide');
2453        
2454        setTimeout(function () {
2455            $this.addClass('active');
2456        }, 1000);
2457    });
2458
2459    $('.accordion-style2 .collapse').on('show.bs.collapse', function () {
2460        var id = $(this).attr('id');
2461        $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion');
2462        $('a[href="#' + id + '"] .panel-title').find('i').addClass('fa-angle-up').removeClass('fa-angle-down');
2463    });
2464
2465    $('.accordion-style2 .collapse').on('hide.bs.collapse', function () {
2466        var id = $(this).attr('id');
2467        $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion');
2468        $('a[href="#' + id + '"] .panel-title').find('i').removeClass('fa-angle-up').addClass('fa-angle-down');
2469    });
2470
2471    $('.accordion-style3 .collapse').on('show.bs.collapse', function () {
2472        var id = $(this).attr('id');
2473        $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion');
2474        $('a[href="#' + id + '"] .panel-title').find('i').addClass('fa-angle-up').removeClass('fa-angle-down');
2475    });
2476
2477    $('.accordion-style3 .collapse').on('hide.bs.collapse', function () {
2478        var id = $(this).attr('id');
2479        $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion');
2480        $('a[href="#' + id + '"] .panel-title').find('i').removeClass('fa-angle-up').addClass('fa-angle-down');
2481    });
2482
2483    /*==============================================================*/
2484    //toggles  - START CODE
2485    /*==============================================================*/
2486    $('.toggles .collapse').on('show.bs.collapse', function () {
2487        var id = $(this).attr('id');
2488        $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion');
2489        $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-minus"></i>');
2490    });
2491
2492    $('.toggles .collapse').on('hide.bs.collapse', function () {
2493        var id = $(this).attr('id');
2494        $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion');
2495        $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-plus"></i>');
2496    });
2497
2498    $('.toggles-style2 .collapse').on('show.bs.collapse', function () {
2499        var id = $(this).attr('id');
2500        $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion');
2501        $('a[href="#' + id + '"] .panel-title span').html('<i class="fa fa-angle-up"></i>');
2502    });
2503
2504    $('.toggles-style2 .collapse').on('hide.bs.collapse', function () {
2505        var id = $(this).attr('id');
2506        $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion');
2507        $('a[href="#' + id + '"] .panel-title span').html('<i class="fas fa-angle-down"></i>');
2508    });
2509
2510    /* ===================================
2511     blog hover box
2512     ====================================== */
2513    $(document).on("mouseenter", ".blog-post-style4 .grid-item", function (e) {
2514        $(this).find("figcaption .blog-hover-text").slideDown(300);
2515    });
2516    $(document).on("mouseleave", ".blog-post-style4 .grid-item", function (e) {
2517        $(this).find("figcaption .blog-hover-text").slideUp(300);
2518    });
2519    SetResizeContent();
2520
2521    var $allNonRatinaImages = $("img:not([data-rjs])");
2522    $allNonRatinaImages.attr('data-no-retina', '');
2523
2524    /*==============================================================*/
2525    //demo button  - START CODE
2526    /*==============================================================*/
2527    /* var $buythemediv = '<div class="buy-theme alt-font md-display-none">
2527<a href="https://themeforest.net/item/pofo-creative-agency-corporate-and-portfolio-multipurpose-template/20645944?ref=themezaa" target="_blank"><i class="ti-shopping-cart"></i><span>Buy Theme</span></a></div><div class="all-demo alt-font md-display-none"><a href="mailto:[email protected]?subject=POFO - Creative Agency, Corporate and Portfolio Multi-purpose Template - Quick Question"><i class="ti-email"></i><span>Quick Question?</span></a></div>';
2528    $('body').append($buythemediv); */
2529
2530
2531
2532    $(document).on("touchstart", ".sidebar-wrapper", function () {
2533        clearOpen();
2534    });
2535
2536    var getNav = $("nav.navbar.bootsnav"), getIn = getNav.find("ul.nav").data("in"), getOut = getNav.find("ul.nav").data("out");
2537    function clearOpen() {
2538        $('li.dropdown').removeClass("on").removeClass("show");
2539        $(".dropdown-menu").stop().fadeOut('fast');
2540        $(".dropdown-menu").removeClass(getIn);
2541        $(".dropdown-menu").addClass(getOut);
2542    }
2543
2544});
2545/* ===================================
2546 END READY
2547 ====================================== */
2548
2549/* ===================================
2550 START Page Load
2551 ====================================== */
2552$(document).on('load', function () {
2553    var hash = window.location.hash.substr(1);
2554    if (hash != "") {
2555        setTimeout(function () {
2556            $(document).imagesLoaded(function () {
2557                var scrollAnimationTime = 1200,
2558                        scrollAnimation = 'easeInOutExpo';
2559                var target = '#' + hash;
2560                if ($(target).length > 0) {
2561
2562                    $('html, body').stop()
2563                            .animate({
2564                                'scrollTop': $(target).offset().top
2565                            }, scrollAnimationTime, scrollAnimation, function () {
2566                                window.location.hash = target;
2567                            });
2568                }
2569            });
2570        }, 500);
2571    }
2572
2573    fullScreenHeight();
2574});

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.