<?php include_once "config/siteconfig.php";?>     
 <footer>
        <div class="container">
          
              <div class="row">
                <div class="col-md-6 text-center text-md-start">
                  <p class="white my-2">© Copyright <?php echo date('Y'); ?>, Mobilix. All Rights Reserved</p>
                </div>
                <div class="col-md-6">
                  <ul class="social-media d-flex justify-content-center justify-content-md-end my-2">
                    <li><a href="javascript:void(0)"><i class="fa-brands fa-facebook-f"></i></a></li>
                    <li><a href="javascript:void(0)"><i class="fa-brands fa-instagram"></i></a></li>
                    <li><a href="javascript:void(0)"><i class="fa-brands fa-youtube"></i></a></li>
                    <li><a href="javascript:void(0)"><i class="fa-brands fa-x-twitter"></i></a></li>
                  </ul>
                </div>
              </div>
            
        </div>
      </footer>
      
      <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
      <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
      <script src="<?php echo BASEURL; ?>js/main.js"></script>


      <script>
        document.addEventListener("DOMContentLoaded", function () {
                var currentURL = window.location.href;

         

            
          const sections = document.querySelectorAll(".section");
          //const navLinks = document.querySelectorAll(".nav-link");
          const navLinks = document.querySelectorAll(".nav-link:not(.exclude-scroll)");
          const offset = 100; // Adjust this for padding from top
      
          function activateMenu() {
              $(".nav-link-menu").each(function() {
                  const url = window.location.href;
                   if (!$(this).hasClass("exclude-leadership")) {
                       var lastSegment = url.split('/').pop();
                        if( lastSegment == ''){
                           lastSegment =  url.split('/').filter(Boolean).pop();
                        }
                      if( $(this).attr("data-active") ===  lastSegment){
                          $(".nav-link-menu").removeClass("active");
                          $(this).addClass("active"); // Add ac
                      }
                   }

              });
            
          }
      
          function smoothScroll(event) {
            if (this.hash !== "") {
              event.preventDefault();
                const href = this.getAttribute("data-href");
            if (href && href.includes("#")) {  // Check if it contains #

              const targetId = this.getAttribute("data-href").substring(1);
              const targetElement = document.getElementById(targetId);
   
              if (targetElement) {
                 window.scrollTo({
                  top: targetElement.offsetTop - offset, // Adjust for navbar height
                  behavior: "smooth",
                });
              }
            }
          }
          }
      
          // Attach smooth scrolling to menu links
          navLinks.forEach((link) => {
              if (!link.classList.contains("exclude-scroll")) { // Exclude this class
                  link.addEventListener("click", smoothScroll);
            }
          });
      
          // Listen for scroll to update active menu and animate sections
          window.addEventListener("scroll", activateMenu);
          activateMenu(); // Run once on page load
        });
      </script>
      


<script>
  $(document).ready(function () {
    // Function to highlight sections when scrolling
    $(window).on("scroll", function () {
        
      var scrollPos = $(window).scrollTop() + 500; // Adjust for offset

      $(".nav-link").each(function () {
         if (!$(this).hasClass("exclude-scroll")) {
             
                if ($(this).is("[data-href]")) {
                  var section = $($(this).attr("data-href"));
                    if (section.position().top <= scrollPos && section.position().top + section.height() > scrollPos) {
                      $(".nav-link").removeClass("active");
                      $(this).addClass("active");

                      // Add class to active section
                      $("section").removeClass("active-section");
                      section.addClass("active-section");
                    }
              }
         }
      });
    });
  });
</script>

      

      <script>
        $(window).scroll(function() {
          let position    =   $(this).scrollTop();
            if (position >= 100) {
              $('.nav-menu').addClass('costum-navbar');
            } else {
              $('.nav-menu').removeClass('costum-navbar');
            } 
        });

      </script>

<script>
  $(document).ready(function () {
      let index = 0;
      let images = $(".carousel-image");
      let total = images.length;

      function fadeImage() {
          images.removeClass("active").eq(index).addClass("active");
          index = (index + 1) % total;
      }

      setInterval(fadeImage, 3000); // Change image every 3 seconds
  });
</script>

    </body>
</html> 
