/**---------------------------------
 * product.js
 ---------------------------------*/

$(document).ready(function() {
	$(".detailBox > .tabBox").hide();
	$(".detailBox > .tabBox:first").show();
	$('.detailTab li a[href]').click(function(e){e.preventDefault()});
	$(".detailTab li:first").addClass("act");

	$(".detailTab > li").click(function () {
		$(".detailTab > li").removeClass("act");
		$(this).addClass("act");
		$(".detailBox > .tabBox").hide();
		$(".detailBox > .tabBox").eq($(".detailTab > li").index(this)).show();
	});

	//ua取得
	var ua = navigator.userAgent;
	
	if(ua.indexOf('IE 6') > -1 || ua.indexOf('IE 7') > -1){
		$('.imgList > li > a').each(function(){
			var boxY = $(this).height();
			var y = $('img',this).not(".zoom").height();

			var flag = this.nodeName.match(/a/i);
			if(flag){
				y += 4;
			}
			
			if(boxY > y){
				$(this).css({display:'block'});
				if(boxY != y){
					var rePadding = Math.floor((boxY - y) / 2);
					var reHeight = boxY - rePadding;
					$(this).css({paddingTop:rePadding+'px',height:reHeight+'px'});
				}else if(flag){
					$(this).css({display:'inline'});
				}
			}
		});
	}
});
