-}
-fx.fn = ["show","hide","toggle"];
-fx.ty = ["Height","Width","Left","Top"];
-for(var i in fx.ty){(function(){
- var c = fx.ty[i];
- fx[c] = function(a,b){
- return new fx(a,b,c.toLowerCase(),c);};
-})()}
-fx.Opacity = function(a,b){
- var o = new fx(a,b,"opacity");
+
+ // Simple 'hide' function
+ z.hide = function(){
+ // Remember where we started, so that we can go back to it later
+ z.el["$$orig"+ty] = this.cur();
+
+ // Begin the animation
+ z.custom(z.cur(),0);
+ };
+
+ // Toggle between showing and hiding an element
+ z.toggle = function(){
+ if ( z.cur() > 0 ) {
+ z.hide();
+ } else {
+ z.show();
+ }
+ };
+
+ // Remember the overflow of the element
+ z.oldOverflow = y.overflow;
+
+ // Make sure that nothing sneaks out
+ y.overflow = "hidden";
+
+ // Each step of an animation
+ z.step = function(firstNum, lastNum){
+ var t = (new Date()).getTime();
+
+ if (t > z.o.duration + z.startTime) {
+ // Stop the timer
+ clearInterval(z.timer);
+ z.timer = null;
+
+ // Reset the overflow
+ y.overflow = z.oldOverflow;
+
+ // If the element is, effectively, hidden - hide it
+ if( y.height == "0px" || y.width == "0px" ) {
+ y.display = "none";
+ }
+
+ // If the element was shown, and not using a custom number,
+ // set its height and width to auto
+ if ( ty != "opacity" && z.o.auto ) {
+ $.setAuto( z.el, 'height' );
+ $.setAuto( z.el, 'width' );
+ }
+
+ // If a callback was provided, execute it
+ if( z.o.onComplete.constructor == Function ) {
+ $.apply( z.el, z.onComplete );
+ }
+ } else {
+ // Figure out where in the animation we are and set the number
+ var p = (t - this.startTime) / z.o.duration;
+ z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum;
+
+ // Perform the next step of the animation
+ z.a();
+ }
+ };
+
+};
+
+$.fx.fn = ["show","hide","toggle"];
+$.fx.ty = ["Height","Width","Left","Top"];
+
+(function(){
+ for(var $i in $.fx.ty){(function(){
+ var c = $.fx.ty[$i];
+ $.fx[c] = function(a,b){
+ return new $.fx(a,b,c.toLowerCase());
+ };
+ })();}
+})();
+
+$.fx.Opacity = function(a,b,sv){
+ var o = new $.fx(a,b,"opacity");