//****************************************************************************************************
// top_title.js                                                         作成者:am　　作成日:2009/11/25
// トップタイトル                                                       改定者:      改定日:2012/ 1/11
//****************************************************************************************************

// 変数
var TimeOut			= 100;
var currentLayer	= null;
var currentItem		= null;
var currentLayerNum	= 0;
var noClose			= 0;
var closeTimer		= null;

//----------------------------------------------------------------------------------------------------
// menuopen(n)：メニューを展開する関数
// n：左からn番目のメニューを示す
//----------------------------------------------------------------------------------------------------
function menuopen(n)
{
	// 変数
	var subMenuLayer	= document.getElementById("submenu" + n);
	var subMenuItem		= document.getElementById("subitem" + n);

	// 指定されたメニューが存在した場合又はカレントレイヤーが存在した場合
	if(subMenuLayer)
	{
		// タイマーのリセット
		resetmenuclosetime();
		// メニューを表示する
		subMenuLayer.style.visibility = "visible";
		// カレントレイヤーが存在し、かつ、n!=カレントレイヤー番号の場合にカレントレイヤー番号のレイヤ
		// ーを非表示にする。
		if(currentLayer && (currentLayerNum != n))
		{
			currentLayer.style.visibility = "hidden";
		}
		// カレントレイヤー、カレントアイテム、カレントレイヤー番号の設定
		currentLayer	= subMenuLayer;
		currentItem		= subMenuItem;
		currentLayerNum	= n;
	}
	else if(currentLayer)
	{
		// カレントレイヤーを非表示にする
		currentLayer.style.visibility = "hidden";
		// カレントレイヤー、カレントアイテム、カレントレイヤー番号のリセット
		currentLayer	= null;
		currentItem		= null;
		currentLayerNum	= 0;
	}
}

//----------------------------------------------------------------------------------------------------
// menuclosetime()：TimeOutで指定した時間にmenuclose()を実行する関数
//----------------------------------------------------------------------------------------------------
function menuclosetime()
{
	closeTimer = window.setTimeout(menuclose, TimeOut);
}

//----------------------------------------------------------------------------------------------------
// resetmenuclosetime()：タイマーをリセットする関数
//----------------------------------------------------------------------------------------------------
function resetmenuclosetime()
{
	if(closeTimer)
	{
		window.clearTimeout(closeTimer);
		closeTimer = null;
	}
}

//----------------------------------------------------------------------------------------------------
// menuclose()：メニューをクローズする関数
//----------------------------------------------------------------------------------------------------
function menuclose()
{
	// カレントレイヤーが存在し、かつ、noClose!=1の場合
	if(currentLayer && noClose != 1)
	{
		// カレントレイヤーを非表示にする
		currentLayer.style.visibility = "hidden";
		// カレントレイヤー、カレントアイテム、カレントレイヤー番号のリセット
		currentLayer	= null;
		currentItem		= null;
		currentLayerNum	= 0;
	}
	else
	{
		noClose = 0;
	}
	// カレントレイヤー、カレントアイテムのリセット
	currentLayer	= null;
	currentItem		= null;
}

//----------------------------------------------------------------------------------------------------
// イベント
//----------------------------------------------------------------------------------------------------
document.onclick = menuclose;

//====================================================================================================
// タグ
//====================================================================================================
document.write("<TABLE cellspacing='0' id='main_frame'>");
	document.write("<TBODY>");
	document.write("<TR>");
		
		//----------------------------------------------------------------------
		// ページトップに表示する文字列
		document.write("<TD colspan='3' id='top_comment'>");
			document.write("<IMG src='res/logo_topline.gif'>");		
		document.write("</TD>");

	document.write("</TR>");
	document.write("<TR>");
	
		//----------------------------------------------------------------------
		// タイトル
		document.write("<TD colspan='3' id='top_logo' style='width:950px'>");
			// ロゴ
			document.write("<IMG src='res/title_picture.gif'>");
		document.write("</TD>");
	document.write("</TR>");
	document.write("<TR>");

		//----------------------------------------------------------------------
		// タイトル
//		document.write("<TD id=\"top_logo\" style=\"width:950px\">");
			// ロゴ
//			document.write("<IMG src=\"res/title_winter.gif\">");
//		document.write("</TD>");
//		document.write("<TD id=\"center_space\" style=\"width:0px\">");
			// 季節ごとの背景画像
//			document.write("");
//		document.write("</TD>");
//		document.write("<TD id=\"right_space\" style=\"width:0px\">");
//		document.write("</TD>");
//	document.write("</TR>");
//	document.write("<TR>");

		//----------------------------------------------------------------------
		// ページトップに表示する文字列
		document.write("<TD colspan='3' class='one_click_menu'>");
			// ワンクリックメニュー
			document.write("<A href='index.html'><IMG src='res/top_home.gif'></A>");
			document.write("<A href='tizu.html'><IMG src='res/top_map.gif' class='one_click_menu_margin'></A>");
			document.write("<A href='sitemap.html'><IMG src='res/top_sitemap.gif' class='one_click_menu_margin'></A>");
			document.write("<A href='kojinjyouhou.html'><IMG src='res/top_kojinnjyouhou.gif' class='one_click_menu_margin'></A>");
			document.write("<A href='taiken.html'><IMG src='res/top_taiken.gif' class='one_click_menu_margin'></A>");
			document.write("<A href='gaibu_link.html'><IMG src='res/top_link.gif' class='one_click_menu_margin'></A>");
			document.write("<A href='sitsumon.html'><IMG src='res/top_q_and_a.gif' class='one_click_menu_margin'></A>");
			document.write("<A href='otoiawase.html'><IMG src='res/top_toiawase.gif' class='one_click_menu_margin'></A>");
		document.write("</TD>");

	document.write("</TR>");
	document.write("<TR>");

		//----------------------------------------------------------------------
		// メニュー
		document.write("<TD colspan=\"3\" id=\"main_menu\">");
		document.write("<UL id=\"top_menu\">");
			// 学校案内
			document.write("<LI><A href=\"#\" class=\"menu1\" id=\"subitem1\" onmouseover=\"menuopen(1);\" onmouseout=\"menuclosetime();\"></A>");
			document.write("<DIV class=\"submenu\" id=\"submenu1\" onmouseover=\"resetmenuclosetime()\" onmouseout=\"menuclosetime();\">");
				document.write("<A href=\"aisatsu.html\">&nbspあいさつ＆沿革</A>");
				document.write("<A href=\"koutousensyutoha.html\">&nbsp高等専修学校<BR>（専修学校高等課程）とは</A>");
				document.write("<A href=\"tenhengaku.html\">&nbsp転・編入学について</A>");
				document.write("<A href=\"gakousyoukai.html\">&nbsp学校紹介</A>");
				document.write("<A href=\"senseisyoukai.html\">&nbsp先生の紹介</A>");
				document.write("<A href=\"syokugyoukunren.html\">&nbsp職業訓練</A>");               
			document.write("</DIV>");
			document.write("</LI>");
			
			// コース紹介
			document.write("<LI><A href=\"#\" class=\"menu2\" id=\"subitem2\" onmouseover=\"menuopen(2);\" onmouseout=\"menuclosetime();\"></A>");
			document.write("<DIV class=\"submenu\" id=\"submenu2\" onmouseover=\"resetmenuclosetime()\" onmouseout=\"menuclosetime();\">");
				document.write("<A href=\"design.html\">&nbsp商業デザインコース</A>");
				document.write("<A href=\"keirika.html\">&nbsp計理コース</A>");
			document.write("</DIV>");
			document.write("</LI>");

			// キャンパスライフ
			document.write("<LI><A href=\"#\" class=\"menu3\" id=\"subitem3\" onmouseover=\"menuopen(3);\" onmouseout=\"menuclosetime();\"></A>");
			document.write("<DIV class=\"submenu\" id=\"submenu3\" onmouseover=\"resetmenuclosetime()\" onmouseout=\"menuclosetime();\">");
				document.write("<A href=\"nen_yotei.html\">&nbsp年間行事</A>");
				document.write("<A href=\"sakuhin.html\">&nbsp生徒の作品</A>");
				document.write("<A href=\"katsudou.html\">&nbsp生徒活動</A>");
			document.write("</DIV>");
			document.write("</LI>");

			// 資格・進路
			document.write("<LI><A href=\"#\" class=\"menu4\" id=\"subitem4\" onmouseover=\"menuopen(4);\" onmouseout=\"menuclosetime();\"></A>");
			document.write("<DIV class=\"submenu\" id=\"submenu4\" onmouseover=\"resetmenuclosetime()\" onmouseout=\"menuclosetime();\">");
				document.write("<A href=\"kenteishiken.html\">&nbsp検定試験</A>");
				document.write("<A href=\"sinro.html\">&nbsp進路</A>");
			document.write("</DIV>");
			document.write("</LI>");

			// 入学案内
			document.write("<LI><A href=\"#\" class=\"menu5\" id=\"subitem5\" onmouseover=\"menuopen(5);\" onmouseout=\"menuclosetime();\"></A>");
			document.write("<DIV class=\"submenu\" id=\"submenu5\" onmouseover=\"resetmenuclosetime()\" onmouseout=\"menuclosetime();\">");
				document.write("<A href=\"youkou.html\">&nbsp募集要項</A>");
				document.write("<A href=\"siryou.html\">&nbsp資料請求</A>");
				document.write("<A href=\"m_hutoukou.html\">&nbsp不登校のみなさんへ</A>");
				document.write("<A href=\"m_tyutai.html\">&nbsp高校中退者のみなさんへ</A>");
				document.write("<A href=\"m_tyugakusei.html\">&nbsp中学生のみなさんへ</A>");
				document.write("<A href=\"m_hogosya.html\">&nbsp保護者のみなさんへ</A>");
			document.write("</DIV>");
			document.write("</LI>");
		document.write("</UL>");
		document.write("</TD>");
	document.write("</TR>");
document.write("</TBODY>");
document.write("</TABLE>");

//****************************************************************************************************
// Google関連
//****************************************************************************************************

// 変数
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-28250535-1']);
_gaq.push(['_trackPageview']);

//----------------------------------------------------------------------------------------------------
// function()：googleのトラッキング関連
//----------------------------------------------------------------------------------------------------
(function()
{
	var ga = document.createElement('script');
	ga.type = 'text/javascript';
	ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(ga, s);
})();

