(function($) {
	$(function() {
 
  		$('.over1').opOver();
  		$('.over2').wink();
  		$('.over3').opOver(0.6,1.0);//初期の透明度と、マウスオーバーさせたときの色の濃さ
  		$('.over4').opOver(1.0,0.6,200,500);//初期の透明度と、マウスオーバーさせたときの色の濃さを指定の後で、その変化の速度
  		$('.over5').wink(200);
  		$('.over6').wink('slow',0.2,1.0);
 
	});
	
	$.fn.opOver = function(op,oa,durationp,durationa){
		
		var c = {
			op:op? op:1.0,
			oa:oa? oa:0,
			durationp:durationp? durationp:'normal',
			durationa:durationa? durationa:'normal'
		};
		

		$(this).each(function(){
			$(this).css({
				opacity: c.op,
				filter: "alpha(opacity="+c.op*100+")"
			}).hover(
				function(){
					$(this).stop(true,false).fadeTo(c.durationp,c.oa);
				},
				function(){
					$(this).stop(true,false).fadeTo(c.durationa,c.op);
				}
			)
		});
	},
	
	$.fn.wink = function(durationp,op,oa){

		var c = {
			durationp:durationp? durationp:'slow',
			op:op? op:1.0,
			oa:oa? oa:0.0
		};
		
		$(this).each(function(){
			$(this).css({
				opacity: c.op,
				filter: "alpha(opacity="+c.op*100+")"
			}).hover(
				function(){
					$(this).css({
						opacity: c.oa,
						filter: "alpha(opacity="+c.oa*100+")"
					});
					$(this).stop(true,false).fadeTo(c.durationp,c.op);
				},
				function(){
					$(this).css({
						opacity: c.op,
						filter: "alpha(opacity="+c.op*100+")"
					});
				}
			)
		});
	}
	
})(jQuery);
