/////////////////////////////////////////////////////////////////////////////
// (注)	convert_zen関数で使用している半角カナが全角に自動変換されてしまうので、
//		vimで本ファイルを編集しないこと				2005.03.02 kozuka@imslab
/////////////////////////////////////////////////////////////////////////////
function dispStatus(str) {
	status = str;
}
     
// 操作チュートリアル;
function goExplain() {
	window.open("/user/explain/explain.html", "Explain",
		"toolbar=no,location=no,directories=no,status=no," +
		"menubar=no,scrollbars=yes,resizable=yes,width=600,height=500");
}

// 利用者マニュアル;
function goUserManual() {
	window.open("/user/UserManual.pdf", "UserManual",
		"toolbar=no,location=no,directories=no,status=no," +
		"menubar=no,scrollbars=yes,resizable=yes,width=600,height=500");
}

function qa_help() {
	window.open("/user/QAhelp.html", "qa_help",
				"width=550,height=620,location=no,scrollbars=yes");
}

function course_select_guide(course_code) {
	window.open("/course_select_guide/"+course_code+"/index.html", "guide",
		"width=900,height=670,menubar=no,toolbar=no,scrollbars=yes," +
		"resizable=yes");
}

function course_guide(course_code) {
	window.open("/course_guide/"+course_code+"/index.html", "guide",
		"width=900,height=670,menubar=no,toolbar=no,scrollbars=yes," +
		"resizable=yes");
} 

function convert_zen(keyword) {
	///////////////////////////////////////////////////////////////////
	// ほら、vimで見ているあなた!! ここが全角になってるでしょ
	///////////////////////////////////////////////////////////////////
	txt = "ｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜｦﾝｧｨｩｪｫｬｭｮｯ､｡ｰ｢｣ﾞﾟ";

	zen = "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」";
	zen+= "　　ヴ　　ガギグゲゴザジズゼゾダヂヅデド　　　　　バビブベボ　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　";
	zen+= "　　　　　　　　　　　　　　　　　　　　　　　　　パピプペポ　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　";

	str = "";
	for (i = 0; i < keyword.length; i++) {
		// 文字の取り出し（対象文字と次の文字）;
		c = keyword.charAt(i);
		cnext = keyword.charAt(i+1);

		// 該当文字の検索;
		n = txt.indexOf(c, 0);
		nnext = txt.indexOf(cnext, 0);

		// 全角カナへの変換;
		if (n >= 0){
			if (nnext == 60) {		// 濁点付きの場合;
				c = zen.charAt(n+60);
				i++;                 
			}       
			else if (nnext == 61) {	// 半濁点付きの場合;
				c = zen.charAt(n+120);
				i++;
			}
			else {					// 通常のカナの場合;
				c = zen.charAt(n);
			}
		}

		// 濁点・半濁点つきでない場合;
		if ((n != 60) && (n != 61)) {str += c;}
	}

	return str;
}

