$(document).ready(function(){
	/* アコーディオン */
	$(".resultListContainer .resultList").css("display","none");
	$(".resultListContainer.defaultView .resultList").css("display","block");
	$(".resultListContainer.defaultView a.category").addClass('open');
	

	$(".resultListContainer a.category").click(function(){
		$(this).next().slideToggle(
			"fast",
			function() {
				if($(this).css('display') == 'block') $(this).prev().addClass('open');
				else $(this).prev().removeClass('open');
			}
		);
	});
	$(".resultListContainer .button a").click(function(){
		$(this).parents(".resultList").slideToggle(
			"fast",
			function() {
				if($(this).css('display') == 'block') $(this).prev().addClass('open');
				else $(this).prev().removeClass('open');
			}
		);
	});

	/* サムネイル */
	$(".resultListContainer td a").hover(
		function() {
			var x = $(this).position().left;
			var y = $(this).position().top;
			var linkHeight = $(this).height();
			var linkWidth = $(this).width();
			$(this).next().css("left", (x + linkWidth + 24) + "px");
			$(this).next().css("top", (y + linkHeight/2 - 26) + "px");
//			$(this).next().css("display", "block");
			$(this).next().fadeIn("fast");
		},
		function() {
//			$(this).next().css("display", "none");
			$(this).next().fadeOut("fast");
		});

	/* 検索フォーム */
	/*
	$("form input.search").focus(
		function() {
			if( $(this).val() == "実績名" ) {
				$(this).val("");
				$(this).css("color", "#000000");
			}
		}
	);
	$("form input.search").blur(
		function() {
			if ( $(this).val() == "" ) {
				$(this).val("実績名");
				$(this).css("color", "#959595");
			}
		}
	);
	*/
});
