
jQuery(function(){
	//jQuery('ul.sf-menu').superfish();
	
	/*
	//// Tooltip
	jQuery('.topCategory a').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		fade: 250
	});
	*/
	
	/*
	$("#productsAV .topCategory").children("ul").css("top", "0");
	$("#productsPC .topCategory").children("ul").css("top", "0");
	*/
	
	////// get page height
	
	var flashHeight = $('#externalFlash').height();
	var secondContainerHeight = $('.topSecondContainer').height();
	var totalHeight = flashHeight + secondContainerHeight; //左の高さ合計
	var rightHeight = $('#topRightColumn').height();//右の高さ
	
	$('.topSecondContainer').css("top", (flashHeight) + "px");
	
	if (totalHeight >= rightHeight) //左の方が大きい
	{
		$("#topRightColumn").css("height", (totalHeight) + "px");
	}
	else if (rightHeight >= totalHeight) //右の方が大きい
	{
		$("#topLeftColumn").css("height", (rightHeight) + "px");
	}
	
		
	$("#debag").text(flashHeight);
	
	
	
	//$("#sample").text(secondContainerHeight);
	//$("#sample2").text(totalHeight);
	
	///// Products background set
	//var hoverImage = $('#item1 .imgCategory').attr("src");
	//$('#item1').css("background-image", "url(" + hoverImage + ")");
	//$("#trace").text(hoverImage);
	
	///// Show subcategories
	$("#productsAV .topCategory:lt(4)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "59px");
	$("#productsAV .topCategory:nth-child(4)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "118px");
	$("#productsAV .topCategory:nth-child(5)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "118px");
	$("#productsAV .topCategory:nth-child(6)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "118px");
	$("#productsAV .topCategory:nth-child(7)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "177px");
	$("#productsAV .topCategory:nth-child(8)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "177px");
	$("#productsAV .topCategory:nth-child(9)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "177px");
	$("#productsAV .topCategory:nth-child(10)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "236px");
	$("#productsAV .topCategory:nth-child(11)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "236px");
	$("#productsAV .topCategory:nth-child(12)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "236px");
	
	$("#productsAV .subCategory:lt(4)").css("margin-top", "1px");
	
	$("#productsPC .topCategory:lt(4)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "59px");
	$("#productsPC .topCategory:nth-child(4)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "118px");
	$("#productsPC .topCategory:nth-child(5)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "118px");
	$("#productsPC .topCategory:nth-child(6)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "118px");
	$("#productsPC .topCategory:nth-child(7)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "177px");
	$("#productsPC .topCategory:nth-child(8)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "177px");
	$("#productsPC .topCategory:nth-child(9)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "177px");
	$("#productsPC .topCategory:nth-child(10)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "236px");
	$("#productsPC .topCategory:nth-child(11)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "236px");
	$("#productsPC .topCategory:nth-child(12)").children("ul").css("padding-left", "1px").css("margin-top", "1px").css("top", "236px");
	
	
	
	/*
	var overItem = $("<img src='img_products/top_btn_prd_ov.png' class='overPng'>");
	
	$(".categoryAV a").hover(doImgHover, doImgOut);
	
	function doImgHover()
	{
		$(this).after($(overItem).fadeIn(200));
		$("#trace").text("hover");
	}
	
	function doImgOut()
	{
		$(this).after($(overItem).fadeIn(200));
		$("#trace").text("out");
	}
	*/
	
	/*
	$('.topCategory a').hover(function() {
		
		//$("bgWhite").css("display", "block");
		var fade = $('> .fadeHover', this);
		//var fadeSpan = $('> .fadeHover', this);
		if (fade.is(':animated')) {
			fade.stop().fadeTo(1, 1);
		} else {
			fade.fadeIn(150);
			//css("display", "block");
		}
	}, function () {
		//$("bgWhite").css("display", "none");
		var fade = $('> .fadeHover', this);
		if (fade.is(':animated')) {
			fade.stop().fadeTo(1, 0);
		} else {
			fade.fadeOut(150);
		}
	});
 
	$('.topCategory a > .fadeHover').empty();
	*/
	
	/*
	////// doRollOver
	$('.topCategory a').hover(function() {
		var fade = $('> .fadeHover', this);
		$(fade).css("display", "block");
	}, function () {
		//$("bgWhite").css("display", "none");
		var fade = $('> .fadeHover', this);
		if (fade.is(':animated')) {
			fade.stop().fadeTo(1, 0);
		} else {
			fade.fadeOut(300);
		}
	});
	$('.topCategory a > .fadeHover').empty();
	*/
});// End function


