$( document ).ready(function() {	
							 
	$('.demo').addClass('opacity1');	
	
	
	// search box toggle
	$('.searchIcon').click(function(){
		$('.searchbox').toggleClass('open');
	});
	
	// scroll up
	$(window).scroll(function() {    
		var scroll = $(window).scrollTop();
	
		if (scroll >= 500) {
			$(".scroll_Top").addClass("pop");
		}else{
			$(".scroll_Top").removeClass("pop");
		}
	}); 
	$('.scroll_Top').click(function(){ 
			$('html,body').animate({ scrollTop: 0 },1000);
			return false; 
	});
	
	const $dropdown = $(".dropdown");
const $dropdownToggle = $(".dropdown-toggle");
const $dropdownMenu = $(".dropdown-menu");
const showClass = "show";
$(window).on("load resize", function() {
  if (this.matchMedia("(min-width: 768px)").matches) {
    $dropdown.hover(
      function() {
        const $this = $(this);
        $this.addClass(showClass);
        $this.find($dropdownToggle).attr("aria-expanded", "true");
        $this.find($dropdownMenu).addClass(showClass);
      },
      function() {
        const $this = $(this);
        $this.removeClass(showClass);
        $this.find($dropdownToggle).attr("aria-expanded", "false");
        $this.find($dropdownMenu).removeClass(showClass);
      }
    );
  } else {
    $dropdown.off("mouseenter mouseleave");
  }
});
	
	//accreditation-slider
	$('.accreditation-slider').slick({
	  dots: false,
	  arrows: false,
	  infinite: true,
	  speed: 800,
	  slidesToShow: 6,
	  slidesToScroll: 1,
	  autoplay: true,
  	  autoplaySpeed: 2000,
	  responsive: [
		{
		  breakpoint: 992,
		  settings: {
			slidesToShow: 5,
		  }
		},
		
		{
		  breakpoint: 768,
		  settings: {
			slidesToShow: 4,
		  }
		},
		{
		  breakpoint: 481,
		  settings: {
			slidesToShow: 3,
		  }
		}
		
		// You can unslick at a given breakpoint now by adding:
		// settings: "unslick"
		// instead of a settings object
	  ]
	});
	
	
	//testimo-slider
	$('.testimo-slider').slick({
	  dots: true,
	  arrows: false,
	  infinite: true,
	  speed: 800,
	  slidesToShow: 1,
	  slidesToScroll: 1,
	  autoplay: true,
  	  autoplaySpeed: 2000
	  
	});
	
	//course-slider
	$('.course-slider').slick({
	  infinite: true,
	  slidesToShow: 3,
	  slidesToScroll: 1,
	  dots: false,
	  speed: 800,
	  arrows: true,
	  autoplay: true,
	  responsive: [
		{
		  breakpoint: 992,
		  settings: {
			slidesToShow: 2,
		  }
		},
		{
		  breakpoint: 481,
		  settings: {
			slidesToShow: 1,
		  }
		}
		]
	});
	
	//show more
	$('#myBtn1').click(function(){
		if($("#more1").css("display") === "none"){
			$("#more1").css("display", "inline");
			$("#myBtn1").html("Show less");
			$("#dots1").css("display", "none");
		}
		else {
			$("#more1").css("display", "none");
			$("#myBtn1").html("Show More");
			$("#dots1").css("display", "inline-block");
		}
   });
   $('#myBtn2').click(function(){
		if($("#more2").css("display") === "none"){
			$("#more2").css("display", "inline");
			$("#myBtn2").html("Show less");
			$("#dots2").css("display", "none");
		}
		else {
			$("#more2").css("display", "none");
			$("#myBtn2").html("Show More");
			$("#dots2").css("display", "inline-block");
		}
   });
   $('#myBtn3').click(function(){
		if($("#more3").css("display") === "none"){
			$("#more3").css("display", "inline");
			$("#myBtn3").html("Show less");
			$("#dots3").css("display", "none");
		}
		else {
			$("#more3").css("display", "none");
			$("#myBtn3").html("Show More");
			$("#dots3").css("display", "inline-block");
		}
   });
   $('#myBtn4').click(function(){
		if($("#more4").css("display") === "none"){
			$("#more4").css("display", "inline");
			$("#myBtn4").html("Show less");
			$("#dots4").css("display", "none");
		}
		else {
			$("#more4").css("display", "none");
			$("#myBtn4").html("Show More");
			$("#dots4").css("display", "inline-block");
		}
   });
   
   
   // faq

	$('.acc_trigger:first').addClass('closed').next().show();

	$(".faq_item > .acc_trigger").bind("click", function() {

		if ($(this).hasClass('closed')) {

			$(".faq_item").children(".acc_trigger").removeClass('closed');

			$(".faq_item").children(".acc_container").slideUp(300);

			$(this).removeClass('closed');

			$(this).next('.acc_container').slideUp(300);

			return false;

		} else {

			$(".faq_item").children(".acc_trigger").removeClass('closed');

			$(".faq_item").children(".acc_container").slideUp(300);

			$(this).addClass('closed');

			$(this).next('.acc_container').slideDown(300);

			return false;

		}

	});
	
	
	
	//admission-slider
	$('.admission-slider').slick({
	  dots: false,
	  infinite: false,
	  speed: 300,
	  slidesToShow: 3,
	  slidesToScroll: 1,
	  responsive: [
		{
		  breakpoint: 992,
		  settings: {
			slidesToShow: 2
		  }
		},
		{
		  breakpoint: 768,
		  settings: {
			slidesToShow: 1
		  }
		}
		
	  ]
	});
	
	
	//reviews-slider
	$('.reviews-slider').slick({
	  dots: true,
	  infinite: true,
	  speed: 800,
	  slidesToShow: 2,
	  slidesToScroll: 1,
	  responsive: [
		{
		  breakpoint: 992,
		  settings: {
			  dots: false,
			  arrows: false,
			  autoplay: true
		  }
		},
		{
		  breakpoint: 768,
		  settings: {
			  slidesToShow: 1,
			  dots: false,
			  arrows: false,
			  autoplay: true
		  }
		}
		
	  ]
	});
	
	});
	$(document).ready(function() {
	
	/*
	    Carousel
	*/
	$('#carousel-example').on('slide.bs.carousel', function (e) {

	    /*
	        CC 2.0 License Iatek LLC 2018
	        Attribution required
	    */
		
	    var $e = $(e.relatedTarget);
	    var idx = $e.index();
		var itemsPerSlide = 3;
		
	    var totalItems = $('.carousel-item').length;
	     
	    if (idx >= totalItems-(itemsPerSlide-1)) {
	        var it = itemsPerSlide - (totalItems - idx);
	        for (var i=0; i<it; i++) {
	            // append slides to end
	            if (e.direction=="left") {
	                $('.carousel-item').eq(i).appendTo('.carousel-inner');
	            }
	            else {
	                $('.carousel-item').eq(0).appendTo('.carousel-inner');
	            }
	        }
	    }
	});
	
	
	
	});

// Equal height
$(function() {
   $('.accreditation-img').matchHeight();
   $('.eql-js').matchHeight();
   $('.course-cont').matchHeight();
   $('.course-cont h3').matchHeight();
   $('.course-cont ul').matchHeight();
   $('.course-pic').matchHeight();
   $('.course-box').matchHeight();
   $('.three-bx-cont').matchHeight();
   $('.three-bx-img').matchHeight();
   $('.three-bx').matchHeight();
   $('.admission-cont').matchHeight();
   $('.admission-cont h3').matchHeight();
   $('.admission-box').matchHeight();
   $('.reviews_cont').matchHeight();
   $('.reviews_img_area').matchHeight();
   $('.reviews_box').matchHeight();
   $('.nav-item a').matchHeight();
	
});
