!function(a){function b(a,b){return a.toFixed(b.decimals)}a.fn.countTo=function(b){return b=a.extend({},a.fn.countTo.defaults,b||{}),a(this).each(function(){function c(){j+=g,i++,d(j),"function"==typeof e.onUpdate&&e.onUpdate.call(h,j),i>=f&&(clearInterval(k),j=e.to,"function"==typeof e.onComplete&&e.onComplete.call(h,j))}function d(b){var c=e.formatter.call(h,b,e);a(h).html(c)}var e=a.extend({},b,{from:parseFloat(a(this).attr("data-from")||b.from),to:parseFloat(a(this).attr("data-to")||b.to),speed:parseInt(a(this).attr("data-speed")||b.speed,10),refreshInterval:parseInt(a(this).attr("data-refresh-interval")||b.refreshInterval,10),decimals:parseInt(a(this).attr("data-decimals")||b.decimals,10)}),f=Math.ceil(e.speed/e.refreshInterval),g=(e.to-e.from)/f,h=this,i=0,j=e.from,k=setInterval(c,e.refreshInterval);d(j)})},a.fn.countTo.defaults={from:0,to:0,speed:1e3,refreshInterval:100,decimals:0,formatter:b,onUpdate:null,onComplete:null}}(jQuery);