;(function($){

    $.fn.Rollover = function(options) {

        var o = $.extend({}, $.fn.Rollover.defaults, options);
        return this.each(function(){
		   var t = $(this);
		   t.find('a').each(function(){
				if ($(this).find('img').attr('src').indexOf(o.over) != -1)
					$(this).attr('rel','over');
				else
					$(this).attr('rel','on');
				var img = new Image();
				img.src = $(this).find('img').attr('src').replace(o.on,o.over);				
				if ($(this).attr('rel')=='over') $(this).find('img').attr('src',img.src);	
		   });
		   t.find('a').hover(function(){
				if ($(this).attr('rel')=='on'){
				   var im = $(this).find('img');
				   im.attr('src',   im.attr('src').replace(o.on,o.over)   );
				}
		   },function(){
				if ($(this).attr('rel')=='on'){
				  	var im = $(this).find('img');
					im.attr('src',   im.attr('src').replace(o.over,o.on)   );
				}
		   });   
        });
    };

    $.fn.Rollover.defaults = {
        on : '-0.png',
		over : '-1.png'
    };

})(jQuery);
