$(document).ready(function() {
	$("div#flipbanner").hover(function() {
		$("div#flipbanner img").stop().animate({
			width: '300px',
			height: '315px'
		}, 300)
		$("div.facebook_like").stop().animate({
			width: '300px',
			height: '300px'
		}, 300,function(){
			$("div.facebook_like").css({textIndent:'25px',paddingTop:'3px',zIndex:'200'});
			
	});
	}, function() {
		$("div.facebook_like").css({textIndent:'-9999px',paddingTop:'0px',zIndex:'90'});
		$("div#flipbanner img").stop().animate({
			width: '60px',
			height: '62px'
		}, 200);
		$("div.facebook_like").stop().animate({
			width: '60px',
			height: '60px'
		}, 200);
	});
	$("nav li.on").each(function() {
		$(this).append("<span></span>")
	}).hover(function() {
		$(this).find("span").stop(true).animate({
			height: '100%'
		}, 150).css("cursor", "pointer")
	}, function() {
		$(this).find("span").stop(true).animate({
			height: '0'
		}, 200)
	}).click(function() {
		window.location = $(this).find("a").attr("href");
		return false
	});
	$(".thumb img").hover(function() {
		$(this).fadeTo("slow", 0)
	}, function() {
		$(this).fadeTo("slow", 1.0)
	});
	$("section.contactbtn a").hover(function() {
		$(this).fadeTo("slow", 0)
	}, function() {
		$(this).fadeTo("fast", 1.0)
	});
	$("aside.feature li").each(function() {
		$(this).append("<span></span>")
	}).hover(function() {
		$(this).find("span").stop(true).animate({
			width: '100%'
		}, 150).css("cursor", "pointer")
	}, function() {
		$(this).find("span").stop(true).animate({
			width: '0'
		}, 250)
	}).click(function() {
		window.location = $(this).find("a").attr("href");
		return false
	});
	$("#works .columns li").each(function() {
		$(this).append("<span></span>")
	}).hover(function() {
		$(this).find("span").stop(true).fadeTo("slow", 1.0).css({zIndex:"999",cursor:"default"})
	}, function() {
		$(this).find("span").stop(true).fadeTo("slow", 0).css("z-index", "0");
	});
	$('#submit').mouseover(function() {
		$(this).css({
			backgroundPosition: "0 -75px",
			cursor: "pointer"
		})
	}).mouseout(function() {
		$(this).css({
			backgroundPosition: "0 0"
		})
	})
});

function formaction(form, options) {
	$('#contactbox').ajaxSubmit({
		beforeSubmit: function() {
			$('#contactbox').after('<img class="loading-ajax" src="/contact/images/loading.gif" alt="Loading" />');
			$('html,body').animate({
				scrollTop: $('footer').offset().top
			}, 1100)
		},
		url: 'process.php',
		success: function() {
			document.getElementById('contactbox').reset();
			$('#contactform').append('<p class="thanks">お問合せありがとうございました。確認後ご連絡いたします。</p>')
		},
		complete: function() {
			$('.loading-ajax').remove()
		}
	})
}
