<div class="module module-customhtml module-{{ module.id }}" >
  
        <div id="popup-{{ module.id }}" class="cgenial-modal  {% if module.params.color %} bg-{{ module.params.color }}{% endif %} {{ module.customClass }}{% if module.picture %} has-bg-image{% endif %}" {% if module.picture %}style="background-image: url({{ asset(module.getWebPicture()|imagine_filter("grayscale"))|replace({' ' : '%20'}) }});"{% endif %} style="display:none">
            <div class="modal-content">
                <div class="modal-body">
                    {{ include('Front/Render/Module/CustomHtml/_content.html.twig') }}
                </div>
            </div>
       </div>
   
</div>
<script>
$(document).ready(function() {
   if ($.cookie("popup-{{ module.id }}") == null) {
        $.fancybox.open({
            src  : '#popup-{{ module.id }}',
            type : 'inline',
            autoFocus: false
        });

        var date = new Date();
        var minutes = 1440;
        date.setTime(date.getTime() + (minutes * 60 * 1000));


        $.cookie("popup-{{ module.id }}", "2", { expires: date, path: '/'});
    }
});
</script>