/*! * VERSION: beta 1.15 * DATE: 2012-12-14 * JavaScript (also available in AS3 and AS2) * UPDATES AND DOCS AT: http://www.greensock.com * * Copyright (c) 2008-2013, GreenSock. All rights reserved. * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for * Club GreenSock members, the software agreement that was issued with your membership. * * @author: Jack Doyle, jack@greensock.com */ (window._gsQueue||(window._gsQueue=[])).push(function(){_gsDefine("plugins.BezierPlugin",["plugins.TweenPlugin"],function(F){var z=function(){F.call(this,"bezier",-1);this._overwriteProps.pop();this._func={};this._round={}},E=z.prototype=new F("bezier",1),I=180/Math.PI,J=Math.PI/180,A=[],B=[],C=[],G={},D=function(a,c,g,p){this.a=a;this.b=c;this.c=g;this.d=p;this.da=p-a;this.ca=g-a;this.ba=c-a},K=z.bezierThrough=function(a,c,g,p,j,b){var d={},f=[],e,k,q;j="string"===typeof j?","+j+",":",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,"; null==c&&(c=1);for(k in a[0])f.push(k);A.length=B.length=C.length=0;for(e=f.length;-1<--e;){k=f[e];G[k]=-1!==j.indexOf(","+k+",");q=d;var s=k,n;n=a;var m=k,w=G[k],l=b,t=[],r=void 0,h=void 0,v=void 0,u=void 0,x=void 0,r=void 0;if(l){n=[l].concat(n);for(h=n.length;-1<--h;)if("string"===typeof(r=n[h][m]))"="===r.charAt(1)&&(n[h][m]=l[m]+Number(r.charAt(0)+r.substr(2)))}r=n.length-2;if(0>r)t[0]=new D(n[0][m],0,0,n[-1>r?0:1][m]);else{for(h=0;hq)return e;for(m=0;m<=q;m++)l=c(a,d[m],f,e,k,q!==m),s[m]=l.end;for(w in b)n[w]=b[w];n.values=s;e=new p(a,"bezier",0,0,l.pt,2);e.data=l;e.plugin=k;e.setRatio=g;0===n.autoRotate&&(n.autoRotate=!0);n.autoRotate&&!(n.autoRotate instanceof Array)&&(m=!0===n.autoRotate?0:Number(n.autoRotate)*J,n.autoRotate=null!=l.end.left?[["left","top","rotation",m,!0]]:null!=l.end.x?[["x","y","rotation",m,!0]]:!1); n.autoRotate&&(f._transform||f._enableTransforms(!1),l.autoRotate=f._target._gsTransform);k._onInitTween(l.proxy,n,f._tween);return e})}};E._onInitTween=function(a,c,g){this._target=a;c instanceof Array&&(c={values:c});this._props=[];this._timeRes=null==c.timeResolution?6:parseInt(c.timeResolution);var p=c.values||[],j={},b=p[0];g=c.autoRotate||g.vars.orientToBezier;var d,f,e;this._autoRotate=g?g instanceof Array?g:[["x","y","rotation",!0===g?0:Number(g)||0]]:null;for(d in b)this._props.push(d);for(b= this._props.length;-1<--b;)d=this._props[b],this._overwriteProps.push(d),g=this._func[d]="function"===typeof a[d],j[d]=!g?parseFloat(a[d]):a[d.indexOf("set")||"function"!==typeof a["get"+d.substr(3)]?d:"get"+d.substr(3)](),e||j[d]!==p[0][d]&&(e=j);if("cubic"!==c.type&&"quadratic"!==c.type&&"soft"!==c.type)j=K(p,isNaN(c.curviness)?1:c.curviness,!1,"thruBasic"===c.type,c.correlate,e);else{g=(g=c.type)||"soft";c={};e="cubic"===g?3:2;g="soft"===g;var b=[],k,q,s,n,m,w,l,t,r;g&&j&&(p=[j].concat(p));if(null== p||p.length>0||6;j=[];q=[];p=s=0;c=d-1;e=[];g=[];for(f in b){k=b[f];m=j;w=d;l=1/w;t=k.length;for(var h=void 0,v=void 0,u=n=r=v=void 0,x=h=void 0,y=void 0,y=u=void 0;-1<--t;){u=k[t];v=u.a;r=u.d-v;n=u.c-v;u=u.b-v;v=0;for(x=1;x<=w;x++)h=l*x,y=1-h,h=v-(v=(h*h*r+3*y*(h*n+y*u))*h),y=t*w+x-1,m[y]=(m[y]||0)+h*h}}b=j.length;for(f=0;f>0,e[k]=g,q[k]=p,s=0,g=[]);this._length=p;this._lengths=q;this._segments=e;this._l1=this._li=this._s1= this._si=0;this._l2=this._lengths[0];this._curSeg=this._segments[0];this._s2=this._curSeg[0];this._prec=1/this._curSeg.length}if(g=this._autoRotate){g[0]instanceof Array||(this._autoRotate=g=[g]);for(b=g.length;-1<--b;)for(f=0;3>f;f++)d=g[b][f],this._func[d]="function"===typeof a[d]?a[d.indexOf("set")||"function"!==typeof a["get"+d.substr(3)]?d:"get"+d.substr(3)]:!1}return!0};E.setRatio=function(a){var c=this._segCount,g=this._func,p=this._target,j,b,d,f,e;if(this._timeRes){j=this._lengths;f=this._curSeg; a*=this._length;b=this._li;if(a>this._l2&&b=a;);0===b&&athis._s2&&b=a;);0===b&&aa?0:1<=a?c-1:c*a>>0,f=(a-j*(1/c))*c;c=1-f;for(b=this._props.length;-1<--b;)if(a=this._props[b],d=this._beziers[a][j],e=(f*f*d.da+3*c*(f*d.ca+c*d.ba))*f+d.a,this._round[a]&&(e=e+(0>0),g[a])p[a](e);else p[a]=e;if(this._autoRotate){var c=this._autoRotate,k,q,s,n,m;for(b=c.length;-1<--b;)a=c[b][2],n=c[b][3]|| 0,m=!0===c[b][4]?1:I,d=this._beziers[c[b][0]][j],e=this._beziers[c[b][1]][j],k=d.a+(d.b-d.a)*f,q=d.b+(d.c-d.b)*f,k+=(q-k)*f,q+=(d.c+(d.d-d.c)*f-q)*f,d=e.a+(e.b-e.a)*f,s=e.b+(e.c-e.b)*f,d+=(s-d)*f,s+=(e.c+(e.d-e.c)*f-s)*f,e=Math.atan2(s-d,q-k)*m+n,g[a]?g[a].call(p,e):p[a]=e}};E._roundProps=function(a,c){for(var g=this._overwriteProps,p=g.length;-1<--p;)if(a[g[p]]||a.bezier||a.bezierThrough)this._round[g[p]]=c};E._kill=function(a){var c=this._props,g,p;for(g in this._beziers)if(g in a){delete this._beziers[g]; delete this._func[g];for(p=c.length;-1<--p;)c[p]===g&&c.splice(p,1)}return F.prototype._kill.call(this,a)};F.activate([z]);return z},!0)});window._gsDefine&&_gsQueue.pop()();