/*! PopUp - v4.8.0 * https://premium.wpmudev.org/project/the-pop-over-plugin/ * Copyright (c) 2016; * Licensed GPLv2+ */ (function(){window.IncPopup=function e(t){var i=this;i.data=t.popup,i.have_popup=!1,i.ajax_data={},i.opened=0,i.popup=null,i.close_popup=function(){if(jQuery("html").removeClass("can-scroll no-scroll"),i.data.display_data.click_multi?i.popup.hide():(i.popup.destroy(),i.have_popup=!1),jQuery(document).trigger("popup-closed",[i,i.data]),jQuery(document).trigger("popover-closed",[i,i.data]),i.data.close_hide){var e=i.data.expiry||365;if(t.preview)return!1;i.set_cookie("po_h",1,e)}return!1},i.close_popup_forever=function(){i.data.close_hide=!0,i.close_popup()},i.background_clicked=function(e){var t=jQuery(e.target);if(t.hasClass("wdpu-background")){if(!i.data.overlay_close)return;i.close_popup()}},i.move_popup=function(e){var t,n,s=0,o=0,r=null,a=e.find(".resize"),l=e.find(".move"),c=e.find(".wdpu-image img"),h=e.find(".popup");i.data.custom_size&&a.length&&(i.data.height&&!isNaN(i.data.height)&&(a.data("reduce-height")&&(r=jQuery(a.data("reduce-height")),o=r.outerHeight()),n=i.data.height-o,100>n&&(n=100),a.height(n)),i.data.width&&!isNaN(i.data.width)&&(a.data("reduce-width")&&(r=jQuery(a.data("reduce-width")),s=r.outerWidth()),t=i.data.width-s,100>t&&(t=100),a.width(t)));var u=function u(){if(!l.hasClass("no-move-x")){var e=jQuery(window).width(),t=h.outerWidth(),i=(e-t)/2;0>i&&(i=0),l.css({left:i})}if(!l.hasClass("no-move-y")){var n=jQuery(window).height(),s=h.outerHeight(),o=(n-s)/2;0>o&&(o=0),l.css({top:o})}if(c.length){var r,a,u=c.width(),d=c.height(),g=c.parent().width(),f=c.parent().height();u>g?(r=(g-u)/2,c.css({"margin-left":r})):c.css({"margin-left":0}),d>f?(a=(f-d)/2,c.css({"margin-top":a})):c.css({"margin-top":0})}};window.setTimeout(u,20),u()},i.reject=function(){i.have_popup=!1,i.data={}},i.prepare=function(){if(jQuery(document).trigger("popup-init",[i,i.data]),i.have_popup)switch(i.data.display){case"scroll":jQuery(window).on("scroll",i.show_at_position);break;case"anchor":jQuery(window).on("scroll",i.show_at_element);break;case"delay":var e=1e3*i.data.display_data.delay;"m"===i.data.display_data.delay_type&&(e*=60),window.setTimeout(i.show_popup,e);break;default:window.setTimeout(function(){"function"==typeof i.custom_handler&&i.custom_handler(i)},20)}},i.show_at_position=function(){var e,t,n=jQuery(this),s=n.scrollTop();"px"===i.data.display_data.scroll_type?s>=i.data.display_data.scroll&&(jQuery(window).off("scroll",i.show_at_position),i.show_popup()):(e=jQuery(document).height()-jQuery(window).height(),t=100*s/e,t>=i.data.display_data.scroll&&(jQuery(window).off("scroll",i.show_at_position),i.show_popup()))},i.show_at_element=function(){var e=jQuery(i.data.display_data.anchor),t=jQuery(window).scrollTop(),n=t+jQuery(window).height(),s=e.offset().top,o=n-s;o>10&&(jQuery(window).off("scroll",i.show_at_element),i.show_popup())},i.show_popup=function(){return jQuery(document).trigger("popup-open",[i]),!1},i._show=function(){var e,n="auto",s="auto";return e=parseInt(i.get_cookie("po_c"),10),isNaN(e)&&(e=0),i.set_cookie("po_c",e+1,365),i.data.custom_size&&(n=i.data.width,s=i.data.height),i.opened+=1,i.popup=wpmUi.popup(t.popup.html,t.popup.styles).size(n,s).animate(i.data.animation_in,i.data.animation_out).onresize(i.move_popup).on("click",".wdpu-background",i.background_clicked).on("click",".wdpu-hide-forever",i.close_popup_forever).on("click",".wdpu-close",i.close_popup).on("click",".close",i.close_popup).show(),i.data.scroll_body?jQuery("html").addClass("can-scroll"):jQuery("html").addClass("no-scroll"),!0},i.load_popup=function(e,n){void 0===e&&t.preview||(i.have_popup=!1,jQuery(document).trigger("popups-load",[t,e,n]))},i.cta_click=function(){return!0},i.form_submit=function(){function t(){var t=!1;"complete"!==a[0].contentDocument.readyState||e.doing_ajax?(l+=1,l>200&&(jQuery(document).trigger("popup-submit-timeout",[i,i.data]),t=!0)):t=!0,t&&(window.clearInterval(r),o())}function n(t){return void 0!==t&&(i.data.close_popup=t),e.recent_ajax_calls?(i.data.ajax_history=e.recent_ajax_calls,e.recent_ajax_calls.length&&(i.data.last_ajax=e.recent_ajax_calls[0])):(i.data.ajax_history=[],i.data.last_ajax={}),jQuery(document).trigger("popup-submit-done",[i,i.data]),i.data.close_popup?(i.close_popup(),!0):!1}function s(e,t,n){var s=e,o=h.find(".wdpu-msg-inner"),r=h.find(".wdpu-title"),a=h.find(".wdpu-subtitle");s instanceof jQuery||(s=jQuery("
").html(e)),s instanceof jQuery&&(s.hasClass("wdpu-msg-inner")?o.replaceWith(s):o.find(".wdpu-content").empty().append(s)),void 0!==t&&r.html(t),void 0!==n&&a.html(n),jQuery(document).trigger("popup-init",[i,i.data])}function o(){var e,t,o,r,l;if(jQuery(document).trigger("popup-submit-process",[a,i,i.data]),!i.data.form_submit)return!1;l="ignore"===i.data.form_submit?!1:!0;try{o=jQuery(g,a[0].contentDocument),r=i.data.did_ajax}catch(c){o=jQuery(""),r=!0}i.data.close_popup=!1,u.removeClass("wdpu-loading"),e=o.find(".wdpu-msg-inner"),t=h.find(".wdpu-msg-inner"),jQuery("#wdpu-frame").remove(),i.data.last_ajax=void 0,"close"===i.data.form_submit?n(!0):i.data.new_content?s(i.data.new_content,i.data.new_title,i.data.new_subtitle):r?n(l):o.length&&o.html().length?t.length&&e.length&&e.text().length?s(e):n(l):n(!0)}var r,a,l,c=jQuery(this),h=c.parents(".wdpu-container").first(),u=h.find(".wdpu-msg"),d=jQuery(''),g=".wdpu-"+i.data.popup_id;return h.length?("redirect"!==i.data.form_submit&&(a=jQuery('').hide().appendTo("body"),c.attr("target","wdpu-frame"),d.appendTo(c).val("raw")),u.addClass("wdpu-loading"),"redirect"===i.data.form_submit?window.setTimeout(function(){i.close_popup()},10):e.doing_ajax?(i.data.did_ajax=!0,l=0,r=window.setInterval(t,50)):(i.data.did_ajax=!1,a.load(o)),!0):!0},i.init=function(){t.popup?(i.have_popup=!0,i.data=t.popup,i.exec_scripts(),i.prepare()):i.load_popup()},i.exec_scripts=function(){var e;void 0!==i.data.script&&(e=Function("me",i.data.script),e(i))},i.close=function(){return i.close_popup()},i.open=function(){return i.show_popup()},i.status=function(){return{state:e.po_status,queue:e.po_queue,current:e.po_current}},i.get_cookie=function(e){var t,n,s,o=document.cookie.split(";");for(s=i.data&&i.data.popup_id?e+"-"+i.data.popup_id+"=":e+"=",t=0;o.length>t;t+=1){for(n=o[t];" "===n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(s))return n.substring(s.length,n.length)}return null},i.set_cookie=function(e,n,s){var o,r,a;t.preview||(isNaN(s)?r="":(o=new Date,o.setTime(o.getTime()+1e3*60*60*24*s),r="; expires="+o.toGMTString()),a=i.data&&i.data.popup_id?e+"-"+i.data.popup_id:e,document.cookie=a+"="+n+r+"; path=/")};var n={};return n.extend=i,i.data&&i.data.preview?(n.init=i.init,n.load=i.load_popup):t.dynamic?(i.init(),n.open=i.show_popup,n.close=i.close_popup,n.status=i.status):(n.init=i.init,n.load=i.load_popup),n}})(),function(){function e(e,i){"closed"===IncPopup.po_status?i._show()?(IncPopup.po_current=i,IncPopup.po_status="open"):t(null,i):IncPopup.po_queue[IncPopup.po_queue.length]=i}function t(){if(IncPopup.po_status="closed",IncPopup.po_current=null,IncPopup.po_queue.length>0){var t=IncPopup.po_queue.shift();e(null,t)}}function i(e,t,i,o){var r,a,l=0,c=s(""+window.location),h=s(""+document.referrer),u=null,d=function d(e){u=jQuery.extend({},t),u.popup=e,n(u)};return window.force_popover&&(l=""+window.force_popover),void 0!==i&&(l=""+i),t.ajax_data=t.ajax_data||{},a=jQuery.extend({},t.ajax_data),a.action="inc_popup",a["do"]=t["do"],a.thefrom=c,a.thereferrer=h,l&&(a.po_id=l),o&&(a.data=o),t.preview&&(a.preview=!0),r={url:t.ajaxurl,dataType:"jsonp",jsonpCallback:"po_data",data:a,success:function(e){d(e)},complete:function(){jQuery(document).trigger("popup-load-done",[u])}},jQuery.ajax(r)}function n(e){if(e){var t=function t(e){e&&(e.popup&&e.popup.html&&jQuery('").appendTo("head"),window.inc_popup=new IncPopup(e),window.inc_popups[window.inc_popups.length]=window.inc_popup,jQuery(document).trigger("popup-initialized",[window.inc_popup]),e.noinit||e.preview||window.inc_popup.init())};if(e.popup instanceof Array)for(var i=0;e.popup.length>i;i+=1){var n=jQuery.extend({},e);n.popup=e.popup[i],t(n)}else e instanceof Object&&t(e)}}function s(e){for(var t=[],i=0;e.length>i;i++){if(e.length>i+1){var n=e.charCodeAt(i),s=e.charCodeAt(i+1);if(n>=55296&&56319>=n&&56320===(64512&s)||s>=768&&879>=s){t.unshift(e.substring(i,i+2)),i++;continue}}t.unshift(e[i])}return t.join("")}IncPopup.po_status="closed",IncPopup.po_queue=[],IncPopup.po_current=null,IncPopup.recent_ajax_calls=[],IncPopup.doing_ajax=!1,jQuery(document).on("popup-open",e),jQuery(document).on("popup-closed",t),jQuery(document).on("popups-load",i),jQuery(document).ajaxStart(function(){IncPopup.doing_ajax=!0}),jQuery(document).ajaxComplete(function(e,t){IncPopup.doing_ajax=!1,IncPopup.recent_ajax_calls.unshift(t)}),jQuery(function(){window.inc_popups=[],window._popup_data&&n(window._popup_data)})}();