/*
 * jQuery compatFade plugin
 * 
 * Provides a compatibility wrapper for the fadeIn and fadeOut functions
 * for user agents without support for opacity (Hello, IE)
 *
 * Author: Benjamin Wilfing / 4wd media, benjamin.wilfing@4wdmedia.de
 *
 * Usage:
 *
 * compatFadeIn( speed, [callback] )
 * Returns: jQuery
 * 
 * compatFadeOut( speed, [callback] )
 * Returns: jQuery
 * 
 * Use the functions $.compatFadeIn and $.compatFadeOut instead of
 * $.fadeIn and $fadeOut whenever and wherever you have PNGs with an alpha
 * channel set as the background image of an element.
 * 
 *
 * TODO: Overwrite the original fadeIn and fadeOut
 *
 */
 
(function($) {
	$.fn.compatFadeIn = function(speed, callback) {
		return this.each(function() {
			var $this = $(this);
			if (jQuery.support.opacity) $this.fadeIn(speed, callback)
			else $this.show(callback);
		});
	};
	
	$.fn.compatFadeOut = function(speed, callback) {
		return this.each(function() {
			var $this = $(this);
			if (jQuery.support.opacity) $this.fadeOut(speed, callback)
			else $this.hide(callback);
		});
	};
})(jQuery);