/*
  全ページ適用Javascript
  ※要Jquery
*/
jQuery(function($) {
	
	// ローカルナビゲーションが有効な場合に実行
	if($("div#bk_localnavi").length) {
		
		// 現在のURLを取得
		var cURL = new String(window.location.pathname);
		
		// 取得したURLに".html"の文字列が無い場合にindex.htmlを付加
		if(!cURL.match(/\.html/i)) {
			cURL += "index.html";
		}
		
		// URLを"/"で分割し、分割数を取得
		var paths = cURL.split("/");
		var docNameNo = paths.length - 1;
		
		// 現在のURLとa要素のhref属性の値が一緒なら親のli要素にクラスを適用
		$("div#bk_localnavi ul li ul li a[href=" + paths[docNameNo] + "]").parent().addClass("current");
		// 現在のURLとa要素のhref属性の値が一緒ならa要素にクラスを適用（カテゴリ用）
		$("div#bk_localnavi ul li.ln_toplevels > a[href=" + paths[docNameNo] + "]").addClass("active");
	}
	
	// baiduのアイコンを隠す
	var baImg = 'img[src="' + ('https:' == document.location.protocol ? 'https://' : 'http://') + 'eiv.baidu.com/hmt/icon/21.gif' + '"]';
	
	if($(baImg.length)) {
		$(baImg).css("display", "none");
	}
	
});
