$(function(){

	/* クロスブラウザなフォーカス */
	$("input[type='text'], textarea").focus(function(){
		$(this).css("background", "#f60");
	});
	$("input[type='text'], textarea").blur(function(){
		$(this).css("background", "#fff");
	});


	/* ウィンク効果 */
	$("#header h1 a img, #global-nav ul li a img, #utility-nav ul li a img, #photos ul li a img, #footer p a img").hover(function(){
		$(this).css("opacity", "0.2");
		$(this).css("filter", "alpha(opacity=20)");
		$(this).fadeTo("slow", 1.0);
	});

	/* ロールオーバー */
	$("#photos p a img").hover(function(){
		$(this).attr("src", "images/moveto-showcase_on.gif");
	}, function(){
		$(this).attr("src", "images/moveto-showcase.gif");
	});

	/* タブパネル */
	$("ul.tab li:first-child").addClass("selected");
	$("ul.panel li:not(:first-child)").css("display","none");
	$("ul.tab li").click(function(){
		$("ul.tab li").removeClass("selected");
		$(this).addClass("selected");
		$("ul.panel li").css("display","none");
		$("ul.panel li:eq("+$("ul.tab li").index(this)+")").css("display","block");
	});

	/* スライドショー */
	$("ul.control li:first-child").addClass("selected");
	$("ul.visual li:not(:first-child)").css("display","none");
	$("ul.control li").click(function(){
		$("ul.control li").removeClass("selected");
		$(this).addClass("selected");
		$("ul.visual li").css("display","none");
		$("ul.visual li:eq("+$("ul.control li").index(this)+")").css("display", "block");
		$("ul.visual li:eq("+$("ul.control li").index(this)+")").css("opacity", "0.2");
		$("ul.visual li:eq("+$("ul.control li").index(this)+")").css("filter", "alpha(opacity=20)");
		$("ul.visual li:eq("+$("ul.control li").index(this)+")").fadeTo("slow", 1.0);
	});

});

