/*
------- FADE TOGGLE Plugin ------------
@author Jeremy Schwartz
@date 2010-02-19
@help http://addictedtonew.com/archives/414/creating-a-jquery-plugin-from-scratch/
@help http://docs.jquery.com/Plugins/Authoring
@help http://trulyevil.com/2009/05/01/eexpanding-the-jquery-plugin-development-pattern/
@help http://blog.pengoworks.com/index.cfm/2008/2/6/jQuery-fadeToggle-plugin
*/
; (function($) {
	$.fn.fadeToggle = function(opts, callback) {

		//allow options
		var options = $.extend({}, $.fn.fadeToggle.defaults, opts);

		// apply plugin functionality to each element
		return this.each(function() {
			var actor = $(this);
			actor.animate({ opacity: 'toggle' }, options.speed, options.easing, callback);
			//actor.fadeTo(options.speed, Math.abs(1 - actor.css('opacity')));
		});
	};

	//default options
	$.fn.fadeToggle.defaults = { speed: 'slow', easing: 'swing' };
})(jQuery);
