/*
 * modify.js
 *
 * Copyright (c) 2011 Taro Nagata,Shimpei Kaieda (http://peopletown.jp/)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */

//コンフリクトさせない
jQuery.noConflict();


//css3のクラスを追加
(function($) {

$(function(){
	//:first-child, :last-childをクラスとして追加
		$('body :first-child').addClass('firstChild');
		$('body :last-child').addClass('lastChild');
	//css3の:emptyをクラスとして追加
		$('body :empty').addClass('empty');

	//以下、個別制作ページ用設定
		$('dl.topicsbd dt:last').addClass('last');
		$('dl.latestbd dt:last').addClass('last');

   });
})(jQuery);


(function($) {

// 1. マウスオーバーで画像を変更
$(function(){
     $('a img').hover(function(){
        $(this).attr('src', $(this).attr('src').replace('_off', '_on'));
          }, function(){
             if (!$(this).hasClass('currentPage')) {
             $(this).attr('src', $(this).attr('src').replace('_on', '_off'));
        }
   });
});

// 2. 外部リンクを別タブで開く
/*
$(function(){
	$("a[href^='http://']").attr("target","_blank");
});
*/

// 3. ページスクロールするする
$(function(){
	$('a[href^="#"]').click(function() {
		$('html:not(:animated), body:not(:animated)').animate({ scrollTop: $($(this).attr('href')).offset().top}, 'slow', 'swing' );
		return false;
	});
});

// 5. テーブルの偶数・奇数の行の色を変える
/*
$(function(){
	$("tr:odd").addClass("odd");
});
*/

// 9. IE6以下ユーザーにメッセージを表示
$(function () {
	if ( $.browser.msie && $.browser.version <= 6 ) {
	        $('body').prepend('<div class="error">あなたは旧式ブラウザをご利用中です。このウェブサイトを快適に閲覧するにはブラウザをアップグレードしてください。</div>');
	}
});

// 16. アコーディオン
/*
$(function() {
   $('#accordion dd').hide();
   $('#accordion dt a').click(function(){
       $('#accordion dd').slideUp();
       $(this).parent().next().slideDown();
       return false;
   });
});
*/

// 18. プリントダイアログを表示
/*
$(function(){
	$('a.print').click(function(){
		window.print();
		return false;
	});
});
*/

})(jQuery);


//以下、nivo用設定topページのスライドショー
(function($) {

$(function(){
		$('#slider').nivoSlider();
});

})(jQuery);

