$(document).ready(function (e) {
    if (!/chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) || /edge/.test(navigator.userAgent.toLowerCase())) {
        if ($(".cshtmlFormContainer .publication-small-image").length > 0) {
            $(".cshtmlFormContainer .publication-small-image").bicubicImgInterpolation({
                crossOrigin: "anonymous"
            });
        }
    }

    $(".cshtmlFormContainer .draggable").draggable({
        scroll: false
    });

    document.addEventListener("mousewheel", function (event) {
        if (event.ctrlKey === true) {
            if ($(event.target).is(".cshtmlFormContainer .draggable #diagram") || $(event.target).is(".cshtmlFormContainer .draggable .diagramMap")) {
                event.stopPropagation();
                event.preventDefault();

                if (event.type === "mousewheel") {
                    scrollTo = event.deltaY / 100;
                } else if (event.type === "DOMMouseScroll") {
                    scrollTo = event.originalEvent.detail;
                }

                Functions.DiagramZoom($(".draggable #diagram"), scrollTo);
            }
        }
    }, { passive: false });
});