

/* Scrolling Sidebar
-------------------------------------------------------------------------------------------------------- */

/*$(function() {
    var offset = $("#sub").offset();
    var topPadding = 15;
    $(window).scroll(function() {
        if ($(window).scrollTop() > offset.top) {
            $("#sub").stop().animate({
                marginTop: $(window).scrollTop() - offset.top + topPadding
            });
        } else {
            $("#sub").stop().animate({
                marginTop: 0
            });
        }  
    });
});*/





/* Smooth Scroll
-------------------------------------------------------------------------------------------------------- */

jQuery.fn.extend({
  scrollTo : function(speed, easing) {
    <!-- hashの取得が出来なければ、処理を中断 -->
    if(!$(this)[0].hash || $(this)[0].hash == "#") {
      return false;
    }
    return this.each(function() {
      var targetOffset = $($(this)[0].hash).offset().top;
      $('html,body').animate({scrollTop: targetOffset}, speed, easing);
    });
  }
});

$(document).ready(function(){
  $('a[href*=#]').click(function() {
    $(this).scrollTo(1000);
    return false;
  });
});




/* 他の回を読むプルダウンメニュー（元はjquery.dropdownPlain.js）
-------------------------------------------------------------------------------------------------------- */
$(function(){

    $("ul.dropdown li").hover(function(){
    
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    
    }, function(){
    
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    
    });
    
    $("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");

});





/* ToolTip（プラグインは jquery.qtip-1.0.0-rc3.min.js）
-------------------------------------------------------------------------------------------------------- */

// サムライ
$(document).ready(function() {
	$("#tip_close .trigger").tooltip({
		effect: 'toggle'			   // エフェクト
	});
});
