﻿(function($){
	$.fn.hoverOpacity = function(options) {
		var defaults = {
			 targetOpacity: 0.4,
			 defaultOpacity: 1,
			 speed:400,
			 easing:'swing'
		};
		var env = $.extend(defaults, options);//setting

		this.each(function() {
			$(this).hover(function() {
				$(this).animate({'opacity':env.targetOpacity}, env.speed, env.easing);
			}, function() {
				$(this).animate({'opacity':env.defaultOpacity}, env.speed, env.easing);
			});
		});

		return this;
	};
})(jQuery);
