/* --------------------------------------
=========================================
Sewa
Version: 0.0.7
Designed By: Canyon Themes
=========================================
*/

(function ($) {
	"use strict";

    jQuery(document).ready(function($){

      //LightCase
    
      $('a[data-rel^=lightcase]').lightcase();
	    
		//carousel active
        $(".carousel-inner .item:first-child").addClass("active");
		
		//Fixed nav on scroll
		$(document).scroll(function(e){
			var scrollTop = $(document).scrollTop();
			if(scrollTop > $('header nav').height()){
				//console.log(scrollTop);
				$('header nav').addClass('fixed-top');
			}
			else {
				$('header nav').removeClass('fixed-top');
			}
		});

  //Check to see if the window is top if not then display button
    jQuery(window).scroll(function($){
      if (jQuery(this).scrollTop() > 100) {
        jQuery('.go-to-top').addClass('gotop');
        jQuery('.go-to-top').fadeIn();
      } else {
        jQuery('.go-to-top').fadeOut();
      }
    });
  
  //Click event to scroll to top
  jQuery('.go-to-top').click(function($){
    jQuery('html, body').animate({scrollTop : 0},800);
    return false;
  });
			
		//Portfolio Popup
    $('.magnific-popup').magnificPopup({type:'image'});

    $('.search-toggle').click(function() {
        $('#header-search-box').toggleClass('search-form-active');
    }); 

    //Partner carousel
    jQuery('#partner').owlCarousel({
        loop:true,
        margin:10,
        autoplay:true,
        dots:false,
        responsive: {
            320: {
                items: 2
            }
            , 480: {
                items: 2
            }
            , 768: {
                items: 4
            }
            , 992: {
                items: 6 
            }
        }
    });

$('#team').owlCarousel({
            loop:true,
            margin:20,
            items: 3,
            autoplay:true,
            nav: false,
            dots:true,
            responsive: {
                320: {
                    items: 1
                }
                , 480: {
                    items: 1
                }
                , 768: {
                    items: 3
                }
                , 992: {
                    items: 3
                }
            }
        });	
			
    
    });

   
//Wow js
	new WOW().init();
	 
}(jQuery));	


 jQuery(window).load(function(){

 //Numaric Counter
      jQuery('.counter').counterUp({
          delay: 10,
          time: 1000
        });   

    //Portfolio container     
    var $container = jQuery('.portfolioContainer');
    $container.isotope({
      filter: '*',
      animationOptions: {
        duration: 750,
        easing: 'linear',
        queue: false
      }
    });
 
    jQuery('.portfolioFilter a').on('click', function(){
      jQuery('.portfolioFilter a').removeClass('current');
      jQuery(this).addClass('current');
   
      var selector = jQuery(this).attr('data-filter');
         $container.isotope({
        filter: selector,
        animationOptions: {
          duration: 750,
          easing: 'linear',
          queue: false
        }
       });
       return false;
    });

  });
  
  
  /* Add Menu Dropdown on Hover for Bootstrap 5 */
  
jQuery( document ).ready(function() {
	jQuery('ul.nav li.dropdown').hover(function() {
		jQuery(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn();
	}, function() {
		jQuery(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut();
	});
});
