/* jQuery required.
 * Using version 1.6.1.
 *
*/

$(document).ready(function() {
// 外部リンクを新規ウィンドウで開く
	$('a.blank,a.external').click(function() {
		window.open(this.href, '_blank').focus();
		return false;
	});

// ページ内スクロール
	$('a[href*="#"]').easingScroll({
		easing: 'easeInOutQuart',
		duration: 500
	});

	$('area[href*="#"]').easingScroll({
		easing: 'easeInOutQuart',
		duration: 500
	});

// リストの最後にクラスを付ける
	$('#localNavi li:last-child').addClass('liEnd');
	$('#breadCrumbs li:last-child').addClass('currentPage');
	$('.productsSub li:even').addClass('even');

// テーブルの装飾
	// $('tr:even','.specList').addClass("even");
	// $('tr:odd','.specList').addClass("odd");
	$('tr:odd','.products .section table').addClass("odd");
	$('tr:even','.products .section table').addClass("even");
	$('.products .section table th:last-child').addClass('thEnd');
	$('.products .section table td:last-child').addClass('tdEnd');
	$('.products .section table tr:last-child').addClass('trEnd');

	$('.products .section table th:first-child').addClass('thTop');
	$('.products .section table td:first-child').addClass('tdTop');
	
	$('tr:odd','.company .section table').addClass("odd");
	$('tr:even','.company .section table').addClass("even");
	$('tr:odd','.inquiry .section table').addClass("odd");
	$('tr:even','.inquiry .section table').addClass("even");
	$('tr:odd','.csr .section table').addClass("odd");
	$('tr:even','.csr .section table').addClass("even");
	$('tr:odd','#search.section table').addClass("odd");
	$('tr:even','#search table').addClass("even");		

// リストの装飾
	$('li:odd','#topCategory ul').addClass("odd");

// 現在のページにクラスを追加
	$('#localNavi').find('a').each(function(){
		if( location.href.indexOf(this.href) != -1) {
			$(this).addClass('current');
		}
	});

	$('#categoryNavi').find('a').each(function(){
		if( location.href.indexOf(this.href) != -1) {
			$(this).addClass('current');
		}
	});
});
