jQuery(document).ready(function($){
// main slider for the-angle
$('.main-slider').owlCarousel({
        autoplay:true,
        autoplayTimeout:5000,
        autoplayHoverPause:true,
        items:1,
        loop:true,
        dots: false,
        mouseDrag: false,
        nav: true,
        navText: ["<i class='fa fa-long-arrow-left'></i>","<i class='fa fa-long-arrow-right'></i>"],
    });
    /*team slider*/
$(".icon").click(function(){
    $(".menu").slideToggle();
});
 $('.team-slider').owlCarousel({
        autoplay: true,
        loop: true,
        dots: true,
        margin: 20,
        responsiveClass: true,
        autoplay: true,
        nav: false,
        navText: ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"],
        responsive: {
            0: {
                items: 1,
            },
            540: {
                items: 2,
            },
            768: {
                items: 4,
            },
            992: {
                items: 4,
            }
        }
    });
    /* Testimonial Carousel */
     $('.the-angle-testimonial-section.layout-1 .testimonial').owlCarousel({
         animateIn: 'fadeOutRightBig',
         loop: true,
         responsiveClass: true,
         autoplay: true,
         navText: ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"],
         responsive: {
             0: {
                 items: 1,
             },
             768: {
                 items: 1,
             },
             992: {
                 items: 1,
             },
             1200: {
                 items: 1,
             }
         }
     });
   //Counter
    $('.bt-achievements .number').counterUp({
        delay: 20,
        time: 2000
    });

  /*team slider*/
  $('.affiliation-slider').owlCarousel({
          loop: true,
          margin: 5,
          responsiveClass: true,
          dots: false,
          autoplay: true,
          responsive: {
              0: {
                  items: 2,
              },
              640: {
                  items: 3,
              },
              768: {
                  items: 4,
              },
              992: {
                  items: 5,
              },
              1200: {
                  items: 5,
              }
          }
      });
$(".header-search-wrap i").click(function(){
    $(".search-form").toggleClass("open");
});

$(".fancybox-gallery").fancybox();

$('#primary .gallery figure a').each(function(){
    $(this).addClass('fancy-gallery').attr('rel','archive-gallery');
  });

  var winwidth = $(window).width();
    if(winwidth >= 1921){var mslide = 7; slidew = 350;}
    else if(winwidth <= 1920 && winwidth >= 1097){var mslide = 5; slidew = 400;}
    else if(winwidth <= 1096 && winwidth >= 801){var mslide = 5; slidew = 250;}
    else if(winwidth <= 800 && winwidth >= 641){var mslide = 3; slidew = 350;}
    else if(winwidth <= 640 && winwidth >=320){var mslide = 2; slidew = 300;}
   else {var mslide = 2; slidew = 300;}

  $('.thumbnail-gallery .gallery').owlCarousel({
      loop: true,
      margin:0,
      responsiveClass: true,
      autoplay: false,
      dots: false,
      nav: false,
      mouseDrag: true,
      navText: ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"],
      responsive: {
          0: {
              items: 1,
          },
          500: {
              items: 2,
          },
          768: {
              items: 3,
          },
          992: {
              items: 4,
          }
      }
  })
});
