$(function() {

	// plan
	var Tabs = $("#plan li a");
	var TabActive = "active";
	var TabContents = $("div.planInner");
	$("div.section" , TabContents).hide();
	$(Tabs).click(function(e){
		e.preventDefault();
		$("div.section" , TabContents).hide();
		$($(this).attr("href")).fadeIn(300);
		$(Tabs).removeClass(TabActive);
		$(this).addClass(TabActive);
		$.cookie("planTab", $(this).attr("href") , {expires: 7});
	});

	// クッキー読み込み
	var CookieName = $.cookie("planTab");
	if (CookieName != null) {
		$(Tabs).removeClass(TabActive);
		$("a[href="+CookieName+"]").addClass(TabActive);
		$(CookieName).fadeIn(300);
	} else {
		$("#plan .tabS a").addClass(TabActive);
		$("div#planStudent" , TabContents).fadeIn(300);
	}
	
	// topImg
	
	$('#topImg p').crossSlide(
		{ fade: 1 },
		[
			{src:  'img/index/topImg01.jpg',
				from: 'left top',
				to:   'left bottom',
				time: 2},
			{src:  'img/index/topImg02.jpg',
				from: 'left center 1.5x',
				to:   'left center 1x',
				time: 2},
			{src:  'img/index/topImg03.jpg',
				from: 'left bottom',
				to:   'left top',
				time: 2},
			{src:  'img/index/topImg04.jpg',
				from: 'right center 1.5x',
				to:   'right center 1x',
				time: 2}
		]
	);
});

