// JavaScript Document

// Easingの追加

jQuery.easing.quart = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};
/*-------------------------------------
 ページ読み込み中
-------------------------------------*/
jQuery(document).ready(function(){
    // <a href="#***">の場合、スクロール処理を追加
    //
    jQuery('a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
            var $target = jQuery(this.hash);
            $target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                jQuery('html,body').animate({ scrollTop: targetOffset }, 500, 'quart');
                return false;
            }
        }
    });
 
});




/*------------------------------------
	ドロップダウンメニュー
------------------------------------*/
$(function(){
	//初期設定
	$("ul.subMenu li:last-child").addClass("subMenuLastLi");

	
	$("ul.lmenu li").hover(function(){
		$(">ul:not(:animated)",this).slideDown("fast");
	},
	function(){
		$(">ul",this).slideUp("fast");
	});
});



/*------------------------------------
	各ページのh3 背景処理 ページIDから引っ張ってくる
------------------------------------*/
$(function(){
	var pageID;
	var h3_file;
	pageID = $("#mainCont > div").attr("id"); //ページIDの取得
	if(pageID !="at" || pageID !="bt"){
		h3_file ="url(/images/h3-"+ pageID +".png) no-repeat";
		$("#alpha-box h3").css("background",h3_file);
	}
	
	/*写真ボックスの処理*/
//	$(".left-imgbox").css("width",$(this).find("img").attr("width"));
//	$(".right-imgbox").css("width",$(this).find("img").attr("width"));
	
	
	/*テーブルのtd*/
	$(".table-01 tr:even").find("td").addClass("tdEven");
	

	/*右カラムからのリンクはブランク*/
	$("#beta-box a").attr("target","_blank");

	$("#a34 #alpha-box #event-list .month-box").css("height","160px");

	$(".two-column .column-box:even").addClass("column-clear");
	$(".two-column .column-box:even").addClass("column-rmargin20");

	$(".three-column .column-box:nth-child(3n+1)").addClass("column-clear");
	$(".three-column .column-box:nth-child(3n+1)").addClass("column-rmargin15");
	$(".three-column .column-box:nth-child(3n+2)").addClass("column-rmargin15");

	

});



/*------------------------------------
	各教科の取り組み 画像大きくする
------------------------------------*/
$(function(){
	
	$("#a12 img.hyo").css("height","150px");
	$("#a12 img.hyo").css("width","260px");
	$("#a12 img.hyo").css("cursor","pointer");


	
	$("#a12 img.hyo").toggle(function(){
		
		$(this).not(":animated").animate({
			width: "535px",	
			height: "312px"
		},"slow","swing");
	},function(){
		$(this).not(":animated").animate({
			width: "260px",	
			height: "150px"
		},"fast","swing");
	});

	$("#b13 img.hyo").css("height","172px");
	$("#b13 img.hyo").css("width","257px");
	$("#b13 img.hyo").css("cursor","pointer");


	
	$("#b13 img.hyo").toggle(function(){
		
		$(this).not(":animated").animate({
			width: "316px",	
			height: "214px"
		},"slow","swing");
	},function(){
		$(this).not(":animated").animate({
			width: "257px",	
			height: "172px"
		},"fast","swing");
	});


});
$(function(){
	
	$("#a12 img.hyo02").css("height","150px");
	$("#a12 img.hyo02").css("width","260px");
	$("#a12 img.hyo02").css("cursor","pointer");


	
	$("#a12 img.hyo02").toggle(function(){
		
		$(this).not(":animated").animate({
			width: "537px",	
			height: "402px"
		},"slow","swing");
	},function(){
		$(this).not(":animated").animate({
			width: "260px",	
			height: "150px"
		},"fast","swing");
	});

	$("#b13 img.hyo02").css("height","272px");
	$("#b13 img.hyo02").css("width","257px");
	$("#b13 img.hyo02").css("cursor","pointer");


	
	$("#b13 img.hyo02").toggle(function(){
		
		$(this).not(":animated").animate({
			width: "317px",	
			height: "402px"
		},"slow","swing");
	},function(){
		$(this).not(":animated").animate({
			width: "257px",	
			height: "272px"
		},"fast","swing");
	});


});


/*------------------------------------
	コースの 画像大きくする
------------------------------------*/
$(function(){
	$("#a221 .coursetime img").css("height","199px");
	$("#a221 .coursetime img").css("width","300px");
	$("#a221 .coursetime img").css("cursor","pointer");


	$("#a221 .coursetime img").toggle(function(){
		
		$(this).not(":animated").animate({
			width: "780px",	
			height: "562px"
		},"slow","swing");
	},function(){
		$(this).not(":animated").animate({
			width: "300px",	
			height: "199px"
		},"fast","swing");
	});

	$("#a222 .coursetime img").css("height","119px");
	$("#a222 .coursetime img").css("width","321px");
	$("#a222 .coursetime img").css("cursor","pointer");


	$("#a222 .coursetime img").toggle(function(){
		
		$(this).not(":animated").animate({
			width: "780px",	
			height: "301px"
		},"slow","swing");
	},function(){
		$(this).not(":animated").animate({
			width: "321px",	
			height: "119px"
		},"fast","swing");
	});

	$("#a223 .coursetime img").css("height","199px");
	$("#a223 .coursetime img").css("width","300px");
	$("#a223 .coursetime img").css("cursor","pointer");


	$("#a223 .coursetime img").toggle(function(){
		
		$(this).not(":animated").animate({
			width: "780px",	
			height: "613px"
		},"slow","swing");
	},function(){
		$(this).not(":animated").animate({
			width: "300px",	
			height: "199px"
		},"fast","swing");
	});

	$("#b111 .coursetime img").css("height","199px");
	$("#b111 .coursetime img").css("width","300px");
	$("#b111 .coursetime img").css("cursor","pointer");


	$("#b111 .coursetime img").toggle(function(){
		
		$(this).not(":animated").animate({
			width: "780px",	
			height: "562px"
		},"slow","swing");
	},function(){
		$(this).not(":animated").animate({
			width: "300px",	
			height: "199px"
		},"fast","swing");
	});

	$("#b112 .coursetime img").css("height","119px");
	$("#b112 .coursetime img").css("width","321px");
	$("#b112 .coursetime img").css("cursor","pointer");


	$("#b112 .coursetime img").toggle(function(){
		
		$(this).not(":animated").animate({
			width: "780px",	
			height: "301px"
		},"slow","swing");
	},function(){
		$(this).not(":animated").animate({
			width: "321px",	
			height: "119px"
		},"fast","swing");
	});

	$("#b113 .coursetime img").css("height","199px");
	$("#b113 .coursetime img").css("width","300px");
	$("#b113 .coursetime img").css("cursor","pointer");


	$("#b113 .coursetime img").toggle(function(){
		
		$(this).not(":animated").animate({
			width: "780px",	
			height: "613px"
		},"slow","swing");
	},function(){
		$(this).not(":animated").animate({
			width: "300px",	
			height: "199px"
		},"fast","swing");
	});



});


/*------------------------------------
	制服写真の差し替え
------------------------------------*/
$(function(){
	$("#a35 #seifuku02").hide();

	$("#a35 #seifuku01").click(function(){
		$("#seifuku01").fadeOut(400);
		$("#seifuku02").fadeIn(400);
		
	});
	$("#a35 #seifuku02").click(function(){
		$("#seifuku01").fadeIn(400);
		$("#seifuku02").fadeOut(400);
		
	});

});

