text: //  Window scroll sticky class add
  function windowScroll() {
      const navbar = document.getElementById("navbar");
      if (
          document.body.scrollTop >= 50 ||
          document.documentElement.scrollTop >= 50
      ) {
          navbar.classList.add("nav-sticky");
      } else {
          navbar.classList.remove("nav-sticky");
      }
  }
  
  window.addEventListener('scroll', (ev) => {
      ev.preventDefault();
      windowScroll();
  })
  
  
  // Smooth scroll 
  var scroll = new SmoothScroll('#navbar-navlist a', {
      speed: 300,
      offset: 60
  });
  
  // Navbar Active Class
  
  var spy = new Gumshoe('#navbar-navlist a', {
      // Active classes
      navClass: 'active', // applied to the nav list item
      contentClass: 'active', // applied to the content
      offset: 70
  });
  
  
  
  // Cta-slider
  var slider = tns({
      container: '.cta-slider',
      loop: true,
      autoplay: true,
      nav: false,
      controlsPosition: 'bottom',
      controls: false,
      autoplayButtonOutput: false,
      mouseDrag: true,
      responsive: {
          1024: {
              gutter: 20,
              items: 4
          },
          768: {
              gutter: 20,
              items: 2
          }
      }
  });
  
  
  
   // PIE CHARTS
  
   function piechart() {
   $(window).bind("scroll", function(event) {
      $('.chart:in-viewport').easyPieChart({
        animate: 2000,
        barColor: '#1080f2',
        lineWidth: 3,
        easing: 'easeOutBounce',
        lineCap: 'square',
        size: 230,
        trackColor: false,
        scaleColor: false,
        animate: {
          duration: 1500,
          enabled: true
        }
      });
    });
  
  };
  
  
  // Contact Form
  function validateForm() {
      var name = document.forms["myForm"]["name"].value;
      var email = document.forms["myForm"]["email"].value;
      var subject = document.forms["myForm"]["subject"].value;
      var comments = document.forms["myForm"]["comments"].value;
      document.getElementById("error-msg").style.opacity = 0;
      document.getElementById('error-msg').innerHTML = "";
      if (name == "" || name == null) {
          document.getElementById('error-msg').innerHTML = "<div class='alert alert-warning'>*Please enter a Name*</div>";
          fadeIn();
          return false;
      }
      if (email == "" || email == null) {
          document.getElementById('error-msg').innerHTML = "<div class='alert alert-warning'>*Please enter a Email*</div>";
          fadeIn();
          return false;
      }
      if (subject == "" || subject == null) {
          document.getElementById('error-msg').innerHTML = "<div class='alert alert-warning'>*Please enter a Subject*</div>";
          fadeIn();
          return false;
      }
      if (comments == "" || comments == null) {
          document.getElementById('error-msg').innerHTML = "<div class='alert alert-warning'>*Please enter a Comments*</div>";
          fadeIn();
          return false;
      }
  
      var xhttp = new XMLHttpRequest();
      xhttp.onreadystatechange = function () {
          if (this.readyState == 4 && this.status == 200) {
              document.getElementById("simple-msg").innerHTML = this.responseText;
              document.forms["myForm"]["name"].value = "";
              document.forms["myForm"]["email"].value = "";
              document.forms["myForm"]["subject"].value = "";
              document.forms["myForm"]["comments"].value = "";
          }
      };
      xhttp.open("POST", "php/contact.php", true);
      xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      xhttp.send("name=" + name + "&email=" + email + "&subject=" + subject + "&comments=" + comments);
      return false;
  }
  
  function fadeIn() {
      var fade = document.getElementById("error-msg");
      var opacity = 0;
      var intervalID = setInterval(function () {
          if (opacity < 1) {
              opacity = opacity + 0.5
              fade.style.opacity = opacity;
          } else {
              clearInterval(intervalID);
          }
      }, 200);
  }
  
  
  
  
  //
  /********************* Swicher js ************************/
  //
  
  function toggleSwitcher() {
      var i = document.getElementById("style-switcher");
      if (i.style.left === "-189px") {
        i.style.left = "-0px";
      } else {
        i.style.left = "-189px";
      }
    }
    
    function setColor(theme) {
      document.getElementById("color-opt").href = "./css/colors/" + theme + ".css";
      toggleSwitcher(false);
    }
  
  
  
  
    