/*!
 * するするスクロール
 * #始まりのアンカーリンクはするするスクロール
 */
$(document).ready(function(){
$('a[href*=#]').click(function() {
   if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
     var $target = $(this.hash);
     $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
     if ($target.length) {
       var targetOffset = $target.offset().top;
       $('html,body').animate({scrollTop: targetOffset}, 300);
      return false;
     }
   }
 });
});

/*!
 * PageTop
 * #50pxスクロールすると表示
 */
$(document).ready(function(){

	// hide #back-top first
	$("#PageTop").hide();
	
	// fade in #back-top
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 50) {
				$('#PageTop').fadeIn();
			} else {
				$('#PageTop').fadeOut();
			}
		});

		// scroll body to 0px on click
		$('#PageTop a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 300);
			return false;
		});
	});

});


/*!
 * IE6,7用のaタグの背景画像が右端に来た時の制御
 */
$(document).ready(function(){
$.fn.extend({
  inlineBgFix: function() {
    if ($.browser.msie && $.browser.version < 8.0) {
      $(this)
        .addClass('inline-bg-fix')
        .prepend('<span class="bg-l">&nbsp;</span>')
        .append('<span class="bg-r">&nbsp;</span>');
    }
  }
});

$(function() {
  $('.RevInfo a').inlineBgFix();
});
});

