/** * Ajustes de jQuery. * @version 1 * @author Pablo Viojo */ jQuery.extend({ getScript: function( url, callback ) { return jQuery.get(url, null, callback, "script", 0, true); }, param: function( a ) { var s = []; // If an array was passed in, assume that it is an array // of form elements if ( a.constructor == Array || a.jquery ) // Serialize the form elements jQuery.each( a, function(){ s.push( escape(this.name) + "=" + escape( this.value ) ); }); // Otherwise, assume that it's an object of key/value pairs else // Serialize the key/values for ( var j in a ) // If the value is an array then the key names need to be repeated if ( a[j] && a[j].constructor == Array ) jQuery.each( a[j], function(){ s.push( escape(j) + "=" + escape( this ) ); }); else s.push( escape(j) + "=" + escape( a[j] ) ); // Return the resulting serialization return s.join("&"); } }); jQuery.fn.extend({ fadeIn: function(speed, callback){ if ($.browser.msie){ if (jQuery(this).css('opacity')==0){ jQuery(this).css({opacity:1}); } return this.show(1,callback); } else { return this.animate({opacity: "show"}, speed, callback); } }, fadeOut: function(speed, callback){ if ($.browser.msie){ $(this).hide(1,callback); return this; } else { return this.animate({opacity: "hide"}, speed, callback); } } });