(function($){
	$.fn.changeImage = function(url, speed) {
		if (!speed) {
			speed = 'normal';
		}
		
		return this.each(function() {
			if ($(this).is(':animated')) {
				$(this).stop();
			}
			
			$(this).animate(
				{ opacity: 0 },
				{ duration: speed, complete: function() { showImage(this) } }
			);
			
			var showImage = function(element) {
				$(element).css('backgroundImage', 'url(' + url + ')').animate(
					{ opacity: 1 },
					{ duration: speed }
				);
			}
		});
		
			
	}
})(jQuery);
