
jQuery(document).ready(function(){
    

    
})



// logo carousel script starts

var poriLogoCarousel   = function ( $scope, $ ) {
    var logoCarouselWrapper = $scope.find( '.pori-logo-carousel-element' ).eq(0),
    slidesToShow            = logoCarouselWrapper.data( 'slidestoshow' ),
    slidesToScroll          = logoCarouselWrapper.data( 'slidestoscroll' ),
    carouselNav             = logoCarouselWrapper.data( 'carousel-nav' ),
    direction               = logoCarouselWrapper.data( 'direction' ),
    loop                    = undefined !== logoCarouselWrapper.data( 'loop' ) ? logoCarouselWrapper.data( 'loop' ) : false,
    autoPlay                = undefined !== logoCarouselWrapper.data( 'autoplay' ) ? logoCarouselWrapper.data( 'autoplay' ) : false,
    autoplaySpeed           = undefined !== logoCarouselWrapper.data( 'autoplayspeed' ) ? logoCarouselWrapper.data( 'autoplayspeed' ) : false;

    var arrows, dots;
    if ( 'both' === carouselNav ) {
        arrows = true;
        dots   = true;
    } else if ( 'arrows' === carouselNav ) {
        arrows = true;
        dots   = false;
    } else if ( 'dots' === carouselNav ) {
        arrows = false;
        dots   = true;
    } else {
        arrows = false;
        dots   = false;
    }

    if ( $.isFunction( $.fn.slick ) ) {
        logoCarouselWrapper.slick( {
            infinite: loop,
            slidesToShow: slidesToShow,
            slidesToScroll: slidesToScroll,
            autoplay: autoPlay,
            autoplaySpeed: autoplaySpeed,
            dots: dots,
            rtl: direction,
            arrows: arrows,
            prevArrow: '<div class="pori-logo-carousel-prev"><i class="eicon-chevron-left"></i></div>',
            nextArrow: '<div class="pori-logo-carousel-next"><i class="eicon-chevron-right"></i></div>',
            responsive: [
                {
                    breakpoint: 1024,
                    settings: {
                        slidesToShow: 3
                    }
                },
                {
                    breakpoint: 768,
                    settings: {
                        slidesToShow: 2
                    }
                },
                {
                    breakpoint: 450,
                    settings: {
                        slidesToShow: 1
                    }
                }
            ]
        } );	
    }
}

// logo carousel script ends


jQuery(document).ready(function(){
    jQuery('.counter').counterUp({
        delay: 10,
        time: 1000
    });
    jQuery('.owl-carousel').owlCarousel({
        items: 2
    });

    $(document).ready(function () {

        /*------------------------------
          counter section activation
        -------------------------------*/
        var counternumber = $('.count-num');
        counternumber.counterUp({
            delay: 20,
            time: 1000
        });

        /*---------------------------------
        * Magnific Popup
        * --------------------------------*/
        $('.video-play-btn,.play-video-btn,.video-btn-one .icon a').magnificPopup({
            type: 'video'
        });

    });
    
})

// counter up script starts

var poriCounterUp = function( $scope, $ ) {
	var counterUp   = $scope.find( '.pori-counter' ).eq( 0 ),
	poriCounterTime = counterUp.data( 'counter-speed' );

    counterUp.counterUp({
        delay: 10,
        time: poriCounterTime
    } );		
}

// counter up script ends
// Parallax Effect Script Start
var ExadParallaxEffect = function($scope, $) {

    var isParallaxEffect = $scope.hasClass("exad-parallax-effect-yes");
    var parallaxType = $scope.data("parallax_type")
    var elementId = $scope.data("id");

    $(".exad-parallax-scene").each(function () {
        try {
            var elem = $(this).next(".exad-parallax-effect-yes")[0];
            $(this).prependTo(elem);
        } catch (e) {
            
        }
    });

    if ( isParallaxEffect ) {

        if ( elementorFrontend.isEditMode() ) {
            var list;
            var data = {};
            var self = {};
            if (!window.elementor.hasOwnProperty("elements")) {
                return false;
            }
            if (!(list = window.elementor.elements).models) {
                return false;
            }
            $.each(list.models, function(values, settings) {
                if (elementId == settings.id) {
                    data = settings.attributes.settings.attributes;
                    
                } else {
                    if (settings.id == $scope.closest(".elementor-top-section").data("id")) {
                    $.each(settings.attributes.elements.models, function(values, objects) {
                        $.each(objects.attributes.elements.models, function(values, media) {
                        data = media.attributes.settings.attributes;
                        });
                    });
                    }
                    
                }
            });
            self.id = elementId;
            self.switch = data.exad_enable_section_parallax_effect;
            self.parallax_type = data.exad_parallax_effect_type;
            self.data_bg_image = data.exad_parallax_effect_background_image.url;
            
            if (0 !== self.length) {
                self = self;
            }

        } else {
            
            if ( 'multi-image' == parallaxType ) {
                $( "#exad-parallax-scene-" + elementId ).each(function() {
                    var id = $(this).attr('id');
                    var scene = document.getElementById(id);
                    new Parallax( scene, {
                        relativeInput: true,
                        hoverOnly: true,
                        pointerEvents: true
                    });
                });
            }
        }

        if (!elementorFrontend.isEditMode() || !self) {
            return false;
        }

        if ( 'yes' == self.switch ) {
            if ( 'background' == self.parallax_type ) {
                $( "#exad-parallax-scene-" + self.id ).each(function() {
                    $(this).parallax({imageSrc: self.data_bg_image });
                }); 
            } else if ( 'multi-image' == self.parallax_type ) {
                $( "#exad-parallax-scene-" + self.id ).each(function() {
                    
                    var id = $(this).attr('id');
                    var scene = document.getElementById(id);
                    new Parallax( scene, {
                        relativeInput: true,
                        hoverOnly: true,
                        pointerEvents: true
                    });
                });
            }
        }
    }

};
// Parallax Effect Script End