// ============================================================ 
// ロールオーバー
// ============================================================ 
var rollover = {
	swap:function(){
		jQuery("img.swap").each(function(i) {
			var imgsrc = this.src;
			var dot = imgsrc.lastIndexOf(".");
			var imgsrc_on = imgsrc.substr(0, dot) + '_on' + imgsrc.substr(dot, 4);
			jQuery("<img>").attr("src", imgsrc_on);
			
			if(!imgsrc.match("_on")) {
				jQuery(this).hover(
					function() { this.src = imgsrc_on; },
					function() { this.src = imgsrc; }
				);
			}
		});
	},
	
	bright:function(){
		jQuery("img.bright").mouseover(function(){
			jQuery(this).css({opacity: 0.25}).fadeTo(300, 1);
		});
	},
	
	alpha:function(){
		jQuery("img.alpha").hover(
			function() { jQuery(this).stop().fadeTo(250, 0.6); },
			function() { jQuery(this).stop().fadeTo(250, 1); }
		);
	}
}

jQuery(function() {
	rollover.swap();
	rollover.bright();
	rollover.alpha();
});

