(function ($) {
    $.fn.fadeRollover = function (options) {

        var settings = {
            'height': '25px',
            'width': '25px',
            'background_image': '',
            'background_repeat': 'no-repeat',
            'text_indent':'-9999px',
            'speed': 325
        };

        if (options) {
            $.extend(settings, options);
        }

        $(this).css({
            'text-indent': settings.text_indent,
            'vertical-align': 'middle',
            'text-align':'center',
            'width': settings.width,
            'height': settings.height,
            'display': 'block',
            'backgroundImage': 'url(' + settings.background_image + ')',
            'backgroundPosition': 'top left',
            'backgroundRepeat': settings.background_repeat
        });

        $(this).wrap('<span class="isParent"></span>');
        $(this).parent().css({
            'margin': '0px auto',
            'width': settings.width,
            'display': 'block',
            'backgroundImage': 'url(' + settings.background_image + ')',
            'backgroundPosition': '0 -' + settings.height,
            'backgroundRepeat': settings.background_repeat,
            'height': settings.height,
            'overflow': 'hidden'
        });

        $(this)
        	.css({ 'backgroundPosition': '0 0' })
        	.hover(
        	function () {
        	    $(this).stop().animate({
        	        'opacity': 0
        	    }, settings.speed);
        	},
        	function () {
        	    $(this).stop().animate({
        	        'opacity': 1
        	    }, settings.speed);
        	}
        );
    }
})(jQuery);
