$(function(){

	/* Wink Effect */
		$("a img").hover(function(){
		$(this)
			.css("opacity", "0.2")
			.fadeTo("slow", 1.0);
	}, function(){
		$(this)
			.css("opacity", "1.0");
	});

	/* Toggle Effect */
	$("#menu div").hide();
	$(window).load(function(){
		$("#menu div").slideToggle("slow");
	});

	$("#details div").hide();
	$("body.individual #details div").show();
	$("body.individual #details h3 + ul")
		.hide()
		.css("font-size", "small");

	$("h3")
		.css("cursor", "pointer")
		.hover(function(){
			$(this).css("color", "#36f");
		}, function(){
			$(this).css("color", "#000");
		});

	$("h3").click(function(){
		$(this)
			.css("opacity", "0.5")
			.fadeTo("slow", "1.0")
			.next().addClass("open").slideToggle("slow");
	});

	$("body#home #details div").append("<p class='close'>閉じる</p>");
	$("p.close")
		.css({
			"clear" : "both",
			"width" : "4em",
			"padding" : "0.3em",
			"margin" : "1.5em auto 0",
			"background-color" : "#c00",
			"color" : "#fff",
			"font-size" : "small",
			"text-align" : "center",
			"text-shadow" : "0 0 3px #000",
			"cursor" : "pointer"
		})
		.click(function(){
			$("body#home #details div:eq("+$("p.close").index(this)+")").slideToggle("slow");
	});

	/* Focus Effect for IE 6/7 */
	$("#contact-form .solid").focus(function(){
		$(this).css({
			"background-color" : "#ffe",
			"border" : "0.2em solid #999"
		});
	}).blur(function(){
		$(this).css({
			"background-color" : "#fff",
			"border" : "0.2em solid #ddd"
		});
	});

});

// BackgroundImageCache
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}
