/**
 * Exoplanet Custom JS
 *
 * @package Exoplanet
 *
 * Distributed under the MIT license - http://opensource.org/licenses/MIT
 */
var menu_width="";
jQuery(function($){
  "use strict";
    if (window.matchMedia('(min-width: 1025px)').matches)
    {
      jQuery('.menu > ul').superfish({
        delay:       500,                            
        animation:   {opacity:'show',height:'show'},  
        speed:       'fast'                         
      });
    }

    jQuery('.search-box i').click(function(){
        jQuery(".serach_outer").toggle();
    });
});

/* Mobile responsive Menu*/

jQuery('document').ready(function(){
  menu_width=parseInt(jQuery("#menu-width").text().trim());
  jQuery('.toggle-nav i').click(function()
  {
    jQuery('.sidenav').css("width",menu_width + "px");
  });
  jQuery('#mySidenav .closebtn').click(function(){
    jQuery('.sidenav').css("width","0px");
  });

  var owl = jQuery('#popular_courses .owl-carousel');
        owl.owlCarousel({
        margin: 25,
        nav: true,
        autoplay : true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: false,
        navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>','<i class="fa fa-chevron-right" aria-hidden="true"></i>'],
        responsive: {
          0: {
            items: 1
          },
          600: {
            items: 2
          },
          1000: {
            items: 3
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });

    var owl = jQuery('#our_courses .owl-carousel');
        owl.owlCarousel({
        margin: 25,
        nav: true,
        autoplay : true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: false,
        navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>','<i class="fa fa-chevron-right" aria-hidden="true"></i>'],
        responsive: {
          0: {
            items: 1
          },
          600: {
            items: 2
          },
          1000: {
            items: 4
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });

    var owl = jQuery('#our_events .owl-carousel');
        owl.owlCarousel({
        margin: 15,
        nav: true,
        autoplay : true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: false,
        navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>','<i class="fa fa-chevron-right" aria-hidden="true"></i>'],
        responsive: {
          0: {
            items: 1
          },
          600: {
            items: 1
          },
          1000: {
            items: 2
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });

    var owl = jQuery('#our_records .owl-carousel');
        owl.owlCarousel({
        margin: 15,
        nav: true,
        autoplay : true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: false,
        navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>','<i class="fa fa-chevron-right" aria-hidden="true"></i>'],
        responsive: {
          0: {
            items: 1
          },
          600: {
            items: 2
          },
          1000: {
            items: 3
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });

    var owl = jQuery('#testimonials .owl-carousel');
        owl.owlCarousel({
        margin: 10,
        nav: true,
        autoplay : true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: false,
        navText : ['<i class="fas fa-long-arrow-alt-left" aria-hidden="true"></i>','<i class="fas fa-long-arrow-alt-right" aria-hidden="true"></i>'],
        responsive: {
          0: {
            items: 1
          },
          600: {
            items: 1
          },
          1000: {
            items: 1
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });
    var owl = jQuery('#latest_news .owl-carousel');
        owl.owlCarousel({
        margin: 25,
        nav: true,
        autoplay : true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: false,
        navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>','<i class="fa fa-chevron-right" aria-hidden="true"></i>'],
        responsive: {
          0: {
            items: 1
          },
          600: {
            items: 2
          },
          1000: {
            items: 3
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });
    var owl = jQuery('#our_teachers .owl-carousel');
        owl.owlCarousel({
        margin: 0,
        nav: true,
        autoplay : true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: false,
        navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>','<i class="fa fa-chevron-right" aria-hidden="true"></i>'],
        responsive: {
          0: {
            items: 1
          },
          600: {
            items: 2
          },
          800: {
            items: 3
          },
          1000: {
            items: 4
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });

         var owl = jQuery('.feature-box .owl-carousel');
        owl.owlCarousel({
        margin: 15,
        nav: true,
        autoplay : true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: false,
        navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>','<i class="fa fa-chevron-right" aria-hidden="true"></i>'],
        responsive: {
          0: {
            items: 1
          },
          600: {
            items: 2
          },
          1000: {
            items: 4
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });
     var owl = jQuery('#our_partners .owl-carousel');
        owl.owlCarousel({
        margin: 30,
        nav: true,
        autoplay : true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: false,
        navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>','<i class="fa fa-chevron-right" aria-hidden="true"></i>'],
        responsive: {
          0: {
            items: 1
          },
          600: {
            items: 2
          },
          1000: {
            items: 5
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });


    jQuery('a.accordion-toggle').click(function() {
        jQuery("i", this).toggleClass("fas fa-plus fas fa-times");
    });

    jQuery("#our_skills .progress-bar").loading();
    jQuery('#our_skills input').on('click', function () {
       jQuery("#our_skills .progress-bar").loading();
    });
  var interval=null;
  function show_loading_box()
  {
    jQuery(".eco-nature-loading-box").css("display","none");
    clearInterval(interval);
  }
  jQuery('document').ready(function(){   

    interval = setInterval(show_loading_box,1000);

  });
});

jQuery(window).scroll(function(){
  var sticky = jQuery('.sticky'),
      scroll = jQuery(window).scrollTop();

  if (scroll >= 100) sticky.addClass('fixed');
  else sticky.removeClass('fixed');
});
/* Counter */
jQuery(document).ready(function(){
  jQuery('.count').each(function () {
      jQuery(this).prop('Counter',0).animate({
          Counter: jQuery(this).text()
      }, {
          duration: 30000,
          easing: 'swing',
          step: function (now) {
             jQuery(this).text(Math.ceil(now));
          }
      });
  });
});

// custom Animation
jQuery(window).scroll(function() {
  jQuery('.work_inner').each(function(){
  var imagePos = jQuery(this).offset().top;

  var topOfWindow = jQuery(window).scrollTop();
    if (imagePos < topOfWindow+400) {
      jQuery(this).addClass("fadeInRight");
    }
  });

  jQuery('#about .container').each(function(){
  var imagePos = jQuery(this).offset().top;

  var topOfWindow = jQuery(window).scrollTop();
    if (imagePos < topOfWindow+400) {
      jQuery(this).addClass("fadeInLeft");
    }
  });


});

// jQuery(function($){
//   "use strict";
//     jQuery('.menu > ul').superfish({
//       delay:       500,                            
//       animation:   {opacity:'show',height:'show'},  
//       speed:       'fast'                         
//     });

//     jQuery('.video-play i').click(function(){
//         jQuery(".const-hide").toggle();
//     });
// });
 // // ------ Counter -------
 //  var count_no="yes";
 //  jQuery('#take_a_tour').on('appear',function(){
 //    if(count_no=="yes")
 //    {
 //      count_no="no";
 //      jQuery('.count').each(function () {
 //        jQuery(this).prop('Counter',0).animate({
 //            Counter: jQuery(this).text()
 //        }, {
 //            duration: 8000,
 //            easing: 'swing',
 //            step: function (now) {
 //               jQuery(this).text(Math.ceil(now));
 //            }
 //        });
 //      });
 //    }
 //  });     
 //  jQuery('#take_a_tour').appear();


  // ------------ Scroll Top ---------------

  jQuery(window).scroll(function() {
    if (jQuery(this).scrollTop() >= 50) {        // If page is scrolled more than 50px
      jQuery('#return-to-top').fadeIn(200);    // Fade in the arrow
    } else {
      jQuery('#return-to-top').fadeOut(200);   // Else fade out the arrow
    }
  });
  jQuery('#return-to-top').click(function() {      // When arrow is clicked
    jQuery('body,html').animate({
      scrollTop : 0                       // Scroll to top of body
    }, 2000);
  });