/*

nikkansports.com  config.js for jQuery

DATE      : 2007/08/01
COPYRIGHT : Nikkan Sports News.
WRITER    : Chiaki Hatanaka


 */



$(function(){



	// メニュー画像を <body> の class により差し替える
	var bodyClass = $('body').attr('class');

	switch(bodyClass) {
		case "asianScore":
		$('#pageMenu ol li:nth-child(2)').find('a').html('<img src="/soccer/japan/asiancup/2007/img/menu-score_on.gif" alt="スコア速報" width="64" height="26" />');
		break;

		case "asianHistory":
		$('#pageMenu ol li:nth-child(9)').find('a').html('<img src="/soccer/japan/asiancup/2007/img/menu-history_on.gif" alt="歴史" width="36" height="26" />');
		break;
	}


	// 奇数、偶数をクラスとして追加
	$('table').each(function(){
		$(this).find('tr:odd').addClass('odd');
		$(this).find('tr:even').addClass('even');
	});
	
	// :first-child, :last-childをクラスとして追加
	$('ul.line').each(function(){
		$('li:first-child').addClass('firstChild');
		$('li:last-child').addClass('lastChild');
	});


	// css3の:emptyをクラスとして追加
	$(':empty').addClass('empty');


	// :hoverをクラスとして追加
	$('tr').hover(function(){
		$(this).addClass('hover');
	},function(){
		$(this).removeClass('hover');
	});


	// 隣接セレクタ
	$('div.section + div.section').addClass('line');




});


