var countup=function(target,startval,endval,decimals,duration,options){var self=this;self.version=function(){return"1.9.2"};self.options={useeasing:true,usegrouping:true,separator:",",decimal:".",easingfn:easeoutexpo,formattingfn:formatnumber,prefix:"",suffix:"",numerals:[]};if(options&&typeof options==="object"){for(var key in self.options){if(options.hasownproperty(key)&&options[key]!==null){self.options[key]=options[key]}}}if(self.options.separator===""){self.options.usegrouping=false}else{self.options.separator=""+self.options.separator}var lasttime=0;var vendors=["webkit","moz","ms","o"];for(var x=0;x1?self.options.decimal+x[1]:"";if(self.options.usegrouping){x3="";for(i=0,l=x1.length;iself.endval);self.frameval=self.startval;self.initialized=true;return true}else{self.error="[countup] startval ("+startval+") or endval ("+endval+") is not a number";return false}};self.printvalue=function(value){var result=self.options.formattingfn(value);if(self.d.tagname==="input"){this.d.value=result}else{if(self.d.tagname==="text"||self.d.tagname==="tspan"){this.d.textcontent=result}else{this.d.innerhtml=result}}};self.count=function(timestamp){if(!self.starttime){self.starttime=timestamp}self.timestamp=timestamp;var progress=timestamp-self.starttime;self.remaining=self.duration-progress;if(self.options.useeasing){if(self.countdown){self.frameval=self.startval-self.options.easingfn(progress,0,self.startval-self.endval,self.duration)}else{self.frameval=self.options.easingfn(progress,self.startval,self.endval-self.startval,self.duration)}}else{if(self.countdown){self.frameval=self.startval-((self.startval-self.endval)*(progress/self.duration))}else{self.frameval=self.startval+(self.endval-self.startval)*(progress/self.duration)}}if(self.countdown){self.frameval=(self.framevalself.endval)?self.endval:self.frameval}self.frameval=math.round(self.frameval*self.dec)/self.dec;self.printvalue(self.frameval);if(progressself.endval);self.raf=requestanimationframe(self.count)};if(self.initialize()){self.printvalue(self.startval)}};