!function(t){t.easyPieChart=function(o,i){var n,e,a,s,r,c,l,p,h=this;return this.el=o,this.$el=t(o),this.$el.data("easyPieChart",this),this.init=function(){var o,n;return h.options=t.extend({},t.easyPieChart.defaultOptions,i),o=parseInt(h.$el.data("percent"),10),h.percentage=0,h.canvas=t("<canvas width='"+h.options.size+"' height='"+h.options.size+"'></canvas>").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.$el.addClass("easyPieChart"),h.$el.css({width:h.options.size,height:h.options.size,lineHeight:""+h.options.size+"px"}),h.update(o),h},this.update=function(t){return t=parseFloat(t)||0,h.options.animate===!1?a(t):e(h.percentage,t),h},l=function(){var t,o,i;for(h.ctx.fillStyle=h.options.scaleColor,h.ctx.lineWidth=1,i=[],t=o=0;24>=o;t=++o)i.push(n(t));return i},n=function(t){var o;o=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-o,0,.05*-h.options.size+o,1),h.ctx.restore()},p=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&&l(),h.options.trackColor!==!1&&p()},a=function(o){var i;c(),h.ctx.strokeStyle=t.isFunction(h.options.barColor)?h.options.barColor(o):h.options.barColor,h.ctx.lineCap=h.options.lineCap,h.ctx.lineWidth=h.options.lineWidth,i=h.options.size/2-h.options.lineWidth/2,h.options.scaleColor!==!1&&(i-=.08*h.options.size),h.ctx.save(),h.ctx.rotate(-Math.PI/2),h.ctx.beginPath(),h.ctx.arc(0,0,i,0,2*Math.PI*o/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)}}(),e=function(t,o){var i,n;h.options.onStart.call(h),h.percentage=o,n=Date.now(),i=function(){var e,l;return l=Date.now()-n,l<h.options.animate&&r(i),h.ctx.clearRect(-h.options.size/2,-h.options.size/2,h.options.size,h.options.size),c.call(h),e=[s(l,t,o-t,h.options.animate)],h.options.onStep.call(h,e),a.call(h,e),l>=h.options.animate?h.options.onStop.call(h):void 0},r(i)},s=function(t,o,i,n){var e,a;return e=function(t){return Math.pow(t,2)},a=function(t){return 1>t?e(t):2-e(t/2*-2+2)},t/=n/2,i/2*a(t)+o},this.init()},t.easyPieChart.defaultOptions={barColor:"#ef1e25",trackColor:"#f2f2f2",scaleColor:"#dfe0e0",lineCap:"round",size:110,lineWidth:3,animate:!1,onStart:t.noop,onStop:t.noop,onStep:t.noop},t.fn.easyPieChart=function(o){return t.each(this,function(i,n){var e;return e=t(n),e.data("easyPieChart")?void 0:e.data("easyPieChart",new t.easyPieChart(n,o))})}}(jQuery);