$(document).ready(function(){

  $('dd a img')
    .mouseover(function(){
        $(this).animate({opacity: 0.6}, 'fast');
    })
    .mouseout(function(){
        $(this).animate({opacity: 1.0}, 'fast');
    });
	
  $('dd a strong')
    .mouseover(function(){
        $(this).parent().animate({opacity: 0.6}, 'fast');
    })
    .mouseout(function(){
        $(this).parent().animate({opacity: 1.0}, 'fast');
    });
	
	$('.top-image div a img')
    .mouseover(function(){
        $(this).animate({opacity: 0.6}, 'fast');
    })
    .mouseout(function(){
        $(this).animate({opacity: 1.0}, 'fast');
    });
	
	$(function(){     $(".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"));     }) })

});

//選択商品を表示する
function imgChange(num){
var imgAdd = document.forms[0].getElementsByTagName('select');
var tImgBox = document.getElementById('imgBox')
var targetImg = tImgBox.getElementsByTagName('img');

var targetOpa = 0;

	function imgOpa() {
		if (targetOpa <= 10){
			targetOpa ++;
			// Internet Explorer
			targetImg[num].style.filter = 'alpha(opacity=' +targetOpa*10+ ')';
			// Firefox
			targetImg[num].style.MozOpacity = targetOpa/10;
			// WebKit
			targetImg[num].style.opacity = targetOpa/10;
		}
		targetImg[num].src = './img/' + imgAdd[num].value+ '.jpg';
		setTimeout(imgOpa, 80);
	}
	imgOpa();
}
