(function(t){t.fn.appear=function(e,o){var n=t.extend({data:void 0,one:!0,accx:0,accy:0},o);return this.each(function(){var o=t(this);if(o.appeared=!1,e){var i=t(window),a=function(){if(o.is(":visible")){var t=i.scrollleft(),e=i.scrolltop(),a=o.offset(),r=a.left,s=a.top,p=n.accx,l=n.accy,h=o.height(),c=i.height(),f=o.width(),u=i.width();s+h+l>=e&&s<=e+c+l&&r+f+p>=t&&r<=t+u+p?o.appeared||o.trigger("appear",n.data):o.appeared=!1}else o.appeared=!1},r=function(){if(o.appeared=!0,n.one){i.unbind("scroll",a);var r=t.inarray(a,t.fn.appear.checks);r>=0&&t.fn.appear.checks.splice(r,1)}e.apply(this,arguments)};n.one?o.one("appear",n.data,r):o.bind("appear",n.data,r),i.scroll(a),t.fn.appear.checks.push(a),a()}else o.trigger("appear",n.data)})},t.extend(t.fn.appear,{checks:[],timeout:null,checkall:function(){var e=t.fn.appear.checks.length;if(e>0)for(;e--;)t.fn.appear.checks[e]()},run:function(){t.fn.appear.timeout&&cleartimeout(t.fn.appear.timeout),t.fn.appear.timeout=settimeout(t.fn.appear.checkall,20)}}),t.each(["append","prepend","after","before","attr","removeattr","addclass","removeclass","toggleclass","remove","css","show","hide"],function(e,o){var n=t.fn[o];n&&(t.fn[o]=function(){var e=n.apply(this,arguments);return t.fn.appear.run(),e})})})(jquery),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jquery)}(function(t){function e(t,e){return t.tofixed(e.decimals)}var o=function(e,n){this.$element=t(e),this.options=t.extend({},o.defaults,this.dataoptions(),n),this.init()};o.defaults={from:0,to:0,speed:1e3,refreshinterval:100,decimals:0,formatter:e,onupdate:null,oncomplete:null},o.prototype.init=function(){this.value=this.options.from,this.loops=math.ceil(this.options.speed/this.options.refreshinterval),this.loopcount=0,this.increment=(this.options.to-this.options.from)/this.loops},o.prototype.dataoptions=function(){var t=0,e=parsefloat(this.$element.text().tostring().replace(/,/g,""));this.$element.data("from")&&(t=parsefloat(this.$element.data("from").tostring().replace(/,/g,""))),this.$element.data("to")&&(e=parsefloat(this.$element.data("to").tostring().replace(/,/g,"")));var o=0,n=e.tostring().split(".");n[1]&&(o=n[1].tostring().length);var i={from:t,to:e,speed:this.$element.data("speed"),refreshinterval:this.$element.data("refresh-interval"),decimals:o},a=object.keys(i);for(var r in a){var s=a[r];void 0===i[s]&&delete i[s]}return i},o.prototype.update=function(){this.value+=this.increment,this.loopcount++,this.render(),"function"==typeof this.options.onupdate&&this.options.onupdate.call(this.$element,this.value),this.loopcount>=this.loops&&(clearinterval(this.interval),this.value=this.options.to,"function"==typeof this.options.oncomplete&&this.options.oncomplete.call(this.$element,this.value))},o.prototype.render=function(){var t=this.options.formatter.call(this.$element,this.value,this.options);this.$element.text(t)},o.prototype.restart=function(){this.stop(),this.init(),this.start()},o.prototype.start=function(){this.stop(),this.render(),this.interval=setinterval(this.update.bind(this),this.options.refreshinterval)},o.prototype.stop=function(){this.interval&&clearinterval(this.interval)},o.prototype.toggle=function(){this.interval?this.stop():this.start()},t.fn.countto=function(e){return this.each(function(){var n=t(this),i=n.data("countto"),a=!i||"object"==typeof e,r="object"==typeof e?e:{},s="string"==typeof e?e:"start";a&&(i&&i.stop(),n.data("countto",i=new o(this,r))),i[s].call(i)})}});