$(function(){
	
	//アイコン画像のデフォルト余白用class付与
	$("img[src*='/icon/']")
		.addClass(
			'icon'
		)
	;
	
	//#intro ～年～半期の的中結果枠：リストの区切り線のラストを消去
	$("#intro .hit-list ul li:last-child")
		.css({
			 'margin' : '0px',
			 'padding-bottom' : '0px',
			 'border' : 'none'
			 }
		)
	;
	
	//TOP　今週の注目レース：区切り線のラストを消去
	$("#index .main-race dd.link-list ul li:last-child")
		.css('background' , 'none')
	;
	
	//今週のレース一覧：メインレース枠の灰/白ストライプ
	$("#racelist .main-race .race-list-main li")
		.each(
			function (i) {
				if( i % 2 == 1 ) {
					if( $(this).attr("class") != "win5" ){
						$(this).addClass("stripe");
					}
				}
			}
		)
	;
	
	//今週のレース一覧
	//今週のオススメ　：レース一覧の各レース枠の灰/白ストライプ
	$("#racelist .race-list-day ol li:nth-child(even), #pickup .race-list-day ol li:nth-child(even)")
		.addClass("stripe")
	;
	
	//サイドカラムの「PR」広告枠　番組が2件出力された時に区切り線だす用のclass付与
	$(".side-column .pr-ad > ul > li:last-child")
		.addClass("end")
	;
	
	//サイドカラムの「今週の重賞レース」枠　日付ごとのブロック上余白の調整
	$(".side-column .high-stakes dl:first")
		.css("margin-top","0px");
	;
	
	//フッターのナビゲーションリンク：区切り線のラストと余白を消去
	$("#footer ul li:last-child")
		.css({
			 'margin' : '0px',
			 'padding' : '0px',
			 'background' : 'none'
			}
		)
	;

	//expect末端全般　:　メインブロックのタブナビゲーション
	//class属性値がselectedならaタグをspanに変換
	$("#expect #contents .main-block .tab-nav li[class*='selected'] a")
		.each(
			function(){
				$(this).replaceWith("<span>" + $(this).html() + "</span>");
			}
		)
	;

	//ラストのタブの区切り線削除
	$("#expect #contents .main-block .tab-nav li")
		.each(
			function(e){
				if(e > 6){
					$(this).css( "background" , "none" );	
				}
			}
		)
	;
	
	//出馬表・結果表のストライプ
	$("#expect #contents .main-block .race-table tr:nth-child(even)")
		.addClass("stripe")
	;
	
	//出馬表・結果表のスクロールバー調整
	var t_line; //出馬表の頭数を取得
	$("#expect #contents .main-block .race-table tr").each(function(i){
		t_line = i;
		i++;
	});
	
	if( t_line > 18){ //18頭より多ければ枠の高さ固定＋スクロールバー
		$("#expect #contents .main-block .race-table")
			.height(610)
			.css({"overflow":"auto", "display":"block"})
		;
			
		$("#expect #contents .main-block .race-table table")
			.width(610)
		;	
	}

	//expect/mainの馬券画像：3連複の数字画像余白の調整
	$("#expect #contents .main-block #sanhuku.card .combination dd ul li:nth-child(4n)")
		.css("margin-right" , "0px")
	;
	
	//開催レース一覧表
	//開催日ごと→開催上単位のレースリストの余白とボーダー調整用class
	$("#expect .rnav-4weeks .wrap dl")
		.each(
			function(){
				$(this).children("dd")
					.each(
						function(e){
							if( e == 0){
								$(this).addClass("left");
							}else if( e == 2 ){
								$(this).addClass("right");
							}
						}
					)
				;
			}
		)
	;
	
	//開催上単位のレースリストのストライプ
	$("#expect .rnav-4weeks .wrap dl dd table tr:nth-child(even)")
		.addClass("stripe");
	;
	
	//win5ページ：オススメの買い方伝授
	// 馬番号画像が入る枠のラスト、余白調整
	$("#win5 .open .lecture .wrap ol li:last-child")
		.css("margin-right", "0px")
	;
	
	
});

