1 @using System.Globalization@using System.Web@using Co3.Espresso.Website.Models.FrontEnd.Settings@using Co3.Espresso.Website.Services@using Dynamicweb.Content@using Dynamicweb.Frontend@{Area area = PageView.Current().Area;bool enablePopup = area.Item["EnablePopup"]?.ToString() == "True";int popupPage = area.Item["PopupPage"] != null ? Convert.ToInt32( area.Item["PopupPage"] ) : 0;int popupDelay = 86400000;int cookieDaysToExpiration = Convert.ToInt32( area.Item["PopupCookieExpirationTime"].ToString() );string popupSize = area.Item["PopupSize"]?.ToString();string popupCloseIconColor = area.Item["CloseIconColor"]?.ToString();string popupCampaignNameCookieName = area.Item["CampaignName"]?.ToString().ToLower() + ".hidden";HttpCookie popupCampaignStateCookie = HttpContext.Current.Request.Cookies[ popupCampaignNameCookieName ];DateTime popupCampaignExpirationDateTime = DateTime.UtcNow.AddDays( cookieDaysToExpiration );bool popupCampaignIsExpired = popupCampaignExpirationDateTime.Date < DateTime.Now.Date;if ( enablePopup == true && popupCampaignIsExpired == false && popupCampaignStateCookie == null ){popupDelay = area.Item["PopupDelayTime"] != null ? Convert.ToInt32( area.Item["PopupDelayTime"] ) * 1000 : 0;}}@if ( enablePopup == true ){<!-- Modal --><div aria-hidden="true" aria-labelledby="modal-@popupPage" class="js-elka-campaign-popup fade modal" data-popup-delay="@popupDelay" data-popup-expiration-date="@popupCampaignExpirationDateTime.ToString( CultureInfo.InvariantCulture )" data-popup-campaign="@popupCampaignNameCookieName" id="modal-@popupPage" role="dialog" tabindex="-1"><div class="modal-dialog @popupSize" role="document"><div class="modal-content"><div class="modal-body p-0"><button aria-label="Close" class="close font-weight-normal pos-r-1 pos-t-1 position-absolute z-index-500 @popupCloseIconColor" data-dismiss="modal" type="button"><i class="material-icons">close</i></button>@RenderingService.Instance.SectionStart( new SectionSettings() )@RenderPageContent( popupPage )</div></div></div></div>}