(function(){var e=function(f){return f.constructor==jQuery?f:$(f)};function c(){return +new Date()}function a(f){f=parseInt(f);return isFinite(f)?f:0}var d=function(f){this.initialize(f)};d.prototype={constructor:d,initialize:function(f){this.options=this.options||this.getOptions(f);var g=this.options;if(!this.options.el){return}this.$el=e(g.el);this.timerId=null;this.elOriginalLeft=a(this.$el.css("left"));this.elOriginalTop=a(this.$el.css("top"));if(g.targetEl){this.driftX=a(e(g.targetEl).css("left"))-this.elOriginalLeft;this.driftY=a(e(g.targetEl).css("top"))-this.elOriginalTop}else{this.driftX=g.offset[0];this.driftY=g.offset[1]}this.duration=g.duration;this.curvature=g.curvature;this.b=(this.driftY-this.curvature*this.driftX*this.driftX)/this.driftX;if(g.autostart){this.start()}},getOptions:function(f){if(typeof f!=="object"){f={}}f=$.extend({},b,e(f.el).data(),(this.options||{}),f);return f},domove:function(f,g){this.$el.css({position:"absolute",left:this.elOriginalLeft+f,top:this.elOriginalTop+g});return this},step:function(g){var h=this.options;var f,i;if(g>this.end){f=this.driftX;i=this.driftY;this.domove(f,i);this.stop();if(typeof h.callback==="function"){h.callback.call(this)}}else{f=this.driftX*((g-this.begin)/this.duration);i=this.curvature*f*f+this.b*f;this.domove(f,i);if(typeof h.stepCallback==="function"){h.stepCallback.call(this)}}return this},setOptions:function(f){this.reset();if(typeof f!=="object"){f={}}this.options=this.getOptions(f);this.initialize("parabola",this.options);return this},start:function(){var f=this;this.begin=c();this.end=this.begin+this.duration;if(this.driftX===0&&this.driftY===0){return}if(!!this.timerId){clearInterval(this.timerId);this.stop()}this.timerId=setInterval(function(){var g=c();f.step(g)},13);return this},reset:function(f,g){this.stop();f=f?f:0;g=g?g:0;this.domove(f,g);return this},stop:function(){if(!!this.timerId){clearInterval(this.timerId)}return this}};var b={el:null,offset:[0,0],targetEl:null,duration:500,curvature:0.001,callback:null,autostart:false,stepCallback:null};window.Parabola=d})();