/*
============================================================
	window close
============================================================
*/
function window_close () {
	window.opener = window;
	var win = window.open(location.href,"_self");
	win.close();
}


/*
============================================================
	window print
============================================================
*/
function window_print () {
	window.print()
}


/*
============================================================
	pop up
============================================================
*/
function openPop (fi,na,w,h) {
	window.open (fi,na,"width="+w+",height="+h+",left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,favorites=no,resizable=no").focus();
}

function openImgPop (fi,na,w,h) {
	window.open (fi,na,"width="+w+",height="+h+",left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,favorites=no,resizable=yes").focus();
}


/*
============================================================
	roll over
============================================================
*/
var startLoad = 0;

var menuItem = new Array ();

function menuPreload (type) {
	var path;
	if (type == 1) {
		path = "./";
	} else if (type == 2) {
		path = "../";
	}

	menuItem[0] = new Image (); menuItem[0].src = path + "img/menu_home_off.gif";
	menuItem[1] = new Image (); menuItem[1].src = path + "img/menu_home_on.gif";
	menuItem[2] = new Image (); menuItem[2].src = path + "img/menu_study_off.gif";
	menuItem[3] = new Image (); menuItem[3].src = path + "img/menu_study_on.gif";
	menuItem[4] = new Image (); menuItem[4].src = path + "img/menu_library_off.gif";
	menuItem[5] = new Image (); menuItem[5].src = path + "img/menu_library_on.gif";
	menuItem[6] = new Image (); menuItem[6].src = path + "img/menu_letter_off.gif";
	menuItem[7] = new Image (); menuItem[7].src = path + "img/menu_letter_on.gif";
	menuItem[8] = new Image (); menuItem[8].src = path + "img/menu_question_off.gif";
	menuItem[9] = new Image (); menuItem[9].src = path + "img/menu_question_on.gif";
	menuItem[10] = new Image (); menuItem[10].src = path + "img/menu_mm_off.gif";
	menuItem[11] = new Image (); menuItem[11].src = path + "img/menu_mm_on.gif";
	menuItem[12] = new Image (); menuItem[12].src = path + "img/menu_about_off.gif";
	menuItem[13] = new Image (); menuItem[13].src = path + "img/menu_about_on.gif";
	menuItem[14] = new Image (); menuItem[14].src = path + "img/menu_list_off.gif";
	menuItem[15] = new Image (); menuItem[15].src = path + "img/menu_list_on.gif";

	startLoad = 1;
}

function menuRoll (imgName, num) {
	if (startLoad == 1) {
		if (document.images) document.images[imgName].src=menuItem[num].src;
	}
}


/*
============================================================
	view flash
============================================================
*/
function viewFlash (swf, img, idname, width, height, majarVer, minorVer, revisionVer) {
	var checkVer = DetectFlashVer (majarVer, minorVer, revisionVer);

	if (checkVer) {
		var htmltags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + majarVer + ',' + minorVer + ',' + revisionVer + ',0" width="' + width + '" height="' + height + '" id="' + idname + '" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="' + swf + '" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><embed src="' + swf + '" menu="false" quality="high" bgcolor="#FFFFFF" width="' + width + '" height="' + height + '" name="' + idname + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	} else if (img) {
		var htmltags = '<img src="' + img + '" width="' + width + '" height="' + height + '" alt="" />';
	}

	document.write (htmltags);
}
