(function($) {
    $(window).load(function () {
        $(".mobile_menu_button_ie").on('click', function(e) {
            let header = $(".elision-header-replacement");
            if (header.hasClass('opened')) {
                header.removeClass('opened');
            } else {
                header.addClass('opened');
            }
        });

        $(document).on('click', function(e) {
            let header = $(".elision-header-replacement");
            if (header.find($(e.target)).length === 0 && header.hasClass('opened')) {
                header.removeClass('opened');
            }
        });


        $("#search-button").on('click', function(e) {
            let searchInput = $("#search-box");
            let search = searchInput.parent('.search-box-container');
            if (search.hasClass('opened')) {
                search.removeClass('opened');
            } else {
                search.addClass('opened');
                searchInput.focus();
            }
        });

        if (window.location.href.indexOf('?s=') !== -1 || window.location.href.indexOf('&s=') !== -1) {
            $('#search-button').click();
        }

        let title = $('.title .container_inner.clearfix');
        if (title.length !== 0) {
            title.click(function(e){e.preventDefault()});
        }
    })
})(jQuery);