﻿
$(function(){
	
	/******************************************************************//*
	 * ロールーバー
	 * rollover クラスが設定されてるアイテムにイベントを設定する
	 */
	
	$("img.rollover").mouseover(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
	}).mouseout(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
	}).each(function(){
		$("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
	})
	
	/******************************************************************//*
	 * アルファロールーバー
	 * alpha-rv クラスが設定されてるアイテムにイベントを設定する
	 */
	$.fn.alphaOver = function(){
		$(this).each(function(){
			$(this).css({
				opacity: 1,
				filter: 'alpha(opacity=' + 1*100 + ')'
			}).hover(function(){
				$(this).fadeTo(250, 0.65);
			}, function(){
				$(this).fadeTo(200, 1);
			})
		});
	}
	$('.alphaOver').alphaOver();
})