(function($) {
  $.fn.thumbnail_highlighter = function(options){
    // default settings
    var settings = {
      className : 'hover'
    };
    //extending options
    options = options || {};
    $.extend(settings, options);
    
    this.each(function(i){
      $(i).find('li').each(function(){
        $(this).removeClass('hover').prepend('<span class="hover" />');
        var span = $('> span.hover', this).css({'opacity': 1});
        $(this).hover(function () {
          span.stop().fadeTo(500, 0);
        }, function () {
          if(!span.parent('li').hasClass('selected')){
            span.stop().fadeTo(1200, 1);
          }
        });
      });
    });
  }
})(jQuery);

