$(document).ready(function() {

	$.fn.fadehover = function() {

		$(this).each(function() {

			console.log($(this));
			
			var image_url_1 = $(this).attr('src');
			var image_url_2 = $(this).data('alt');
			$(this).data('alt', null);

			$(this).wrap('<div style="position: relative; float:left; margin-left: 3px;" />');

			
			$(this).css({
				position: 'absolute',
				left: 0,
				top: 0,
				'z-index': 10
			});

			$(this).after('<img src="' + image_url_2 + '" style="position: left: top: 0;" />');

			$(this).hover(
				function() {
					$(this).stop().animate({"opacity": "0"}, 300);
				}, 
				function() {
					$(this).stop().animate({"opacity": "1"}, 300);
			
				}
			);

		});

	};


	$('img.fadehover').fadehover();


});

