// JavaScript Document

//background animation

$(function(){
	$(".box").hover(function() {
		$(this).stop().animate({ backgroundColor: "#000"}, 1000);
		},function() {
		$(this).stop().animate({ backgroundColor: "#fff" }, 1000);
		});
});

//mesonry
$(function(){  
	$('#content').masonry({
  itemSelector: '.box',
  isAnimated: true,
  animationOptions: {
    duration: 750,
    easing: 'linear',
    queue: false
  }
});
});

//totop
jQuery(document).ready(function(){

	// hide #back-top first
	jQuery("#back-top").hide();
	
	// fade in #back-top
	jQuery(function () {
		jQuery(window).scroll(function () {
			if (jQuery(this).scrollTop() > 100) {
				jQuery('#back-top').fadeIn();
			} else {
				jQuery('#back-top').fadeOut();
			}
		});

		// scroll body to 0px on click
		jQuery('#back-top a').click(function () {
			jQuery('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});

});

//imagecaption
$(function(){
				$('#content img').jcaption({
					copyStyle: false,
					animate: true, /* アニメーションの有無 */
					show: {height: "show"},
					hide: {height: "hide"}
				});
		});
