-$.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';
+jQuery.fn.extend({
+
+ // overwrite the old show method
+ _show: jQuery.fn.show,
+
+ /**
+ * The effects module overloads the show method to now allow
+ * for a speed to the show operation. What actually happens is
+ * that the height, width, and opacity to the matched elements
+ * are changed dynamically. The only three current speeds are
+ * "slow", "normal", and "fast". For example:
+ * $("p").show("slow");
+ * Note: You should not run the show method on things
+ * that are already shown. This can be circumvented by doing this:
+ * $("p:hidden").show("slow");
+ */
+ 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,
+
+ /**
+ * The hide function behaves very similary to the show function,
+ * but is just the opposite.
+ * $("p:visible").hide("slow");
+ */
+ hide: function(speed,callback){
+ return speed ? this.animate({
+ height: "hide", width: "hide", opacity: "hide"
+ }, speed, callback) : this._hide();
+ },
+
+ /**
+ * This function increases the height and opacity for all matched
+ * elements. This is very similar to 'show', but does not change
+ * the width - creating a neat sliding effect.
+ * $("p:hidden").slideDown("slow");
+ */
+ slideDown: function(speed,callback){
+ return this.animate({height: "show"}, speed, callback);
+ },
+
+ /**
+ * Just like slideDown, only it hides all matched elements.
+ * $("p:visible").slideUp("slow");
+ */
+ slideUp: function(speed,callback){
+ return this.animate({height: "hide"}, speed, callback);
+ },
+
+ /**
+ * Adjusts the opacity of all matched elements from a hidden,
+ * to a fully visible, state.
+ * $("p:hidden").fadeIn("slow");
+ */
+ fadeIn: function(speed,callback){
+ return this.animate({opacity: "show"}, speed, callback);
+ },
+
+ /**
+ * Same as fadeIn, but transitions from a visible, to a hidden state.
+ * $("p:visible").fadeOut("slow");
+ */
+ fadeOut: function(speed,callback){
+ return this.animate({opacity: "hide"}, speed, callback);
+ },
+
+ /**
+ * ...
+ */
+ fadeTo: function(speed,to,callback){
+ return this.animate({opacity: to}, speed, callback);
+ },
+
+ /**
+ *
+ */
+ 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] ]();