//外部リンクの場合は target _blank
$(function(){
     $("a[href^='http://']").attr("target","_blank");
});

//スムーズスクロールトップ

$(function(){
     $(".toTop").hide();

     $(function(){
     $(window).scroll(function(){
          if ($(this).scrollTop() > 200) {
          $('.toTop').fadeIn();
          } else {
          $('.toTop').fadeOut();
          }
     });

     $('.toTop a').click(function(){
     $('body,html').animate({ scrollTop: 0 }, 800);
     return false;
     });
     });
});

//ツールチップ
this.t_tip = function() {
    this.xOffset = -10;
    this.yOffset = 25;
    $(".tooltip").unbind().hover(
        function(e) {
            this.t = this.title;
            this.title = '';
            this.top = (e.pageY + yOffset);
            this.left = (e.pageX + xOffset);
            $('body').append( '<span id="tip_body">' + this.t + '</span>' );
            $('#tip_body').css("top", this.top+"px").css("left", this.left+"px").fadeIn("farst");
        },
        function() {
            this.title = this.t;
            $("#tip_body").remove();
        }
    ).mousemove(
        function(e) {
            this.top = (e.pageY + yOffset);
            this.left = (e.pageX + xOffset);
            $("#tip_body").css("top", this.top+"px").css("left", this.left+"px");
        }
    );
};
jQuery(document).ready(function($){t_tip();});
