// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ
// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ À©µµ¿ì ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ
// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ

// ====================================================================================
// À©µµ¿ì ¿ÀÇÂ (È­¸é Áß¾Ó)
// onclick="win_open('calender.asp', 'calender', 200, 160);"
//
// url        : ÁÖ¼Ò
// win_id     : À©µµ¿ì ÀÌ¸§
// win_width  : À©µµ¿ì °¡·Î Å©±â
// win_height : À©µµ¿ì ¼¼·Î Å©±â
// ====================================================================================
function win_open(url, win_id, win_width, win_height) {
	var win_opt, o_win;
	
	win_opt = "width=" + win_width + ",height=" + win_height + ",resizable=no,status=no,scrollbars=yes";
	win_opt += ",top=" + eval((screen.availHeight / 2) - (win_height / 2)) + ",left=" + eval((screen.availWidth / 2) - (win_width / 2));

	o_win = window.open(url, win_id, win_opt);
	o_win.focus();

}


// ====================================================================================
// À©µµ¿ì ¿ÀÇÂ (À§Ä¡ ÁöÁ¤)
// onclick="win_open_pos('calender.asp', 'calender', 200, 160, 512, 384);"
//
// url        : ÁÖ¼Ò
// win_id     : À©µµ¿ì ÀÌ¸§
// win_width  : À©µµ¿ì °¡·Î Å©±â
// win_height : À©µµ¿ì ¼¼·Î Å©±â
// win_x      : À©µµ¿ì x ÁÂÇ¥
// win_y      : À©µµ¿ì y ÁÂÇ¥
// ====================================================================================
function win_open_pos(url, win_id, win_width, win_height, win_x, win_y) {
	var win_opt, o_win;
	
	win_opt = "width=" + win_width + ",height=" + win_height + ",resizable=no,status=no,scrollbars=yes";
	win_opt += ",top=" + win_y + ",left=" + win_x;

	o_win = window.open(url, win_id, win_opt);
	o_win.focus();
}


// ====================================================================================
// À©µµ¿ì ¿ÀÇÂ (Å©±â º¯°æ)
// onclick="win_open_resize('calender.asp', 'calender', 200, 160);"
//
// url        : ÁÖ¼Ò
// win_id     : À©µµ¿ì ÀÌ¸§
// win_width  : À©µµ¿ì °¡·Î Å©±â
// win_height : À©µµ¿ì ¼¼·Î Å©±â
// win_x      : À©µµ¿ì x ÁÂÇ¥
// win_y      : À©µµ¿ì y ÁÂÇ¥
// ====================================================================================
function win_open_resize(url, win_id, win_width, win_height) {
	var win_opt, o_win;
	
	win_opt = "width=" + win_width + ",height=" + win_height + ",resizable=yes,status=no,scrollbars=yes";
	win_opt += ",top=" + eval((screen.availHeight / 2) - (win_height / 2)) + ",left=" + eval((screen.availWidth / 2) - (win_width / 2));

	o_win = window.open(url, win_id, win_opt);
	o_win.focus();
}


// ====================================================================================
// ºÎ¼­, ºÎ¼­¿ø ¼±ÅÃ À©µµ¿ì ¿ÀÇÂ (È­¸é Áß¾Ó)
// onclick="win_open_sel_member('txt1', 'val1', 'y', 'a');"
//
// rtn_txt    : text  °ª ¹ÞÀ» ÄÁÆ®·Ñ¸í
// rtn_val    : value °ª ¹ÞÀ» ÄÁÆ®·Ñ¸í
// multi      : ¿©·¯°³ ¼±ÅÃ °¡´É ¿©ºÎ (Y or N)
// rtn_type   : ¹ÝÈ¯ÇÒ Çü½Ä (A:ºÎ¼­¿Í ºÎ¼­¿ø, D:ºÎ¼­, U:ºÎ¼­¿ø)
// ====================================================================================
function win_open_sel_member(rtn_txt, rtn_val, multi, rtn_type) {
	var win_opt, o_win;
	var url, win_width, win_height;
	
	url = "/Common/SelectMember.asp?rtntxt=" + rtn_txt + "&rtnval=" + rtn_val + "&multi=" + multi + "&rtntype=" + rtn_type;

	if (multi.toUpperCase() == "N" && rtn_type.toUpperCase() == "D")
		win_width = 300;
	else {
		if (multi.toUpperCase() == "Y")
			win_width = 640;
		else
			win_width = 460;
	}

	win_height = 485;

	win_opt = "width=" + win_width + ",height=" + win_height + ",resizable=no,status=no,scrollbars=yes";
	win_opt += ",top=" + eval((screen.availHeight / 2) - (win_height / 2)) + ",left=" + eval((screen.availWidth / 2) - (win_width / 2));

	o_win = window.open(url, "", win_opt);
	o_win.focus();
}


// ====================================================================================
// ÀÌ¹ÌÁö º¸±â À©µµ¿ì ¿ÀÇÂ (È­¸é Áß¾Ó)
// onclick="win_open_img('/KDATA/Mail/U200407001/img.jpg', 'ImgView', 600, 600);"
//
// img_path   : ÀÌ¹ÌÁö °æ·Î
// win_id     : À©µµ¿ì ÀÌ¸§
// win_width  : À©µµ¿ì °¡·Î Å©±â
// win_height : À©µµ¿ì ¼¼·Î Å©±â
// ====================================================================================
function win_open_img(img_path, win_id, win_width, win_height) {
	var win_opt, o_win;
	
	win_opt = "width=" + win_width + ",height=" + win_height + ",resizable=no,status=no,scrollbars=yes";
	win_opt += ",top=" + eval((screen.availHeight / 2) - (win_height / 2)) + ",left=" + eval((screen.availWidth / 2) - (win_width / 2));

	o_win = window.open("/Common/ImgView.asp?ImgPath=" + escape(img_path), win_id, win_opt);
	o_win.focus();
}


// ====================================================================================
// »ç¿ø Á¤º¸ À©µµ¿ì ¿ÀÇÂ (È­¸é Áß¾Ó)
// onclick="win_open_userinfo('U200407001');"
//
// user_sq : »ç¿ëÀÚ ÀÏ·Ã¹øÈ£
// ====================================================================================
function win_open_userinfo(user_sq) {
	var win_opt, o_win;
	var win_width, win_height;
	
	win_width = 540;
	win_height = 295;

	win_opt = "width=" + win_width + ",height=" + win_height + ",resizable=no,status=no,scrollbars=yes";
	win_opt += ",top=" + eval((screen.availHeight / 2) - (win_height / 2)) + ",left=" + eval((screen.availWidth / 2) - (win_width / 2));

	o_win = window.open("/Common/UserInfoView.asp?UserSQ=" + user_sq, "", win_opt);
	o_win.focus();
}


// ====================================================================================
// À¥ÆäÀÌÁö ´ëÈ­»óÀÚ(Modal) ¿ÀÇÂ
// dialog_open('calender.asp', 'calender', 200, 160, -1, -1, 0)
//
// url        : ÆÄÀÏ¸í
// argu       : ?
// dlg_width  : À©µµ¿ì °¡·Î Å©±â
// dlg_height : À©µµ¿ì ¼¼·Î Å©±â
// dlg_x      : À©µµ¿ì À§Ä¡ x ÁÂÇ¥ (È­¸éÁß¾ÓÀÏ °æ¿ì -1)
// dlg_y      : À©µµ¿ì À§Ä¡ y ÁÂÇ¥
// edge       : 0 sunken(ÀÏ¹ÝÀûÀÎ ¸ð¾ç)
//              1 raised(°æ°íÃ¢°ú °°Àº ÆòÆòÇÑ ¸ð¾ç)
// ====================================================================================
function dialog_open(url, argu, dlg_width, dlg_height, dlg_x, dlg_y, edge) {
	var dlg_opt;
	
	dlg_opt = "dialogWidth:" + dlg_width + "px; dialogHeight:" + dlg_height + "px; help:no; resizable:no; status:no;";

	if (dlg_x >= 0 && dlg_y >= 0)
		dlg_opt += " dialogTop:" + dlg_y + "px; dialogLeft:" + dlg_x + "px;";
	else
		dlg_opt += " center:yes;";

	if (!edge)
		dlg_opt += " edge:sunken;";
	else
		dlg_opt += " edge:raised;";

	return window.showModalDialog(url, argu, dlg_opt);
}


// ====================================================================================
// Ç³¼± µµ¿ò¸» ÇüÅÂ·Î º¸±â
// onmousemove="balloon_move(oDIV, padding_x, padding_y);" onmouseover="balloon_show(oDIV, '³»¿ë');" onmouseout="balloon_hide(oDIV);"
//
// oDIV      : DIV °³Ã¼
// padding_x : ¸¶¿ì½º¿Í Ç³¼±°úÀÇ x °Å¸®
// padding_y : ¸¶¿ì½º¿Í Ç³¼±°úÀÇ y °Å¸®
// ====================================================================================
function balloon_move(oDIV, padding_x, padding_y) {
	if (event.clientX >= (document.body.offsetWidth / 2))
		oDIV.style.posLeft = event.x - (oDIV.offsetWidth + padding_x) + document.body.scrollLeft;
	else
		oDIV.style.posLeft = event.x + padding_x + document.body.scrollLeft;

	if (event.clientY >= (document.body.offsetHeight / 2))
		oDIV.style.posTop = event.y - (oDIV.offsetHeight + padding_y) + document.body.scrollTop;
	else
		oDIV.style.posTop = event.y + padding_y + document.body.scrollTop;
}

function balloon_show(oDIV, str) {
	oDIV.innerHTML = "<TABLE border=0 cellspacing=0 cellpadding=0 bgcolor=#ffffe1 style='border:1 solid #000000;'><TR><TD>" + str.split("£¢").join("\"").split("£§").join("\'") + "</TD></TR></TABLE>";

	if (event.clientX >= (document.body.offsetWidth / 2))
		oDIV.style.posLeft = event.x - (oDIV.offsetWidth + 10) + document.body.scrollLeft;
	else
		oDIV.style.posLeft = event.x + 10 + document.body.scrollLeft;

	if (event.clientY >= (document.body.offsetHeight / 2))
		oDIV.style.posTop = event.y - (oDIV.offsetHeight + 10) + document.body.scrollTop;
	else
		oDIV.style.posTop = event.y + 10 + document.body.scrollTop;

	oDIV.style.visibility = "visible";
}

function balloon_hide(oDIV) {
	oDIV.style.visibility = "hidden";
	oDIV.innerHTML = "";
}


// ====================================================================================
// ÆÄÀÏ¾÷·Îµå ÁøÇàÃ¢ ¿ÀÇÂ
// ====================================================================================
function dialog_open_progbar() {
	window.showModelessDialog("/Common/FileUpProgBar.asp", null, "dialogWidth=385px; dialogHeight:165px; center:yes; status:no;");
}


// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ
// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ ÀÔ·Â Á¦¾î, °ËÁõ  ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ
// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ

// ====================================================================================
// ÁÖ¹Îµî·Ï¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇß´ÂÁö È®ÀÎ
// 
// aaa : ÁÖ¹Î¹øÈ£ ¾Õ 6 ÀÚ¸®
// bbb : ÁÖ¹Î¹øÈ£ µÚ 7 ÀÚ¸®
// ====================================================================================
function confirm_jumin_num(aaa, bbb) {
	var tmp = 0;
	var yy = aaa.substring(0, 2);
	var mm = aaa.substring(2, 4);
	var dd = aaa.substring(4, 6);
	var sex = bbb.substring(0, 1);
	var ccc = aaa + bbb;
	var i;

	if ((ccc.length != 13) || ( mm < 1 || mm > 16 || dd < 1) || (sex != 1 && sex != 2 && sex != 3 && sex != 4)) return false;

	for (i = 0; i <= 5; i++)
		tmp = tmp + ((i % 8 + 2) * parseInt(aaa.substring(i, i + 1)));

	for (i = 6; i <= 11; i++)
		tmp = tmp + ((i % 8 + 2) * parseInt(bbb.substring(i - 6, i - 5)));

	tmp = 11 - (tmp % 11);
	tmp = tmp % 10;

	if (tmp != bbb.substring(6,7)) return false;

	return true;
}


// ====================================================================================
// ¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â
// ====================================================================================
function only_number() {
	if (!((event.keyCode >= 48 && event.keyCode <= 57) || event.keyCode == 46))
		event.returnValue = false;
}


// ====================================================================================
// ¿£ÅÍÅ°¸¦ ´­·¶À» °æ¿ì ÇØ´ç ÇÔ¼ö¸¦ È£Ãâ
// 
// fn_name : ÇÔ¼ö¸í ("window.close()")
// ====================================================================================
function enter_fn_exec(fn_name) {
    if (event.keyCode == 13)
        setTimeout(fn_name, 0);
}


// ====================================================================================
// ºó°ª Çã¿ëÇÏÁö ¾Ê´Â ÀÔ·ÂÆû Ã¼Å©
// 
// ctrl : ÄÁÆ®·Ñ °³Ã¼ (document.all.Email)
// msg  : °æ°íÃ¢¿¡ º¸¿©Áú ³»¿ë
// ====================================================================================
function not_null(ctrl, msg) {
	if (ctrl.value.trim() == "") {
		alert(msg);
		ctrl.focus();
		return false;
	}

	return true;
}


// ====================================================================================
// ¸ÞÀÏÁÖ¼Ò Çü½Ä °Ë»ç
//
// ctrl : ÄÁÆ®·Ñ °³Ã¼ (document.all.Email)
// ====================================================================================
function confirm_email(ctrl) {
	var exclude = /[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check = /@[\w\-]+\./;
	var checkend = /\.[a-zA-Z]{2,3}$/;

	if (((ctrl.value.search(exclude) != -1) || (ctrl.value.search(check)) == -1) || (ctrl.value.search(checkend) == -1)) {
		alert("¸ÞÀÏÁÖ¼Ò Çü½Ä¿¡ ¾î±ß³³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		ctrl.focus();
		return false;
	} 

	return true;
}


// ====================================================================================
// ±ÛÀÚ¼ö °è»ê
//
// str : ³»¿ë
// ====================================================================================
function chk_str_len(str) {
	var str_len = 0;

	var Nav = navigator.appName;
	var Ver = navigator.appVersion;

	var IsExplorer = false;

	var ch;

	if ((Nav == 'Microsoft Internet Explorer') && (Ver.charAt(0) >= 4))
		IsExplorer = true;

	if (IsExplorer) {
		for (var i = 0; i < str.length; i++) {
			ch = str.charAt(i);

			if ((ch == "\n") || ((ch >= "¤¿") && (ch <= "È÷")) || ((ch >="¤¡") && (ch <="¤¾")))
				str_len += 2;
			else
				str_len += 1;
		}
	}
	else
		str_len = str.length;

   return str_len;
}


// ====================================================================================
// ÀüÈ­¹øÈ£ Çü½Ä °Ë»ç
//
// ctrl : ÄÁÆ®·Ñ °³Ã¼
// ====================================================================================
function confirm_phone_num(ctrl) {
    var RegExp = /^0(?:\d{1}|\d{2}|\d{3})-(?:\d{3}|\d{4})-\d{4}$/;

    if (ctrl.value.search(RegExp) == -1) {
        alert("¿Ã¹Ù¸¥ ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.\n\n¿¹) 02-100-1000");
		ctrl.focus();
		return false;
	}
	else
		return true;
}

 
// ====================================================================================
// ÇÚµåÆù¹øÈ£ Çü½Ä °Ë»ç
//
// ctrl : ÄÁÆ®·Ñ °³Ã¼
// ====================================================================================
function confirm_handphone_num(ctrl) {
    var RegExp = /^01(?:0|1|[6-9])-(?:\d{3}|\d{4})-\d{4}$/;

    if (ctrl.value.search(RegExp) == -1) {
        alert("¿Ã¹Ù¸¥ ÇÚµåÆù¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.\n\n¿¹) 010-100-1000");
		ctrl.focus();
		return false;
	}
	else
		return true;
}

 
// ====================================================================================
// ³â¿ùÀÏ Çü½Ä °Ë»ç
//
// ctrl : ÄÁÆ®·Ñ °³Ã¼
// ====================================================================================
function confirm_yyyymmdd(ctrl) {
    var RegExp = /^(?:1|2)\d{3}[-./](?:0[1-9]|1[0-2])[-./](?:0[1-9]|[12]\d{1}|3[01])$/;

    if (ctrl.value.search(RegExp) == -1) {
        alert("¿Ã¹Ù¸¥ ³â¿ùÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä.\n\n¿¹) [1900-01-01] [1900/01/01] [1900.01.01]");
		ctrl.focus();
		return false;
	}
	else
		return true;
}



// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ
// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ Æû ÄÁÆ®·Ñ  ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ
// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ

// ====================================================================================
// ¸®½ºÆ®¿¡¼­ Ã¼Å©¹Ú½º ÀüÃ¼¼±ÅÃ (¹ÝÀü)
//
// oAllChkBox : ÀüÃ¼¼±ÅÃ Ã¼Å©¹Ú½º
// oChkBox    : Ã³¸®µÉ Ã¼Å©¹Ú½º
// ====================================================================================
function chk_all_chkbox(oAllChkBox, oChkBox) {
	var bln_checked;

	if (oAllChkBox.checked)
		bln_checked = true;
	else
		bln_checked = false;

	if (eval(oChkBox)) {
		if (eval(oChkBox.length)) {
			var chkbox_count = oChkBox.length;

			for (var i = 0; i < chkbox_count; i++)
				oChkBox[i].checked = bln_checked;
		}
		else
			oChkBox.checked = bln_checked;
	}
}


// ====================================================================================
// ¼±ÅÃÇÑ(Ã¼Å©ÇÑ) ´ë»óÀÌ ÇÏ³ª ÀÌ»ó ÀÖ´ÂÁö È®ÀÎ
//
// oChkBox : Ã¼Å©¹Ú½º
// ====================================================================================
function confirm_check(oChkBox) {
	var chkbox_checked;

	chkbox_checked = false;

	if (eval(oChkBox)) {
		if (eval(oChkBox.length)) {
			var chkbox_count = oChkBox.length;

			for (var i = 0; i < chkbox_count; i++) {
				if (oChkBox[i].checked)
					chkbox_checked = true;
			}
		}
		else {
			if (oChkBox.checked)
				chkbox_checked = true;
		}
	}

	return chkbox_checked;
}


// ====================================================================================
// ´ÙÀ½ ÄÁÆ®·Ñ·Î ÀÌµ¿
//
// ctrl : ÄÁÆ®·Ñ °³Ã¼ (document.all.Email)
// ====================================================================================
function go_next_ctrl(ctrl) {
	var i;
	var keyCode = event.keyCode ? event.keyCode :
                  event.which   ? event.which   : event.charCode;

	if( keyCode == 13 ) {
		for (i = 0; i < ctrl.form.elements.length; i++ ) {
			if (ctrl == ctrl.form.elements[i])
				break;
		}

		i = (i + 1) % ctrl.form.elements.length;

		ctrl.form.elements[i].focus();

		return false;
	}
	else
		return true;
}


// ====================================================================================
// ÄÞº¸¹Ú½º¿¡¼­ ÇØ´ç°ª ¼±ÅÃ Ã³¸®
//
// oSELECT   : SELECT ÄÁÆ®·Ñ °³Ã¼
// str_value : ¼±ÅÃÇÒ °ª
// ====================================================================================
function sel_opt(oSELECT, str_value) {
	for (var i = 0; i < oSELECT.length; i++) {
		if (oSELECT[i].value == str_value) {
			oSELECT[i].selected = true;
			break;
		}
	}
}


// ====================================================================================
// SELECT¿¡ OPTION Ãß°¡, Á¦°Å, ÀÌµ¿ÇÏ±â, °ª Á¶È¸, ÀüÃ¼¼±ÅÃ, ¼±ÅÃÇØÁ¦
//
// 1. Ãß    °¡ : add_opt(SELECT, OPTION text, OPTION value)
// 2. Á¦    °Å : remove_opt(SELECT)
// 3. ¸ðµÎÁ¦°Å : remove_all_opts(SELECT)
// 4. ÀÌ    µ¿ : move_opt(¿øº» SELECT, ´ë»ó SELECT, Áßº¹ Çã¿ë, º¹»ç or ÀÌµ¿)
//
//               Áßº¹ Çã¿ë
//                0 : ºÒ°¡
//                1 : ¼±ÅÃ
//                2 : °¡´É
//
//               º¹»ç & ÀÌµ¿
//                0 : º¹»ç
//                1 : ÀÌµ¿
//
// 5. ¿É¼Ç text  : get_opt_txts(SELECT)
//                 ¼¿·ºÆ® ¹Ú½ºÀÇ ¸ðµç ±Û ¹ÝÈ¯
// 6. ¿É¼Ç value : get_opt_vals(SELECT)
//                 ¼¿·ºÆ® ¹Ú½ºÀÇ ¸ðµç °ª ¹ÝÈ¯
// 7. ÀüÃ¼¼±ÅÃ
// 8. ¼±ÅÃÇØÁ¦
// ====================================================================================

function add_opt(oSELECT, opt_text, opt_val) {
	if ((opt_text == "") || (opt_val == "")) return;

	var opts_len = oSELECT.options.length;

	for (i = 0; i < opts_len; i++) {
		if ((oSELECT.options[i].text == opt_text) && (oSELECT.options[i].value == opt_val))
			return;
	}

	oSELECT.options[oSELECT.options.length] = new Option(opt_text, opt_val, false, false);
}

function remove_opt(oSELECT) {
	if (oSELECT.selectedIndex >= 0)
		oSELECT.remove(oSELECT.selectedIndex);
}

function remove_all_opts(oSELECT) {
	var i, opts_len

	opts_len = oSELECT.options.length;

	if (opts_len > 0) {
		for (i = opts_len - 1; i >= 0; i--)
			oSELECT.remove(i);
	}
}

function move_opt(oSELECT1, oSELECT2, overlap, remove_yn) {
	var i, opts_len, same, oText, oValue

	if (oSELECT1.selectedIndex >= 0) {
		opts_len = oSELECT2.options.length;

		same = false;

		oText = oSELECT1.options[oSELECT1.selectedIndex].text;
		oValue = oSELECT1.options[oSELECT1.selectedIndex].value;

		for (i = 0; i < opts_len; i++) {
			if ((oSELECT2.options[i].text == oText) && (oSELECT2.options[i].value == oValue))
				same = true;
		}

		switch (overlap) {
			case 0 :
				if (!same)
					add_opt(oSELECT2, oText, oValue);

				break;
			case 1 :
				if (same) {
					if (!confirm("ÀÌ¹Ì ´ë»ó¿¡ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù. ÇöÀç ¸ñ·Ï¿¡¼­ »èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?"))
						remove_yn = 0;
					else
						remove_yn = 1;
				}
				else
					add_opt(oSELECT2, oText, oValue);

				break;
			case 2 :
				add_opt(oSELECT2, oText, oValue);

				break;
		}

		if (remove_yn == 1)
			remove_opt(oSELECT1);
	}
}

function get_opt_txts(oSELECT) {
	var i, opts_len, str_opt_txts;

	opts_len = oSELECT.options.length;
	str_opt_txts = "";

	for (i = 0; i < opts_len; i++)
		str_opt_txts += oSELECT.options[i].text + ", ";

	return str_opt_txts.substring(0, str_opt_txts.length - 2);
}

function get_opt_vals(oSELECT) {
	var i, opts_len, str_opt_vals;

	opts_len = oSELECT.options.length;
	str_opt_vals = "";

	for (i = 0; i < opts_len; i++)
		str_opt_vals += oSELECT.options[i].value + ", ";

	return str_opt_vals.substring(0, str_opt_vals.length - 2);
}

function select_all(oSELECT) {
	var opt_len = oSELECT.length;

	if (opt_len > 0) {
		for (var i = 0; i < opt_len; i++)
			oSELECT.options[i].selected = true;
	}
}

function deselect_all(oSELECT) {
	var opt_len = oSELECT.length;

	if (opt_len > 0) {
		for (var i = 0; i < opt_len; i++)
			oSELECT.options[i].selected = false;
	}
}


// ====================================================================================
// Ã·ºÎÆÄÀÏ¼ö º¯°æ
//
// oSELECT : SELECT ÄÁÆ®·Ñ °³Ã¼
// oDIV    : DIV °³Ã¼
// ====================================================================================
function chg_file_cnt(oSELECT, oDIV, oFILE) {

	var i;
	for (i = 0; i < oDIV.length; i++) {
		oFILE[i].disabled = true;
		oDIV[i].style.display = "none";
	}

	if (oSELECT.value > 0) {
		for (i = 0; i < oSELECT.value; i++) {
			oFILE[i].disabled = false;
			oDIV[i].style.display = "block";
		}
	}
}


// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ
// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ ±âÅ¸ ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ
// ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ¢Æ

// ====================================================================================
// ÆäÀÌÁö ÀÌµ¿
//
// url    : ÀÌµ¿ÇÒ URL
// target : ´ë»ó À©µµ¿ì
// ====================================================================================
function chg_loc(url, target) {
	eval(target).location.href = url;
}


// ====================================================================================
// VBSÀÇ Trim ±¸Çö (LTrim, RTrim µ¿ÀÏ)
// ====================================================================================
String.prototype.trim = function() {
    return this.replace(/(^ *)|( *$)/g, "");
}

String.prototype.ltrim = function() {
    return this.replace(/(^ *)/g, "");
}

String.prototype.rtrim = function() {
    return this.replace(/( *$)/g, "");
}


// ====================================================================================
// ¹è°æ»ö º¯°æ
// oOBJECT  : °³Ã¼
// bg_color : »ö±ò
// ====================================================================================
function chg_bgcolor(oOBJECT, bg_color) {
	oOBJECT.style.backgroundColor = bg_color;
}

function chg_tr_bgcolor(oOBJECT, clsnm) {
	oOBJECT.className = clsnm;
}

// ====================================================================================
// ·Ñ¿À¹ö ÀÌ¹ÌÁö ½ºÅ©¸³Æ® (µå¸²À§¹ö ÀÚµ¿ »ý¼º)
// ====================================================================================
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// ====================================================================================
// ÄíÅ° ÀúÀå
// ====================================================================================
function setCookie(name, value, expires) {
	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + expires.toGMTString();
}

//¹®ÀÚ ±æÀÌ Ã¼Å©
function CheckLength(objString, intLength, strMsg) {
	if (chk_str_len(objString.value) > intLength) {
  	alert("[" + strMsg + "]ÀÇ ±æÀÌ´Â " + intLength + "ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù. ÇÑ±Û 1ÀÚ´Â 2ÀÚ·Î °è»êµË´Ï´Ù.");
		return false;
	}
	return true;
}


// ====================================================================================
// Ã·ºÎÆÄÀÏ ´Ù¿î·Îµå
//
// file_path : °æ·Î (/ Æ÷ÇÔ)
// file_nm   : ÆÄÀÏ¸í
// ====================================================================================
function download_attach(file_path, file_nm) {
	location.href = "/Common/DownloadAttach.asp?PathV=" + file_path + escape(file_nm);
}


// ====================================================================================
// ÁÂÃøÀÌ¹ÌÁö ½ºÅ©·Ñ

// ====================================================================================
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

function CheckUIElements()
{
        var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

        if ( bNetscape4plus ) { // ³×Ã÷ÄÉÀÌÇÁ ¿ë ¼³Á¤
                yMenuFrom   = document["moveTop"].top;
                yMenuTo     = top.pageYOffset + 180;   // À§ÂÊ À§Ä¡
        }
        else if ( bExplorer4plus ) {  // ÀÍ½ºÇÃ·Î·¯ ¿ë ¼³Á¤
                yMenuFrom   = parseInt (moveTop.style.top, 10);
                yMenuTo     = document.body.scrollTop + 180; // À§ÂÊ À§Ä¡
        }

        timeoutNextCheck = 500;

        if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }


        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divLinkButton"].top += yOffset;
                else if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }
        if ( yMenuFrom != yMenuTo ) {
                yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
                if ( yMenuTo < yMenuFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["moveTop"].top += yOffset;
                else if ( bExplorer4plus )
                        moveTop.style.top = parseInt (moveTop.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function OnLoad()
{
        var y;

        // ÇÁ·¹ÀÓ ¿¡¼­ ¹þ¾î³ª°Ô ÇÏ´Â ÇÔ¼öÀÔ´Ï´Ù. ÇÁ·¹ÀÓ¿¡ ³ÖÀ¸·Á¸é »èÁ¦ÇÏ¼¼¿ä
//        if ( top.frames.length )
         //       top.location.href = self.location.href;

        // Æä¿¡Áö ·Îµù½Ã Æ÷Áö¼Ç
        if ( bNetscape4plus ) {
                document["moveTop"].top = top.pageYOffset + 2;
                document["moveTop"].visibility = "visible";
        }
        else if ( bExplorer4plus ) {
                moveTop.style.top = document.body.scrollTop + 2;
                moveTop.style.visibility = "visible";
        }

        CheckUIElements();
        return true;
}

// ====================================================================================
// ÇÃ·¡½Ã ½ºÅ©¸³Æ®

// ====================================================================================
function FlWrite(awardCd,width,height)
{
	var fl='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" width="'+width+'" height="'+height+'">'
	 +'<param name="movie" value="/images/nevi/'+awardCd+'.swf">'
	 +'<param name="quality" value="high">'
	 + '<embed src="/images/nevi/'+awardCd+'.swf" '
	 +'	quality="high" pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" '
	 +'	type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed> '
	 +'</OBJECT>';
	 document.write(fl);
}
Error: Unable to read footer file.

