-$.speed = function(s,o) {
- if ( o && o.constructor == Function ) o = { onComplete: o };
- o = o || {};
- var ss = {"crawl":1200,"xslow":850,"slow":600,"medium":400,"fast":200,"xfast":75,"normal":400};
- o.duration = typeof s == "number" ? s : ss[s] || 400;
- return o;
-};
-
-$.fn.hide = function(a,o) {
- o = $.speed(a,o);
- return a ? this.each(function(){
- new fx.FadeSize(this,o).hide();
- }) : this._hide();
-};
-
-$.fn.show = function(a,o) {
- o = $.speed(a,o);
- return a ? this.each(function(){
- new fx.FadeSize(this,o).show();
- }) : this._show();
-};
-
-$.fn.slideDown = function(a,o) {
- o = $.speed(a,o);
- return this.each(function(){
- new fx.Resize(this,o).show("height");
- });
-};
-
-$.fn.slideUp = function(a,o) {
- o = $.speed(a,o);
- return this.each(function(){
- new fx.Resize(this,o).hide("height");
- });
-};
-
-$.fn.fadeOut = function(a,o) {
- o = $.speed(a,o);
- return a ? this.each(function(){
- new fx.Opacity(this,o).hide();
- }) : this._hide();
-};
-
-$.fn.fadeIn = function(a,o) {
- o = $.speed(a,o);
- return a ? this.each(function(){
- new fx.Opacity(this,o).show();
- }) : this._show();
-};
-
-$.fn.center = function(f) {
- return this.each(function(){
- if ( !f && this.nodeName == 'IMG' &&
- !this.offsetWidth && !this.offsetHeight ) {
- var self = this;
- setTimeout(function(){
- $(self).center(true);
- }, 13);
- } else {
- var s = this.style;
- var p = this.parentNode;
- if ( $.css(p,"position") == 'static' )
- p.style.position = 'relative';
- s.position = 'absolute';
- s.left = parseInt(($.css(p,"width") - $.css(this,"width"))/2) + "px";
- s.top = parseInt(($.css(p,"height") - $.css(this,"height"))/2) + "px";
+jQuery.fn.extend({
+
+ // overwrite the old show method
+ //_show: jQuery.fn.show,
+
+ /**
+ * Show all matched elements using a graceful animation.
+ * The height, width, and opacity of each of the matched elements
+ * are changed dynamically according to the specified speed.
+ *
+ * @example $("p").show("slow");
+ *
+ * @name show
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ */
+
+ /**
+ * Show all matched elements using a graceful animation and firing a callback
+ * function after completion.
+ * The height, width, and opacity of each of the matched elements
+ * are changed dynamically according to the specified speed.
+ *
+ * @example $("p").show("slow",function(){
+ * alert("Animation Done.");
+ * });
+ *
+ * @name show
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ * @param Function callback A function to be executed whenever the animation completes.
+ */
+ show: function(speed,callback){
+ return speed ? this.animate({
+ height: "show", width: "show", opacity: "show"
+ }, speed, callback) : this._show();
+ },
+
+ // Overwrite the old hide method
+ //_hide: jQuery.fn.hide,
+
+ /**
+ * Hide all matched elements using a graceful animation.
+ * The height, width, and opacity of each of the matched elements
+ * are changed dynamically according to the specified speed.
+ *
+ * @example $("p").hide("slow");
+ *
+ * @name hide
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ */
+
+ /**
+ * Hide all matched elements using a graceful animation and firing a callback
+ * function after completion.
+ * The height, width, and opacity of each of the matched elements
+ * are changed dynamically according to the specified speed.
+ *
+ * @example $("p").hide("slow",function(){
+ * alert("Animation Done.");
+ * });
+ *
+ * @name hide
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ * @param Function callback A function to be executed whenever the animation completes.
+ */
+ hide: function(speed,callback){
+ return speed ? this.animate({
+ height: "hide", width: "hide", opacity: "hide"
+ }, speed, callback) : this._hide();
+ },
+
+ /**
+ * Reveal all matched elements by adjusting their height.
+ * Only the height is adjusted for this animation, causing all matched
+ * elements to be revealed in a "sliding" manner.
+ *
+ * @example $("p").slideDown("slow");
+ *
+ * @name slideDown
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ */
+
+ /**
+ * Reveal all matched elements by adjusting their height and firing a callback
+ * function after completion.
+ * Only the height is adjusted for this animation, causing all matched
+ * elements to be revealed in a "sliding" manner.
+ *
+ * @example $("p").slideDown("slow",function(){
+ * alert("Animation Done.");
+ * });
+ *
+ * @name slideDown
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ * @param Function callback A function to be executed whenever the animation completes.
+ */
+ slideDown: function(speed,callback){
+ return this.animate({height: "show"}, speed, callback);
+ },
+
+ /**
+ * Hide all matched elements by adjusting their height.
+ * Only the height is adjusted for this animation, causing all matched
+ * elements to be hidden in a "sliding" manner.
+ *
+ * @example $("p").slideUp("slow");
+ *
+ * @name slideUp
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ */
+
+ /**
+ * Hide all matched elements by adjusting their height and firing a callback
+ * function after completion.
+ * Only the height is adjusted for this animation, causing all matched
+ * elements to be hidden in a "sliding" manner.
+ *
+ * @example $("p").slideUp("slow",function(){
+ * alert("Animation Done.");
+ * });
+ *
+ * @name slideUp
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ * @param Function callback A function to be executed whenever the animation completes.
+ */
+ slideUp: function(speed,callback){
+ return this.animate({height: "hide"}, speed, callback);
+ },
+
+ /**
+ * Fade in all matched elements by adjusting their opacity.
+ * Only the opacity is adjusted for this animation, meaning that
+ * all of the matched elements should already have some form of height
+ * and width associated with them.
+ *
+ * @example $("p").fadeIn("slow");
+ *
+ * @name fadeIn
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ */
+
+ /**
+ * Fade in all matched elements by adjusting their opacity and firing a
+ * callback function after completion.
+ * Only the opacity is adjusted for this animation, meaning that
+ * all of the matched elements should already have some form of height
+ * and width associated with them.
+ *
+ * @example $("p").fadeIn("slow",function(){
+ * alert("Animation Done.");
+ * });
+ *
+ * @name fadeIn
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ * @param Function callback A function to be executed whenever the animation completes.
+ */
+ fadeIn: function(speed,callback){
+ return this.animate({opacity: "show"}, speed, callback);
+ },
+
+ /**
+ * Fade out all matched elements by adjusting their opacity.
+ * Only the opacity is adjusted for this animation, meaning that
+ * all of the matched elements should already have some form of height
+ * and width associated with them.
+ *
+ * @example $("p").fadeOut("slow");
+ *
+ * @name fadeOut
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ */
+
+ /**
+ * Fade out all matched elements by adjusting their opacity and firing a
+ * callback function after completion.
+ * Only the opacity is adjusted for this animation, meaning that
+ * all of the matched elements should already have some form of height
+ * and width associated with them.
+ *
+ * @example $("p").fadeOut("slow",function(){
+ * alert("Animation Done.");
+ * });
+ *
+ * @name fadeOut
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ * @param Function callback A function to be executed whenever the animation completes.
+ */
+ fadeOut: function(speed,callback){
+ return this.animate({opacity: "hide"}, speed, callback);
+ },
+
+ /**
+ * Fade the opacity of all matched elements to a specified opacity.
+ * Only the opacity is adjusted for this animation, meaning that
+ * all of the matched elements should already have some form of height
+ * and width associated with them.
+ *
+ * @example $("p").fadeTo("slow", 0.5);
+ *
+ * @name fadeTo
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ * @param Number opacity The opacity to fade to (a number from 0 to 1).
+ */
+
+ /**
+ * Fade the opacity of all matched elements to a specified opacity and
+ * firing a callback function after completion.
+ * Only the opacity is adjusted for this animation, meaning that
+ * all of the matched elements should already have some form of height
+ * and width associated with them.
+ *
+ * @example $("p").fadeTo("slow", 0.5, function(){
+ * alert("Animation Done.");
+ * });
+ *
+ * @name fadeTo
+ * @type jQuery
+ * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
+ * @param Number opacity The opacity to fade to (a number from 0 to 1).
+ * @param Function callback A function to be executed whenever the animation completes.
+ */
+ fadeTo: function(speed,to,callback){
+ return this.animate({opacity: to}, speed, callback);
+ },
+
+ /**
+ * @private
+ */
+ animate: function(prop,speed,callback) {
+ return this.queue(function(){
+ var i = 0;
+ for ( var p in prop ) {
+ var e = new jQuery.fx( this, jQuery.speed(speed,callback,i++), p );
+ if ( prop[p].constructor == Number )
+ e.custom( e.cur(), prop[p] );
+ else
+ e[ prop[p] ]( prop );
+ }
+ });
+ },
+
+ /**
+ *
+ * @private
+ */
+ queue: function(type,fn){
+ if ( !fn ) {
+ fn = type;
+ type = "fx";