// スムーススクロール
jQuery.easing.quart = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};  
$(document).ready(function(){
  $('a[href*=#]').click(function() {
    if (this.href.match('#calendar')) {
      return false;
    } else {
      if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
      && location.hostname == this.hostname) {
        var $target = $(this.hash);
        $target = $target.length && $target
        || $('[name=' + this.hash.slice(1) +']');
        if ($target.length) {
          var targetOffset = $target.offset().top;
          $('html,body')
          .animate({scrollTop: targetOffset}, 600, 'quart');
         return false;
        }
      }
    }
  });
});



// マウスオーバー画像切替
(function ($) {
  $(function(){
    load_event();
  });

})(jQuery);

/*image rollover*/
var load_event = function(){
  $('a>img[src*="_out"],input[src*="_out"]').each(function(){
    var $$ = $(this);
    $$.mouseover(function(){ $(this).attr('src', $(this).attr('src').replace(/_out/,'_on')) });
    $$.mouseout (function(){
      if ( $(this).attr('wws') != 'current' ) { $(this).attr('src', $(this).attr('src').replace(/_on/,'_out')) }
    });
  });

}



// 84の疑問
$(function(){
	$(".answer")
		.hide();
	$(".question a")
		.click(function(){
			$(this)
				.parent()
				.parent()
				.find(".answer")
				.slideToggle();
		});
});


// 前文
$(function(){
	$(".preface .body")
		.hide();
	$(".preface .title a")
		.click(function(){
		  $(".preface .body")
		  .slideToggle();
		});
});



