// JavaScript Document

$(function() {
	
	$("h2:first").addClass("first-child");
	$("h3:first-child").addClass("first-child");
	$("h4:first-child").addClass("first-child");
	$("h5:first-child").addClass("first-child");
	
	// パンくずリストのスタイルを生成
	$("#pathlist li:last-child").addClass("last-child").wrapInner("<span></span>");
	
	// 外部リンクに target="_blank" をつける
	$("a[href^='http://']").attr("target","_blank");
	$("a[href^='https://']").attr("target","_blank");
	
	// img要素を内包しない外部リンクに.outerlinkクラスをつける
	$("a[href^='http://']:not(:has(img))").addClass("outerlink");
	$("a[href^='https://']:not(:has(img))").addClass("outerlink");
	
	// img要素を内包しないPDFへのリンクに.pdfクラスをつける
	// 外部pdfへの直リンクの場合はouterlinkクラスを外す
	$("a[href$='.pdf']:not(:has(img))").addClass("pdf").attr("target","_blank").removeClass("outerlink"); 
	$("a[href$='.doc']:not(:has(img))").addClass("word").removeClass("outerlink");
	$("a[href$='.ppt']:not(:has(img))").addClass("ppt").removeClass("outerlink");
	
	$(".column:odd").addClass("odd");
	
	// 議事録リストの先頭tdに.dateクラスをつける
	$(".reportlist tr td:first-child").addClass("date");
	$(".seminor:not('.temp') tr td:first-child").addClass("date");
});
