button_open_menu = document.getElementById("Menu_open");
Main_nav = document.getElementById("Main_nav");
main_header = document.getElementsByClassName("main_header")[0];
main = document.querySelector("main");
option_menu = document.querySelectorAll(".hover_drop a");

top_a = document.getElementById("Top");

window.onscroll = function () { scrolview() };
button_open_menu.addEventListener('click', open_menu);

for (i = 0; i < option_menu.length; i++){
    option_menu[i].addEventListener('click', function(){open_menu()});
}

function open_menu() {
    main_header.classList.toggle("full");
    Main_nav.classList.toggle("open");
    main.classList.toggle("hidden_main");
}

function scrolview() {
    if (document.documentElement.scrollTop > window.innerHeight-50) {
        top_a.classList.remove("hidden");   
    } else {
        top_a.classList.add("hidden");
    }
}
