/* * JSTween JavaScript Library v1.2 * http://www.jstween.org/ * * Copyright 2011, Marco Wolfsheimer * JSTween by Marco Wolfsheimer is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. * * Date: Sun Mar 13 12:46:40 2011 -0000 */ var JSTween=function(m){var V=/[\-]{0,1}[0-9\.]{1,}|#[0-9\.abcdef]{3,6}/gi,W=/[pxemtcin%]{1,2}|deg/gi,A=/[0-9\.\-]{1,}/gi,ga=/[0-9a-f]{3,6}/gi,ha=/^#/,ia=/^[0-9\.\-]{1,}([pxemtcin%]{1,2}|deg)$/,ja=/^rgb\(/,X=/^scroll/,Y=/-([a-z])/ig,Z=/^-ms/ig,k={opacity:["opacity","-moz-opacity","filter"],shadow:["box-shadow","-moz-box-shadow","-o-box-shadow","-ms-box-shadow","-webkit-box-shadow"],transform:["-moz-transform","transform","-o-transform","-ms-transform","-webkit-transform"],transformOrigin:["-moz-transform-origin", "transform-origin","-o-transform-origin","-ms-transform-origin","-webkit-transform-origin"],borderRadius:["-moz-border-radius","border-radius","-webkit-border-radius"],borderRadiusTopLeft:["-moz-border-radius-topleft","border-top-left-radius","-webkit-border-top-left-radius"],borderRadiusTopRight:["-moz-border-radius-topright","border-top-right-radius","-webkit-border-top-right-radius"],borderRadiusBottomLeft:["-moz-border-radius-bottomleft","border-bottom-left-radius","-webkit-border-bottom-left-radius"], borderRadiusBottomRight:["-moz-border-radius-bottomright","border-bottom-right-radius","-webkit-border-bottom-right-radius"],backgroundSize:["background-size","-moz-background-size","-o-background-size","-webkit-background-size"]},h={},l=[],q=0,L=0,B=!1,C=!1,$=0,n={},ka=/iPad/i.test(navigator.userAgent)||/iPhone OS/i.test(navigator.userAgent),la=function(){var a=jQuery.fn;jQuery.JSTween=m;a.tween=function(a){var b,d=this.length;for(b=0;bg&&(g=e[t].end);h=g;for(t in e)e.hasOwnProperty(t)&&e[t].timeL&&(L=d)}"function"===typeof c.onStart&&(e=q+Math.round(h*n.frameRate),x(e,b,"callback",!1,!1,c.onStart,!0));if("function"===typeof c.onFrame)for(e=q+Math.round(h*n.frameRate);e<=q+Math.round(g*n.frameRate);e++)x(e,b,"callback",!1,!1, c.onFrame,!0);"function"===typeof c.onStop&&(e=q+Math.round(g*n.frameRate),x(e,b,"callback",!1,!1,c.onStop,!0))},x=function(a,c,b,d,f,e,g){void 0!==c?(void 0===h[a]?(h[a]={},h[a][c]={},h[a][c][b]={value:d,units:f,callback:[],skip:g}):void 0===h[a][c]?(h[a][c]={},h[a][c][b]={value:d,units:f,callback:[],skip:g}):void 0===h[a][c][b]?h[a][c][b]={value:d,units:f,callback:[],skip:g}:(!1!==d&&(h[a][c][b].value=d),!1!==f&&(h[a][c][b].units=f),h[a][c][b].skip=g),"function"===typeof e&&h[a][c][b].callback.push(e)): void 0===h[a]&&(h[a]={})},E=function(a){!1===B&&(B=!0,$=(new Date).getTime(),C=a,ea())},J=function(a,c){var b;if(void 0!==a&&void 0!==c&&void 0!==a.__animate)for(b in h)h.hasOwnProperty(b)&&void 0!==h[b][a.__animate.id]&&void 0!==h[b][a.__animate.id][c]&&delete h[b][a.__animate.id][c];else if(void 0!==a&&void 0!==a.__animate)for(b in h)h.hasOwnProperty(b)&&void 0!==h[b][a.__animate.id]&&delete h[b][a.__animate.id];else for(b in h)h.hasOwnProperty(b)&&delete h[b]},ea=function(){var a,c,b,d;if(q<=L){d= n.frameDelay-((new Date).getTime()-$-q*n.frameDelay);0>d?d=0:d>n.frameDelay&&(d=n.frameDelay);setTimeout(function(){ea(d?!0:!1)},d);for(c in h[q])if(h[q].hasOwnProperty(c))for(b in a=h[q][c],a)a.hasOwnProperty(b)&&O(c,b,a[b].value,a[b].units,a[b].callback,!0===a[b].skip?!0:d?!0:!1);delete h[q];q++;(new Date).getTime()}else B=!1,q=0,"function"===typeof C&&(C(),C=!1)},O=function(a,c,b,d,f,e){var g=l[a].__animate.state[c];if(!0===e&&!1!==b&&(void 0===g||g.value!=b||g.units!=d))switch(c){case "zIndex":l[a].style.zIndex= b;break;case "alpha":case "transparency":case "opacity":F(l[a],b);break;case "scroll":case "scrollTop":case "scrollLeft":case "scrollTo":fa(l[a],c,b);break;case "shadow":case "boxShadow":T(l[a],b);break;case "rotate":N(l[a],b);break;case "transformOrigin":R(l[a],b);break;case "transform":Q(l[a],b);break;case "backgroundSize":S(l[a],b);break;case "borderRadius":U(l[a],b,d);break;case "borderRadiusTopRight":r(l[a],"top","right",b,d);break;case "borderRadiusTopLeft":r(l[a],"top","left",b,d);break;case "borderRadiusBottomRight":r(l[a], "bottom","right",b,d);break;case "borderRadiusBottomLeft":r(l[a],"bottom","left",b,d);break;default:l[a].style[c]="string"===typeof b?b:b+d}l[a].__animate.state[c]={value:b,units:d};if(void 0!==f&&0(a/=d/2)?b/2*a*a+c:-b/2*(--a*(a-2)-1)+c},cubicIn:function(a,c,b,d){return b*(a/=d)*a*a+c},cubicOut:function(a,c,b,d){return b*((a=a/d-1)*a*a+1)+c},cubicInOut:function(a,c,b,d){return 1>(a/=d/2)?b/2*a*a*a+c:b/2*((a-=2)*a* a+2)+c},easeIn:function(a,c,b,d){return b*(a/=d)*a*a+c},easeOut:function(a,c,b,d){return b*((a=a/d-1)*a*a+1)+c},easeInOut:function(a,c,b,d){return 1>(a/=d/2)?b/2*a*a*a+c:b/2*((a-=2)*a*a+2)+c},quartIn:function(a,c,b,d){return b*(a/=d)*a*a*a+c},quartOut:function(a,c,b,d){return-b*((a=a/d-1)*a*a*a-1)+c},quartInOut:function(a,c,b,d){return 1>(a/=d/2)?b/2*a*a*a*a+c:-b/2*((a-=2)*a*a*a-2)+c},quintIn:function(a,c,b,d){return b*(a/=d)*a*a*a*a+c},quintOut:function(a,c,b,d){return b*((a=a/d-1)*a*a*a*a+1)+c}, quintInOut:function(a,c,b,d){return 1>(a/=d/2)?b/2*a*a*a*a*a+c:b/2*((a-=2)*a*a*a*a+2)+c},sineIn:function(a,c,b,d){return-b*Math.cos(a/d*(Math.PI/2))+b+c},sineOut:function(a,c,b,d){return b*Math.sin(a/d*(Math.PI/2))+c},sineInOut:function(a,c,b,d){return-b/2*(Math.cos(Math.PI*a/d)-1)+c},expoIn:function(a,c,b,d){return 0===a?c:b*Math.pow(2,10*(a/d-1))+c},expoOut:function(a,c,b,d){return a===d?c+b:b*(-Math.pow(2,-10*a/d)+1)+c},expoInOut:function(a,c,b,d){return 0===a?c:a===d?c+b:1>(a/=d/2)?b/2*Math.pow(2, 10*(a-1))+c:b/2*(-Math.pow(2,-10*--a)+2)+c},circIn:function(a,c,b,d){return-b*(Math.sqrt(1-(a/=d)*a)-1)+c},circOut:function(a,c,b,d){return b*Math.sqrt(1-(a=a/d-1)*a)+c},circInOut:function(a,c,b,d){return 1>(a/=d/2)?-b/2*(Math.sqrt(1-a*a)-1)+c:b/2*(Math.sqrt(1-(a-=2)*a)+1)+c},bounceIn:function(a,c,b,d){return b-I.bounceOut(d-a,0,b,d)+c},bounceOut:function(a,c,b,d){return(a/=d)<1/2.75?7.5625*b*a*a+c:a<2/2.75?b*(7.5625*(a-=1.5/2.75)*a+.75)+c:a<2.5/2.75?b*(7.5625*(a-=2.25/2.75)*a+.9375)+c:b*(7.5625* (a-=2.625/2.75)*a+.984375)+c},bounceInOut:function(a,c,b,d){return aa?-.5*f*Math.pow(2,10*--a)*Math.sin(2*(a*d-g)*Math.PI/e)+c:f*Math.pow(2,-10*--a)*Math.sin(2*(a*d-g)*Math.PI/e)*.5+b+c}};m.tween=aa;m.action=O;m.register=P;m.shadow=T;m.opacity=F;m.borderRadius=U;m.borderRadiusCorner=r;m.backgroundSize=S;m.transformOrigin= R;m.rotate=N;m.transform=Q;m.clear=J;m.play=E;m.property=M;m.getScroll=ca;m.scroll=fa;m.framerate=D;D(ka?30:45);(function(){var a=document.getElementsByTagName("html"),c;if(void 0!==a[0])for(c in a=a[0].style,k)if(k.hasOwnProperty(c))for(var b=0;b