 // スライドショー
 
function slideSwitch() {
	 var $active = $('#slideshow img.active');
	 if ( $active.length == 0 ) $active = $('#slideshow img:last');
	 var $next =  $active.next().length ? $active.next() : $('#slideshow img:first');
	 $active.addClass('last-active');
	 $next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 2000, function() {
			$active.removeClass('active last-active');
		});
 }
 
// ロールオーバー

$(function(){
	$('#mainlogo').fadeIn(2000, function() {
		$('#add').fadeIn(1000, function(){
		$('#footer').fadeIn(1000)
		});
	});	
	setInterval( "slideSwitch()", 10000 );
	$(".over").mouseover(function(){
		$(this).fadeTo(50,0.4).fadeTo(400,1.0);
	});
});

// Easing BEGIN

$.easing.quart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

$(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 }, 900, 'quart');
				return false;
			}
		}
	});

});

// Easing END

