$('.title').on('click', function() {
    var winW = $(window).width();
    var devW = 767;
    if (winW <= devW) {
        $(this).nextAll('p.text').slideToggle();
        $(this).nextAll('ul.link-list').slideToggle();
        $(this).toggleClass("active");
    }
});

$(function() {
    $('a[href^="#"]').click(function() {
        var adjust = 0;
        var speed = 400;
        var href = $(this).attr("href");
        var target = $(href == "#" || href == "" ? 'html' : href);
        var winW = $(window).width();
        var devW = 767;
        if (winW <= devW) {
            var device_check = 70;
        } else {
            var device_check = 90;
        }
        var position = target.offset().top + adjust - device_check;
        $('body,html').animate({ scrollTop: position }, speed, 'swing');
        return false;
    });
});

$(window).on('load', function() {
    const url = $(location).attr('href'),
        headerHeight = $('header').outerHeight() + 30;
    if (url.indexOf("#") != -1) {
        const anchor = url.split("#"),
            target = $('#' + anchor[anchor.length - 1]),
            position = Math.floor(target.offset().top) - headerHeight;
        $("html, body").animate({ scrollTop: position }, 100);
    }
});

$('.manual .main-box .img img').on('click', function() {
    var winW = $(window).width();
    var devW = 767;
    if (winW >= devW) {
        $("#img-modal").addClass("active");
        var src = $(this).attr('src');
        $("#img-modal").children().children('img').attr("src", src);
        return false;
    }
});
$('.manual .img-modal').on('click', function() {
    $("#img-modal").removeClass("active");
    return false;
});