!function(e){"use strict";window.jnews.popuppost=window.jnews.popuppost||{},window.jnews.popuppost={container:null,content:null,element:null,init:function(n){var t=this;if(t.container=void 0===n?e("body"):n,t.element=t.container.find(".jeg_popup_post"),t.element.length>0){var o=e(t.element).parents(".post-wrap");t.content=e(o).find(".entry-content"),t.element.find(".jeg_popup_close").on("click",(function(e){e.preventDefault(),t.element.removeClass("active").addClass("closed")})),e(window).width()>1024?("object"==typeof jnews&&"object"==typeof jnews.library&&jnews.library.winLoad(t.dispatch.bind(t)),e(window).on("scroll resize",t.dispatch.bind(t))):e(window).off("scroll resize",t.dispatch.bind(t))}},dispatch:function(){var n=this,t=n.element.hasClass("closed"),o=e(window).scrollTop(),i=.5*e(window).height();o>Math.abs(n.content.offset().top+n.content.outerHeight()-i)&&!t?n.element.addClass("active"):n.element.removeClass("active")}},e(document).on("jnews-ajax-load",(function(e,n){jnews.popuppost.init(n)})),e((function(){jnews.popuppost.init()}))}(jQuery);