/*-------------------------
filename:funciton.js
author:makoto kimura

update:20110924

-------------------------*/


jQuery(function($){
//スムーススクロール	
  $('a[href*=#]').click(function() {
    var $target=$(this.hash);
    var targetY=$target.offset().top;
    $($.browser.opera ? document.compatMode == 'BackCompat' ? 'body' : 'html' :'html,body').animate({scrollTop: targetY},{easing:"easeOutQuad", duration: 400});return false;
  });

//カタログflashのblank指定
$("#slider a").attr("target","catalog");
$("#cataloglist a").attr("target","catalog");
$(".catalogAll a").attr("target","catalog");
$(".catalogmain a").attr("target","catalog");


//新製品カレント表示
var pn_productsafter="pn_productsafter";
//	alert($("body").attr("id"));
if($("body").attr("id")==pn_productsafter){

var pCurrent = $("body").attr("class").slice(3);

$(".localnav li").each(function(){
//	alert($(this).attr("class"));
 if(pCurrent!=$(this).attr("class")){
	$(this).children("ul").addClass("hides");
}
})
}

//カタログmargin削除
$(".catalogAll li:nth-child(3n)").addClass("marginRnone");

$("#pn_catalog .catalogAll li img").mouseover(function(){
	$(this).css({opacity:"0.8"});
}).mouseout(function(){
	$(this).css({opacity:"1"});
});

//言語
$("#header .lang a img")
.css({opacity:"0.7"})
.mouseover(function(){
	$(this).css({opacity:"1"});
}).mouseout(function(){
	$(this).css({opacity:"0.7"});
});

$(".catalogmain li:nth-child(2)").css({float:"right"});

//table色分け
$("table.topicsAll tr:nth-child(odd)").addClass("odd");

//.pdf
//$("a[href*=.pdf]").addClass("pdf");
//$("a[href^=http]").not("[href*="+location.hostname+"]").attr("target","_blank");

$("a[href^=http]").attr('target','_blank');	
});
