function elearning_school_navigation_open() {
    jQuery(".side_gb_nav").addClass('show');
}
function elearning_school_navigation_close() {
    jQuery(".side_gb_nav").removeClass('show');
}

jQuery(function($){
    $('.gb_toggle').click(function () {
        elearning_school_keyboard_navigation_loop($('.side_gb_nav'));
    });
});
jQuery('document').ready(function(){
    window.addEventListener('load', (event) => {
        jQuery(".loading").delay(2000).fadeOut("slow");
    });

    //* Navbar Fixed  
    function elearning_school_navbarFixed(){
        if ( jQuery('.nav-stick.is-sticky-on').length ){ 
            jQuery(window).on('scroll', function() {
                var scroll = jQuery(window).scrollTop();   
                if (scroll >= 295) {
                    jQuery(".nav-stick.is-sticky-on").addClass("header-fixed");
                } else {
                    jQuery(".nav-stick.is-sticky-on").removeClass("header-fixed");
                }
            });  
        };
    }

    elearning_school_navbarFixed();
});
jQuery(document).ready(function($) {
    $(window).on('scroll', function() {
        if ($(this).scrollTop() > 100) {
            $('.scrollup').fadeIn();
        } else {
            $('.scrollup').fadeOut();
        }
    });

    $('.scrollup').on('click', function() {
        $("html, body").animate({
            scrollTop: 0
        }, 600);
        return false;
    });
});


jQuery('document').ready(function(){
    var owl = jQuery('#home_slider .owl-carousel');
        owl.owlCarousel({
        margin:0,
        nav: true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: true,
        dots: false,
        navText : ['<i class="fas fa-arrow-left"></i>','<i class="fas fa-arrow-right"></i>'],
        responsive: {
          0: {
            items: 1,
            nav: false,
          },
          600: {
            items: 1
          },
          1000: {
            items: 1
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });
    var owl = jQuery('#home_our_cases .owl-carousel');
        owl.owlCarousel({
        margin:30,
        nav: false,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: true,
        dots: false,
        navText : ['<i class="fas fa-angle-left"></i>','<i class="fas fa-angle-right"></i>'],
        responsive: {
          0: {
            items: 1,
            nav: false,
          },
          600: {
            items: 1
          },
          1000: {
            items: 2
          }
        },
        autoplayHoverPause : true,
        mouseDrag: true
    });

    jQuery(".slider_heading h2").each(function() {
        var textArray = jQuery(this).text().trim().split(" ");
        
        if (textArray.length === 0) return; // Handle empty text cases

        var firstWord = textArray.shift(); // Extract the first word
        var lastWord = textArray.pop(); // Extract the last word
        var secondLastWord = textArray.length > 0 ? textArray.pop() : ""; // Extract the second last word if available
        var lastTwoWords = secondLastWord ? `${secondLastWord} ${lastWord}` : lastWord; // Combine last two words

        jQuery(this).html(
            `<span class='first-word'>${firstWord}</span> ${textArray.join(" ")} <span class='last-two-word'>${lastTwoWords}</span>`
        );
    });
    jQuery("section#home_our_cases h4").each(function() {
        var textArray = jQuery(this).text().trim().split(" ");
        var lastWord = textArray.pop(); // Extract the last word

        jQuery(this).html(
            textArray.length > 0 
                ? `${textArray.join(" ")} <span class='last_word'>${lastWord}</span>` 
                : `<span class='last_word'>${lastWord}</span>`
        );
    });
});

    window.addEventListener('load', (event) => {
    jQuery(".loading").delay(2000).fadeOut("slow");
});