$(window).on("load", function () {
    "use strict";

    var cookieName = 'h_gdpr_consent_essential';
    var cookieLifetime = 365;

    var _shouldShowCookieConsent = function () {
        if (Cookies.get(cookieName)) {
            return false;
        } else {
            return true;
        }
    };

    $("#acceptCookieConsent").on("click", function () {
        Cookies.set(cookieName, 'true', {expires: cookieLifetime});
        $('#GDPR-component').fadeOut(150);
    });

    if (_shouldShowCookieConsent()) {
        $('#GDPR-component').fadeIn(150);
    }
});
