!function(){jQuery(".max-counter").each(function(e,t){var r=jQuery(t).data("counter");jQuery(t).visible(!0)&&!jQuery(t).hasClass("counted")&&setTimeout(function(){jQuery(t).addClass("counted"),jQuery(t).find(".max-count").countTo({from:0,to:r,speed:2e3,refreshInterval:100})},1e3)});var e=jQuery(window),t=jQuery(".max-counter");e.on("scroll",function(e){t.each(function(e,t){var r;"counter"===(t=jQuery(t)).data("effecttype")&&(r=t.data("counter"),t.visible(!0)&&!jQuery(t).hasClass("counted")&&(t.addClass("counted"),t.find(".max-count").countTo({from:0,to:r,speed:2e3,refreshInterval:100})))})}),jQuery.fn.countTo=function(s){return s=s||{},jQuery(this).each(function(){var t=jQuery.extend({},jQuery.fn.countTo.defaults,{from:jQuery(this).data("from"),to:jQuery(this).data("to"),speed:jQuery(this).data("speed"),refreshInterval:jQuery(this).data("refresh-interval"),decimals:jQuery(this).data("decimals")},s),e=Math.ceil(t.speed/t.refreshInterval),r=(t.to-t.from)/e,n=this,a=jQuery(this),o=0,u=t.from,c=a.data("countTo")||{};function l(e){e=t.formatter.call(n,e,t);a.html(e)}a.data("countTo",c),c.interval&&clearInterval(c.interval),c.interval=setInterval(function(){o++,l(u+=r),"function"==typeof t.onUpdate&&t.onUpdate.call(n,u);e<=o&&(a.removeData("countTo"),clearInterval(c.interval),u=t.to,"function"==typeof t.onComplete&&t.onComplete.call(n,u))},t.refreshInterval),l(u)})},jQuery.fn.countTo.defaults={from:0,to:0,speed:1e3,refreshInterval:100,decimals:0,formatter:function(e,t){return e.toFixed(t.decimals)},onUpdate:null,onComplete:null}}(jQuery);