PageSourceSearch

https://afchub.org/js/main.js

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

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.