$(function(){
/*----------------------------------------------------------------
    画像切り替え
----------------------------------------------------------------*/
    $(".over").imgchange({ name: "-o"});

    $(".hover").imghover();

	$("#gnavi .child-child").menuChild();
	$("#gnavi .child").menudown();

	$(".over").imgchange();

	$("#newsline dd").newscroll();

	$("#subnavi .child > a").accordion();

	//product page
	$("#item li a").click( function(){
		var item = $(this).attr("href");
		$("#item .photo img").attr("src", item);
		return false;
	});
	$(".colorbox").colorbox();

	//右側帯スタイル指定
	var half = $("body").width() / 2;
	if(half > 485) {
		if($("#index").length) {
			half = half - 271;
			$("#container").css("background-position", half + "px 397px");
		} else {
			$("#container").css("background-position", half + "px 160px");
		}
	}
	$(window).resize(function() {
		var half = $("body").width() / 2;
		if(half > 485) {
			if($("#index").length) {
				half = half - 271;
				$("#container").css("background-position", half + "px 397px");
			} else {
				$("#container").css("background-position", half + "px 160px");
			}
		}
	});

	//last add end
	$("#data > div:last-child").addClass("end");
	$("#data > div > table tr:last-child").addClass("end");

	//詳細テーブル背景用
	$("#data > div").each(function() {
		var h = $(this).height();
		$(this).children("h3").height( h - 10 + "px" );
	});

	//一覧アイコン用
	$(".list-box h2, #index #content .title").each(function() {
		var line = $(this).text();
		$(this).css("width", line.length + 0.7 + "em");
	});

	//製品一覧高さ揃え
	$(".list-box2").each(function(index, element) {
		var th = $(this).innerHeight();
		var hmax = 0;
		if(hmax < th) hmax = th;
		$(".list-box2").height(hmax + "px");
	});
});

