

//ページのTOPにスクロール



$(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, 'easeOutSine');

    return false;

   }

 }

  });

  

});



//バナーのフェード

$(function(){

    $('#header h1 img,.banner li img').hover(function(){

        $(this).fadeTo(200,0.6);

    },function(){

        $(this).fadeTo(300,1.0);

    });

});



//ナビゲーションの追尾



$( document ).ready( function () {

	$( '#nav' ).scrollFollow( {

	speed: 300,

	offset:0,

	easing:'easeOutSine',

	relativeTo: 'top'

	} );

} );





//フッターの固定



$(function(){

	positionFooter(); 

	function positionFooter(){

		if($(document).height() < $(window).height()){

			$("#footer").css({position: "absolute",top:($(window).scrollTop()+$(window).height()-$("#pageFooterOuter").height())+"px"})

		}	

	}

 

	$(window)

		.scroll(positionFooter)

		.resize(positionFooter)

});


