
 
$(function(){
     $('a img').hover(function(){
        $(this).attr('src', $(this).attr('src').replace('_off', '_on'));
          }, function(){
             if (!$(this).hasClass('currentPage')) {
             $(this).attr('src', $(this).attr('src').replace('_on', '_off'));
        }
   });
});
//アコーディオン
$(function() {
   $('#accordion dd').hide();
   $('#accordion dt a').click(function(){
       $('#accordion dd').slideUp();
       $(this).parent().next().slideDown();
       return false;
   });
});


$(function(){

	function ImgOvAnimeFade(){

		var OvClass = "rollover", //ロールオーバーする要素のクラス名
		OvStr = "_ov", //ロールオーバー後の画像に追加する文字列
		OvImg = "ovImg",
		Speed = 300; //アニメーションの速度

		//classがrolloverのimg要素に対しての処理
		$("img."+OvClass).each(function(){

			var This = $(this),
			Url = This.attr("src").replace(/^(.+)(\.[a-z]+)$/,"$1"+OvStr+"$2");

			function OvElmLen(){ //ロールオーバー画像表示確認関数
				return This.prev("img."+OvImg).length;
			}

			//ホバーイベント
			This.hover(
			function(){
				if(!This.attr("src").match(OvStr+".")){
					if(!OvElmLen()){
						if(jQuery.support.checkOn && jQuery.support.htmlSerialize && !window.globalStorage){ //Operaバグ対策
							This.before("<span style='display:inline-block;' class='"+OvImg+"' ></span>");
						}
						This.css({position:"relative"}).before("<img style='position:absolute;' class='"+OvImg+"' src='"+Url+"' alt='' />");
					}
					This.stop().animate({opacity:"0"},Speed);
				}
			},
			function(){
				if(OvElmLen()){
					This.stop().animate({opacity:"1"},Speed,function(){
						This.css({position:"static"})
						.prevAll("."+OvImg).remove();
					});
				}
			})
			.each(function(){ //プリロード設定
				$("<img>").attr("src",Url);
			});

		});

	}

	ImgOvAnimeFade();

});



