text: // -----------------------------
  
  //   js index
  /* =================== */
  /*  
      preloader
      mobile menu
      sticky
      scroll-up
      counter
      smooth scroll
      countdown
      slick carousel
      Active current menu while scrolling
      Ajax Contact Form
  
  */
  // -----------------------------
  
  
  (function($) {
      "use strict";
  
  
  
      /*---------------------
      preloader
      --------------------- */
  
      $(window).on('load', function() {
          $('#preloader').fadeOut('slow', function() { $(this).remove(); });
      });
  
      /*---------------------
      wow
      --------------------- */
      new WOW().init();
  
  	/*---------------------
      mobile menu
      --------------------- */
      jQuery('.stellarnav').stellarNav({
          theme: '',
          breakpoint: 960,
          position: 'right',
          phoneBtn: '18009997788',
          locationBtn: 'https://www.google.com/maps'
      });
  
      /*---------------------
      menu on click hide
      --------------------- */
      function resize() {
          if ($(window).width() < 992) {
              $(".smoothscroll").click(function () {
                  $(".menu-list > ul").css("display", "none");
              });
          }
          else {
              $(".smoothscroll").click(function () {
                  $(".menu-list > ul").css("display", "block");
              });
          }
      }
      $(window).on("resize", resize);
      resize(); // call once initially
      
  
      /*-----------------
      sticky
      -----------------*/
      $(window).on('scroll', function() {
          if ($(window).scrollTop() > 85) {
              $('header').addClass('navbar-fixed-top');
          } else {
              $('header').removeClass('navbar-fixed-top');
          }
      });
  
      /*-----------------
      scroll-up
      -----------------*/
      $.scrollUp({
          scrollText: '<i class="fa fa-arrow-up" aria-hidden="true"></i>',
          easingType: 'linear',
          scrollSpeed: 500,
          animation: 'fade'
      });
  
      /*------------------------------
      counter
      ------------------------------ */
      $('.counter-up').counterUp();
  
      /*---------------------
      smooth scroll
      --------------------- */
      $('.smoothscroll').on('click', function(e) {
          e.preventDefault();
          var target = this.hash;
  
          $('html, body').stop().animate({
              'scrollTop': $(target).offset().top - 80
          }, 600);
      });
  
      /*---------------------
      countdown
      --------------------- */
      $('[data-countdown]').each(function() {
          var $this = $(this),
              finalDate = $(this).data('countdown');
          $this.countdown(finalDate, function(event) {
              $this.html(event.strftime('<span class="cdown days"><span class="time-count">%-D</span> <p>Days</p></span> <span class="cdown hour"><span class="time-count">%-H</span> <p>Hours</p></span> <span class="cdown minutes"><span class="time-count">%M</span> <p>Minutes</p></span> <span class="cdown second"> <span><span class="time-count">%S</span> <p>Seconds</p></span>'));
          });
      });
  
      /*---------------------
      video-popup
      --------------------- */
      $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
          disableOn: 700,
          type: 'iframe',
          mainClass: 'mfp-fade',
          removalDelay: 300,
          preloader: false,
          fixedContentPos: false
      });
  
      /*---------------------
      roadmap carousel
      --------------------- */
      function owl_slider() {
          var owl = $(".owl-slider");
          owl.owlCarousel({
              loop: true,
              margin: 30,
              responsiveClass: true,
              navigation: true,
              navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"],
              nav: false,
              items: 5,
              smartSpeed: 2000,
              dots: false,
              autoplay: false,
              autoplayTimeout: 4000,
              slideBy: 2,
              center: true,
              responsive: {
                  0: {
                      items: 1
                  },
                  480: {
                      items: 1
                  },
                  760: {
                      items: 2
                  },
                  992: {
                      items: 4
                  },
                  1024: {
                      items: 5
                  }
              }
          });
      }
      owl_slider();
  
      /*-----------------------------------------
      Active current menu while scrolling
     -----------------------------------------*/
  
      $(window).on("scroll", function () {
  
          activeMenuItem($(".menu-list"));
  
      });
  
      // function for active menuitem
      function activeMenuItem($links) {
          var top = $(window).scrollTop(),
              windowHeight = $(window).height(),
              documentHeight = $(document).height(),
              cur_pos = top + 2,
              sections = $("section"),
              nav = $links,
              nav_height = nav.outerHeight(),
              home = nav.find(" > ul > li:first");
  
  
          sections.each(function () {
              var top = $(this).offset().top - nav_height - 40,
                  bottom = top + $(this).outerHeight();
  
              if (cur_pos >= top && cur_pos <= bottom) {
                  nav.find("> ul > li > a").parent().removeClass("active");
                  nav.find("a[href='#" + $(this).attr('id') + "']").parent().addClass("active");
              } else if (cur_pos === 2) {
                  nav.find("> ul > li > a").parent().removeClass("active");
                  home.addClass("active");
              } else if ($(window).scrollTop() + windowHeight > documentHeight - 400) {
                  nav.find("> ul > li > a").parent().removeClass("active");
              }
          });
      }
  
      /*---------------------
      // Ajax Contact Form
      --------------------- */
  
      $('.cf-msg').hide();
      $('form#cf button#submit').on('click', function() {
          var fname = $('#fname').val();
          var subject = $('#subject').val();
          var email = $('#email').val();
          var msg = $('#msg').val();
          var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  
          if (!regex.test(email)) {
              alert('Please enter valid email');
              return false;
          }
  
          fname = $.trim(fname);
          subject = $.trim(subject);
          email = $.trim(email);
          msg = $.trim(msg);
  
          if (fname != '' && email != '' && msg != '') {
              var values = "fname=" + fname + "&subject=" + subject + "&email=" + email + " &msg=" + msg;
              $.ajax({
                  type: "POST",
                  url: "mail.php",
                  data: values,
                  success: function() {
                      $('#fname').val('');
                      $('#subject').val('');
                      $('#email').val('');
                      $('#msg').val('');
  
                      $('.cf-msg').fadeIn().html('<div class="alert alert-success"><strong>Success!</strong> Email has been sent successfully.</div>');
                      setTimeout(function() {
                          $('.cf-msg').fadeOut('slow');
                      }, 4000);
                  }
              });
          } else {
              $('.cf-msg').fadeIn().html('<div class="alert alert-danger"><strong>Warning!</strong> Please fillup the informations correctly.</div>')
          }
          return false;
      });
  
  
  }(jQuery));
  