﻿/**
Animation functions:
- adds functionality to animate wrapped set:
* @author    Jacob Stellingwerf <jacob.stellingwerf@infoprojects.nl>
*/
(function($){
 /*
  Chain functions down here
  */

 /*
  Override default fadeIn function, which doesn't work well
  */
  $.fn.fadeIn= function(speed, callback) {
		// default configuration options
		if (!speed) {
		  speed = "normal";
		}
    $(this).show().stop().animate({opacity: 1}, speed, callback);
        
    return $(this);
  };

 /*
  Override default fadeIn function, which doesn't 
  */
  $.fn.fadeOut= function(speed, callback) {
		// default configuration options
		if (!speed) {
		  speed = "normal";
		}
    $(this).stop().animate({opacity: 0}, speed, 
      function() {
        if ($.isFunction(callback)) {
          callback();
        }
        $(this).hide();
      }
    );
        
    return $(this);
  };

 /*
  Global functions down here
  */
  
})(jQuery);

