
$(function(){
	$("#bnrBox img , .bnrBox img").hover(
		function(){
			$(this).stop().animate({opacity: 0.6}, 300);
		},
		function(){
			$(this).stop().animate({opacity: 1.0}, 300);
		}
	);
});

//$(function(){
//	$("#fontSizeChange a").textresizer({
//	     target: "html", 
//	     sizes:  [ "80%", "100%", "120%" ]
//	});
//});


$(window).load(function () {
	var len = $("#slideArea a").length;
	
	var rand = Math.floor( Math.random() * len);
	$("#slideArea a").eq(rand).attr("class","active");

	$("#slideArea a.active").fadeIn(1000);
	
	setInterval( "slideSwitch()", 6000 );
	setTimeout( "imgBlock()",6000);

});
function imgBlock() {
	$("#slideArea a").css('display', 'block');
}

function slideSwitch() {
	var $active = $('#slideArea a.active');
	//もしも$img01の中がカラだったら#mainImg内の最後のimg要素を入れる
	//if ( $img01.length == 0 ) $img01 = $('#mainImg img:last');
	 
	var $next =  $active.next().length ? $active.next() : $('#slideArea a:first');
	
	$active.addClass('last');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last');
	});
}
