/*! jquery-countimator 14-10-2015 */ !function(a,b){function c(c,k){function l(){function d(){k.animateOnInit&&k.animateOnAppear&&i(c)&&(a(b).off("scroll touchmove",d),w.call(B))}var e,f,g,h=(o(),p()),j=n();h||(e=r(),e&&("number"!=typeof k.value?k.value=e.nodeValue:k.count=e.nodeValue)),j||(f=s(),f&&(k.max=f.nodeValue)),g=C.find("script[type*='text/x-']"),g.length&&(k.template=g.html(),g.remove()),a(b).on("resize",function(){q.call(B)}),a(b).on("scroll touchmove",d),k.animateOnInit?k.animateOnAppear&&i(c)?(k.count="number"==typeof h?h:0,w.call(B)):u.call(this):(k.count=o(),u.call(this)),q.call(this)}function m(){var a=parseFloat(k.min);return isNaN(a)?0:a}function n(){var a=parseFloat(k.max);return isNaN(a)?0:a}function o(){var a=(n(),m()),b=(p(),parseFloat(k.value));return isNaN(b)&&(b=a),b}function p(){var a=(n(),m()),b=parseFloat(k.count);return isNaN(b)&&(b=a),b}function q(){}function r(a){var b=C.find(k.countSelector)[0];return b||(b=C.find("*").last().siblings().addBack()[0]),h(b||c)[0]}function s(a){var b=C.find(k.maxSelector)[0];return b?h(b)[0]:null}function t(a){var b=k.decimals,c=k.decimalDelimiter,d=k.thousandDelimiter,e=f(a,b,c,d);return e=g(e,k.pad)}function u(){var e,f,g,h,i,j,l,q,u,v=n(),w=m(),x=o(),y=p(),z=t(y),A=t(x),B=t(v),C=t(w),D=k.engine||"undefined"!=typeof b.Handlebars?b.Handlebars:null,E=k.template;try{g=a(k.template),E=g.length&&g[0].innerHTML||E}catch(F){}D&&E?(h=D.compile(E),h&&(i=a.extend({},k,{count:z,value:A,max:B,min:C}),e=h(i)),f=document.createElement("div"),f.innerHTML=e,j=f.childNodes,a(c).contents().remove(),a(c).append(j)):(l=r(),l&&(l.nodeValue=z),q=s(),q&&(q.nodeValue=B),l||q||(c.innerHTML=z)),k.style&&(u=a.fn[d].getStyle(k.style),u&&u.render&&u.render.call(c,y,k))}function v(a){k.value=a,D||w()}function w(){D||(z=(new Date).getTime(),A=p(),D=!0,"function"==typeof k.start&&k.start.call(c),j(x))}function x(){var a=k.duration,b=(n(),o()),d=(new Date).getTime(),e=z+a,f=Math.min((a-(e-d))/a,1),g=A+f*(b-A);k.count=g,u.call(this),"function"==typeof k.step&&k.step.call(c,g,k),1>f&&D?j(x):y.call(this)}function y(){D=!1,"function"==typeof k.complete&&k.complete.call(c)}var z,A,B=this,C=a(c),D=!1;k=a.extend({},e,k,C.data()),this.resize=function(){q.call(this)},this.animate=function(a){v.call(this,a)},this.setOptions=function(b){var c=this.getOptions();a.extend(!0,k,b),k.value!==c.value&&w()},this.getOptions=function(){return a.extend(!0,{},k)},l.call(this)}var d="countimator",e={count:0,value:null,min:null,max:0,duration:1e3,countSelector:".counter-count",maxSelector:".counter-max",template:null,engine:null,animateOnInit:!0,animateOnAppear:!0,decimals:0,decimalDelimiter:".",thousandDelimiter:null,pad:!1,style:null,start:function(){},step:function(a){},complete:function(){}},f=function(a,b,c,d){b=isNaN(b=Math.abs(b))?2:b,c="undefined"==typeof c?".":c,d="undefined"==typeof d?",":d,d="string"==typeof d?d:"";var e=0>a?"-":"",f=Math.abs(+a||0).toFixed(b),g=String(parseInt(f)),h=g.length>3?g.length%3:0;return e+(h?g.substr(0,h)+d:"")+g.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+d)+(b?c+Math.abs(f-g).toFixed(b).slice(2):"")},g=function(a,b){for(var c=""+a;c.length=i&&h>=f},j=b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||b.oRequestAnimationFrame||function(a){b.setTimeout(a,1e3/60)};a.fn[d]=function(b){return this.each(function(){var e=a.extend(!0,{},b),f=a(this).data(d);return f?f.setOptions(e):a(this).data(d,new c(this,e)),a(this)})},function(){var b={};a.fn[d].registerStyle=function(a,c){b[a]=c},a.fn[d].getStyle=function(a){return b[a]}}()}(jQuery,window);