/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/
jQuery.easing["jswing"]=jQuery.easing["swing"];jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;if(!g)g=e*.3*1.5;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;return d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;return d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;if((b/=e/2)<1)return d/2*b*b*(((f*=1.525)+1)*b-f)+c;return d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){if((b/=e)<1/2.75){return d*7.5625*b*b+c}else if(b<2/2.75){return d*(7.5625*(b-=1.5/2.75)*b+.75)+c}else if(b<2.5/2.75){return d*(7.5625*(b-=2.25/2.75)*b+.9375)+c}else{return d*(7.5625*(b-=2.625/2.75)*b+.984375)+c}},easeInOutBounce:function(a,b,c,d,e){if(b<e/2)return jQuery.easing.easeInBounce(a,b*2,0,d,e)*.5+c;return jQuery.easing.easeOutBounce(a,b*2-e,0,d,e)*.5+d*.5+c}});

/*
 * jQuery css bezier animation support -- Jonah Fox
 * version 0.0.1
 * Released under the MIT license.
 */
/*
  var path = $.path.bezier({
    start: {x:10, y:10, angle: 20, length: 0.3},
    end:   {x:20, y:30, angle: -20, length: 0.2}
  })
  $("myobj").animate({path: path}, duration)

*/
(function(a){a.path={};var b={rotate:function(a,b){var c=b*3.141592654/180;var d=Math.cos(c),e=Math.sin(c);return[d*a[0]-e*a[1],e*a[0]+d*a[1]]},scale:function(a,b){return[b*a[0],b*a[1]]},add:function(a,b){return[a[0]+b[0],a[1]+b[1]]},minus:function(a,b){return[a[0]-b[0],a[1]-b[1]]}};a.path.bezier=function(c){c.start=a.extend({angle:0,length:.3333},c.start);c.end=a.extend({angle:0,length:.3333},c.end);this.p1=[c.start.x,c.start.y];this.p4=[c.end.x,c.end.y];var d=b.minus(this.p4,this.p1);var e=b.scale(d,c.start.length);e=b.rotate(e,c.start.angle);this.p2=b.add(this.p1,e);var f=b.scale(d,-1);var g=b.scale(f,c.end.length);g=b.rotate(g,c.end.angle);this.p3=b.add(this.p4,g);this.f1=function(a){return a*a*a};this.f2=function(a){return 3*a*a*(1-a)};this.f3=function(a){return 3*a*(1-a)*(1-a)};this.f4=function(a){return(1-a)*(1-a)*(1-a)};this.css=function(a){var b=this.f1(a),c=this.f2(a),d=this.f3(a),e=this.f4(a);var f=this.p1[0]*b+this.p2[0]*c+this.p3[0]*d+this.p4[0]*e;var g=this.p1[1]*b+this.p2[1]*c+this.p3[1]*d+this.p4[1]*e;return{top:g+"px",left:f+"px"}}};a.path.arc=function(a){for(var b in a)this[b]=a[b];this.dir=this.dir||1;while(this.start>this.end&&this.dir>0)this.start-=360;while(this.start<this.end&&this.dir<0)this.start+=360;this.css=function(a){var b=this.start*a+this.end*(1-a);b=b*3.1415927/180;var c=Math.sin(b)*this.radius+this.center[0];var d=Math.cos(b)*this.radius+this.center[1];return{top:d+"px",left:c+"px"}}};a.fx.step.path=function(a){var b=a.end.css(1-a.pos);for(var c in b)a.elem.style[c]=b[c]}})(jQuery);

// Monkey patch jQuery 1.3.1+ css() method to support CSS 'transform'
// property uniformly across Webkit/Safari/Chrome, Firefox 3.5+, and IE 9+.
// 2009-2011 Zachary Johnson www.zachstronaut.com
// Updated 2011.05.04 (May the fourth be with you!)
(function(a){function b(a){var b=["transform","WebkitTransform","msTransform","MozTransform","OTransform"];var c;while(c=b.shift()){if(typeof a.style[c]!="undefined"){return c}}return"transform"}var c=null;var d=a.fn.css;a.fn.css=function(e,f){if(c===null){if(typeof a.cssProps!="undefined"){c=a.cssProps}else if(typeof a.props!="undefined"){c=a.props}else{c={}}}if(typeof c["transform"]=="undefined"&&(e=="transform"||typeof e=="object"&&typeof e["transform"]!="undefined")){c["transform"]=b(this.get(0))}if(c["transform"]!="transform"){if(e=="transform"){e=c["transform"];if(typeof f=="undefined"&&jQuery.style){return jQuery.style(this.get(0),e)}}else if(typeof e=="object"&&typeof e["transform"]!="undefined"){e[c["transform"]]=e["transform"];delete e["transform"]}}return d.apply(this,arguments)}})(jQuery);

// Monkey patch jQuery 1.3.1+ to add support for setting or animating CSS
// scale and rotation independently.
// 2009-2010 Zachary Johnson www.zachstronaut.com
// Updated 2010.11.06
(function(a){var b="deg";a.fn.rotate=function(c){var d=a(this).css("transform")||"none";if(typeof c=="undefined"){if(d){var e=d.match(/rotate\(([^)]+)\)/);if(e&&e[1]){return e[1]}}return 0}var e=c.toString().match(/^(-?\d+(\.\d+)?)(.+)?$/);if(e){if(e[3]){b=e[3]}a(this).css("transform",d.replace(/none|rotate\([^)]*\)/,"")+"rotate("+e[1]+b+")")}return this};a.fn.scale=function(b,c,d){var e=a(this).css("transform");if(typeof b=="undefined"){if(e){var f=e.match(/scale\(([^)]+)\)/);if(f&&f[1]){return f[1]}}return 1}a(this).css("transform",e.replace(/none|scale\([^)]*\)/,"")+"scale("+b+")");return this};var c=a.fx.prototype.cur;a.fx.prototype.cur=function(){if(this.prop=="rotate"){return parseFloat(a(this.elem).rotate())}else if(this.prop=="scale"){return parseFloat(a(this.elem).scale())}return c.apply(this,arguments)};a.fx.step.rotate=function(c){a(c.elem).rotate(c.now+b)};a.fx.step.scale=function(b){a(b.elem).scale(b.now)};var d=a.fn.animate;a.fn.animate=function(a){if(typeof a["rotate"]!="undefined"){var c=a["rotate"].toString().match(/^(([+-]=)?(-?\d+(\.\d+)?))(.+)?$/);if(c&&c[5]){b=c[5]}a["rotate"]=c[1]}return d.apply(this,arguments)}})(jQuery);


