function handlePopUps(){jQuery(".popupbox-overlay").length||jQuery('<div class="popupbox-overlay d-none"/>').appendTo("body"),jQuery("#content").find(".popupbox").each(function(){jQuery(this).hasClass("showOnScroll")&&jQuery("<div>").addClass("placeholderPopup").attr("data-popup",jQuery(this).attr("id")).insertAfter(jQuery(this)),jQuery(this).appendTo("body")}),jQuery(".popupbox .close").click(function(e){var o=jQuery(this).parent(".popupbox");e.preventDefault(),hidePopup(o)}),jQuery(".popupbox-overlay").click(function(e){e.preventDefault(),closeAllPopups()}),jQuery("a.popupLink").click(function(e){e.preventDefault(),closeAllPopups();var o=jQuery(this).attr("href"),p=strpos(o,"#",0);if(o=o.substring(p),showPopup(jQuery(o)),jQuery(o).hasClass("animate")){var u=jQuery(window).height();jQuery(o).css({bottom:-u}).animate({bottom:0})}}),jQuery(document).on("keydown",function(e){"Escape"===e.key&&closeAllPopups()})}function showPopup(e){showOverlay(),jQuery(e).removeClass("d-none")}function hidePopup(e){jQuery(e).addClass("d-none"),e.hasClass("showOnScroll")&&window.sessionStorage&&sessionStorage.setItem("popup-opened-"+e.attr("id"),"1"),hideOverlay()}function closeAllPopups(){jQuery(".popupbox").each(function(){hidePopup(jQuery(this))})}function showOverlay(){jQuery(".popupbox-overlay.d-none").length&&(jQuery("body").addClass("hide-overflow"),jQuery(".popupbox-overlay").removeClass("d-none"))}function hideOverlay(){jQuery(".popupbox:visible").length||(jQuery("body").removeClass("hide-overflow"),jQuery(".popupbox-overlay").addClass("d-none"))}function strpos(e,o,p){var u=(e+"").indexOf(o,p||0);return-1!==u&&u}jQuery(document).ready(function(){handlePopUps()});