/*
	メニューをクリックしたとき
	@param メニューのID
*/

function ClickFunc(MenuNo) {

	/*
		ページタイトルで突き合わせる.
		trueの場合はメインページのURLへ
		falseの場合はサブページのURLへ
	*/
	if (document.title == "帯広コア専門学校　学生ページ") {
		
		switch (MenuNo) {
	
		case 1:
			location.href = "Movie/index.html";
			break;
		case 2:
			location.href = "Desk/index.html";
			break;
		case 3:
			location.href = "Research/index.html";
			break;
		case 4:
			location.href = "Game/index.html";
			break;
		}
		
	} else {
	
		switch (MenuNo) {
	
		case 1:
			location.href = "../Movie/index.html";
			break;
		case 2:
			location.href = "../Desk/index.html";
			break;
		case 3:
			location.href = "../Research/index.html";
			break;
		case 4:
			location.href = "../Game/index.html";
			break;
		}	
	}

}

/*
	メニューにマウスポインタが乗ったとき
	@param メニューのID
	
	(注) evalを用いた処理は互換性を下げるため,(FireFoxで処理されない)
	わざと,switchで処理を行った.
*/

function OverFunc(MenuNo){

	/* 背景画像パス定数(初期値はサブページ) */
	var BGI = "url(../image/MenuColor2.jpg)";

	/* フォントカラー定数 */
	var FC = "rgb(0,0,0)";	

	/*
		ページタイトルで突き合わせる.
		trueの場合はメインページの背景画像のパスを設定する.
	*/
	if (document.title == "帯広コア専門学校　学生ページ") {
		BGI = "url(image/MenuColor2.jpg)";
	}

	/*
		・メニューの背景変更
		・フォントカラー変更
		・マウスカーソル変更
	*/
	switch(MenuNo) {

		case 1:
			document.getElementById("Menu1").style.backgroundImage = BGI;
			document.getElementById("Menu1").style.color = FC;
			document.getElementById("Menu1").style.cursor = "pointer";
			break;
		case 2:
			document.getElementById("Menu2").style.backgroundImage = BGI;
			document.getElementById("Menu2").style.color = FC;
			document.getElementById("Menu2").style.cursor = "pointer";
			break;
		case 3:
			document.getElementById("Menu3").style.backgroundImage = BGI;
			document.getElementById("Menu3").style.color = FC;
			document.getElementById("Menu3").style.cursor = "pointer";
			break;
		case 4:
			document.getElementById("Menu4").style.backgroundImage = BGI;
			document.getElementById("Menu4").style.color = FC;
			document.getElementById("Menu4").style.cursor = "pointer";
			break;
	}
}

/*
	メニューからマウスポインターが離れたとき
	@param メニューのID
	
	(注) evalを用いた処理は互換性を下げるため,(FireFoxで処理されない)
	わざと,switchで処理を行った.
*/

function OutFunc(MenuNo){

	/* 背景画像パス定数(初期値はサブページ) */
	var BGI = "url(../image/MenuColor.jpg)";
	
	/* フォントカラー定数 */
	var FC = "rgb(255,255,255)";
	
	/*
		ページタイトルで突き合わせる.
		trueの場合はメインページの背景画像のパスを設定する.
	*/	
	if (document.title == "帯広コア専門学校　学生ページ") {
		BGI = "url(image/MenuColor.jpg)";
	}

	/*
		・メニューの背景変更
		・フォントカラー変更
	*/
	switch(MenuNo) {

		case 1:
			document.getElementById("Menu1").style.backgroundImage = BGI;
			document.getElementById("Menu1").style.color = FC;
			break;
		case 2:
			document.getElementById("Menu2").style.backgroundImage = BGI;
			document.getElementById("Menu2").style.color = FC;
			break;
		case 3:
			document.getElementById("Menu3").style.backgroundImage = BGI;
			document.getElementById("Menu3").style.color = FC;
			break;
		case 4:
			document.getElementById("Menu4").style.backgroundImage = BGI;
			document.getElementById("Menu4").style.color = FC;
			break;
	}
}

/*
	最終更新日を求める
*/

function LastUpdate() {

	var ModVal = document.lastModified;
	var MonVal  = new String( new Number( ModVal.slice(0,2) ) );
	var DayVal  = new String( new Number( ModVal.slice(3,5) ) );
	var YearVal = new String( ModVal.slice(6,10) );
	
	updateValue.innerHTML = "最終更新日：" + YearVal + "年" + MonVal + "月" + DayVal + "日";

}

/*
	画面サイズを求める
*/

function getScrSize() {

	var scrWidth = screen.width;
	var scrHeight = screen.height;
	
}

function SelectObj(){
	document.body.style.cursor = "hand";
}

function ReleaseObj(){
	document.body.style.cursor = "auto";
}
