/* ============================================================================
	jQueryスクリプト
============================================================================ */
jQuery(document).ready(function ($) {
	// 上へスムーズに戻る
	$('div.up_page a').click(function() {
		$.scrollTo(0, 300);
		return false;
	});

	// サイト内検索フォーカス
	$('form.search input.text').focus(function() {
		$(this).addClass('focus');
	})
	.blur(function() {
		if($(this).val() != "") {
			$(this).addClass('focus');
		} else {
			$(this).removeClass('focus');
		}
	});
	$(window).load(function() {
		var sit = $('form.search input.text');
		if(sit.val() != "") {
			sit.addClass('focus');
		}
	});

	// 機種依存文字（Unicode、JIS、Shift_JISコード出力）
	$('a.uniquechar').hover(function() {
		var title = $(this).attr('title').split(';');
		var child = $(this).parent().parent().parent().parent().next().children().children().children();
		child.children('span.uprint').text(title[0]);
		child.children('span.jprint').text(title[1]);
		child.children('span.sjprint').text(title[2]);
	},
	function() {
		$('span.uprint').text("");
		$('span.jprint').text("");
		$('span.sjprint').text("");
	});

	// Web素材一覧マウスオーバー
	$('div.item table.image').each(function() {
		$(this).hover(function() {
			$(this).fadeTo(200,0.5).css('background-color', '#666');
		}, function() {
			$(this).fadeTo(200,1).css('background-color', '#fff');
		});
		$(this).click(function() {
			var rel = $(this).find('img').attr('rel');
			location.href = rel;
		});
	});

	$('form#wp_search button').hover(function() {
		$(this).addClass('hover');
	},function() {
		$(this).removeClass('hover');
	});

	// お問い合わせフォーム
	$('form.contact input, form.contact textarea').focus(function() {
		$(this).addClass('focus');
	})
	.blur(function() {
		$(this).removeClass('focus');
	});
	$('form.contact input.submit').hover(function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
});


