+
+ // The element
+ z.el = el;
+
+ // The styles
+ var y = z.el.style;
+
+ // Simple function for setting a style value
+ z.a = function(){
+ z.el.style[ty] = z.now+'px';
+ };
+
+ // Figure out the maximum number to run to
+ z.max = function(){return z.el["$$orig"+ty]||z.cur();};
+
+ // Get the current size
+ z.cur = function(){return $.css(z.el,ty);};
+
+ // Start an animation from one number to another
+ z.custom = function(from,to){
+ z.startTime = (new Date()).getTime();
+ z.now = from;
+ z.a();
+
+ z.timer = setInterval(function(){
+ z.step(from, to);
+ }, 13);
+ };
+
+ // Simple 'show' function
+ z.show = function(){
+ y.display = "block";
+ z.o.auto = true;
+ z.custom(0,z.max());
+ };
+
+ // 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();
+ }
+ };
+
+ // IE has trouble with opacity if it doesn't have layout
+ if ( $.browser == "msie" && !z.el.currentStyle.hasLayout ) {
+ y.zoom = 1;
+ }
+
+ // 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){