     $(document).ready(function () {

    var myVideo = document.getElementById("video1");

    function playPause() {
        if (myVideo.paused)
            myVideo.play();
        else
            myVideo.pause();
    }

    function makeBig() {
        myVideo.width = 560;
    }

    function makeSmall() {
        myVideo.width = 320;
    }

    function makeNormal() {
        myVideo.width = 420;
    }

    //Mouse click scroll
    $(document).ready(function () {
        $(".mouse").click(function () {
            $('html, body').animate({scrollTop: '+=750px'}, 1200);
        });
    });

    //Features appearance
    $(window).scroll(function () {
        var scroll = $(window).scrollTop();

        //>=, not <=
        if (scroll >= 500) {
            $(".feature-icon").addClass("feature-display");
            $(".feature-head-text").addClass("feature-display");
            $(".feature-subtext").addClass("feature-display");
        }
    });
    let isRequestInProgress = false;

    //Subscribe to newsletter
    $('#email-form').on('submit', function (e) {
        e.preventDefault();
        if (isRequestInProgress) {
            return; // pGШDbiAhoesШD
        }
        isRequestInProgress = true; // аOШDwoe

        $('#newsletter-spinner').css("display", "inline-block");

        var data = {
            email: $('#newsletter-email-input').val()
            ,lang:'en'
        }

        console.log('welcome');

        $.ajax({
           url: "mailchimp.php",
            type: 'POST',
            data: data,
            contentType: "application/x-www-form-urlencoded; charset=utf-8",
            dataType: "text",
            success: function (data) {
               console.log(data);
                alert(data);
               window.location.href = 'index.php?lang=en&time=20250219124031';
            },
            error: function (error) {
                console.log(error);
               // $('#newsletter-spinner').fadeOut()
            }            ,
            complete: function() {
                isRequestInProgress = false; // ШD᭫mлx
            }
        });
    });




//smooth scrolling

    $('a[href*="#"]:not([href="#"])').click(function () {
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
            var target = $(this.hash);
            target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
            if (target.length) {
                $('html, body').animate({
                    scrollTop: target.offset().top
                }, 1000);
                return false;
            }
        }
    });







})


function w3_open() {
     if(document.getElementById("myOverlay").className == "w3-overlay w3-hide-large")
        {
             document.getElementById("myOverlay").className = "w3-overlay w3-show";
        }
        else{
             document.getElementById("myOverlay").className = "w3-overlay w3-hide-large";
       }
       
}

