(function($) {

$.fn.rollover = function(settings) {
    //default settings
    var defaults = {over:"_over", current:"_current", classname:"current"};
    settings = $.extend({}, defaults, settings);

    return this.each(function() {
        
        if ($(this).attr('class') == settings.classname) {
            $(this).attr('src', $(this).attr('src').replace('.gif', settings.current + '.gif'));
        }
        
        $(this).hover(function(){
    		this.src = this.src.replace(new RegExp('(' + settings.current + ')?\.gif$', 'g'), settings.over + '.gif');
    	},function(){
    		if ($(this).attr('class') == settings.classname) {
    		    $(this).attr('src', $(this).attr('src').replace(settings.over + '.gif', settings.current + '.gif'));
    		}
    		else {
    		    this.src = this.src.replace(settings.over,'');
    		}
    	});
    });
};

})(jQuery);
