!function(t){return t.easyPieChart=function(e,o){var n,i,a,s,r,c,p,l,h=this;return this.el=e,this.$el=t(e),this.$el.data("easyPieChart",this),this.init=function(){var e,n;return h.options=t.extend({},t.easyPieChart.defaultOptions,o),e=parseInt(h.$el.data("percent"),10),h.percentage=0,h.canvas=t("").get(0),h.$el.append(h.canvas),"undefined"!=typeof G_vmlCanvasManager&&null!==G_vmlCanvasManager&&G_vmlCanvasManager.initElement(h.canvas),h.ctx=h.canvas.getContext("2d"),window.devicePixelRatio>1&&(n=window.devicePixelRatio,t(h.canvas).css({width:h.options.size,height:h.options.size}),h.canvas.width*=n,h.canvas.height*=n,h.ctx.scale(n,n)),h.ctx.translate(h.options.size/2,h.options.size/2),h.ctx.rotate(h.options.rotate*Math.PI/180),h.$el.addClass("easyPieChart"),h.$el.css({width:h.options.size,height:h.options.size,lineHeight:""+h.options.size+"px"}),h.update(e),h},this.update=function(t){return t=parseFloat(t)||0,h.options.animate===!1?a(t):h.options.delay?(i(h.percentage,0),setTimeout(function(){return i(h.percentage,t)},h.options.delay)):i(h.percentage,t),h},p=function(){var t,e,o;for(h.ctx.fillStyle=h.options.scaleColor,h.ctx.lineWidth=1,o=[],t=e=0;24>=e;t=++e)o.push(n(t));return o},n=function(t){var e;e=t%6===0?0:.017*h.options.size,h.ctx.save(),h.ctx.rotate(t*Math.PI/12),h.ctx.fillRect(h.options.size/2-e,0,.05*-h.options.size+e,1),h.ctx.restore()},l=function(){var t;t=h.options.size/2-h.options.lineWidth/2,h.options.scaleColor!==!1&&(t-=.08*h.options.size),h.ctx.beginPath(),h.ctx.arc(0,0,t,0,2*Math.PI,!0),h.ctx.closePath(),h.ctx.strokeStyle=h.options.trackColor,h.ctx.lineWidth=h.options.lineWidth,h.ctx.stroke()},c=function(){h.options.scaleColor!==!1&&p(),h.options.trackColor!==!1&&l()},a=function(e){var o;c(),h.ctx.strokeStyle=t.isFunction(h.options.barColor)?h.options.barColor(e):h.options.barColor,h.ctx.lineCap=h.options.lineCap,h.ctx.lineWidth=h.options.lineWidth,o=h.options.size/2-h.options.lineWidth/2,h.options.scaleColor!==!1&&(o-=.08*h.options.size),h.ctx.save(),h.ctx.rotate(-Math.PI/2),h.ctx.beginPath(),h.ctx.arc(0,0,o,0,2*Math.PI*e/100,!1),h.ctx.stroke(),h.ctx.restore()},r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),i=function(t,e){var o,n;h.options.onStart.call(h),h.percentage=e,Date.now||(Date.now=function(){return+new Date}),n=Date.now(),o=function(){var i,p;return p=Math.min(Date.now()-n,h.options.animate),h.ctx.clearRect(-h.options.size/2,-h.options.size/2,h.options.size,h.options.size),c.call(h),i=[s(p,t,e-t,h.options.animate)],h.options.onStep.call(h,i),a.call(h,i),p>=h.options.animate?h.options.onStop.call(h,i,e):r(o)},r(o)},s=function(t,e,o,n){var i,a;return i=function(t){return Math.pow(t,2)},a=function(t){return 1>t?i(t):2-i(t/2*-2+2)},t/=n/2,o/2*a(t)+e},this.init()},t.easyPieChart.defaultOptions={barColor:"#eb2c33",trackColor:"#ededed",scaleColor:!1,lineCap:"square",rotate:0,size:165,lineWidth:15,animate:!1,delay:!1,onStart:t.noop,onStop:t.noop,onStep:t.noop},void(t.fn.easyPieChart=function(e){return t.each(this,function(o,n){var i,a;return i=t(n),i.data("easyPieChart")?void 0:(a=t.extend({},e,i.data()),i.data("easyPieChart",new t.easyPieChart(n,a)))})})}(jQuery);