function menuLink(midx, sidx, isKeyPress) {
	var url = "";
	switch (midx) {
		case 1 : //±Ç¿µ±æ
			switch (sidx) {
				case 1 : //ÀÎ»ç¸»
					url = "/about/about_01.asp";
					break;
				case 2 : //ÇÁ·ÎÇÊ
					url = "/about/about_02.asp";
					break;
			}
			break;

		case 2 : //Á¤Ã¥/º¸µµÀÚ·á
			switch (sidx) {
				case 1 : //º¸µµÀÚ·á
					url = "/data/data_01.asp";
					break;
				case 2 : //Á¤Ã¥
					url = "/data/data_02.asp";
					break;
			}
			break;

		case 3 : //¾ð·Ðº¸µµ
			switch (sidx) {
				case 1 : //¾ð·Ðº¸µµ
					url = "/data/data_03.asp";
					break;
			}
			break;

		case 4 : //ÀÇÁ¤È°µ¿
			switch (sidx) {
				case 0 : //ÀÇÁ¤È°µ¿ ¸ÞÀÎ
					url = "/data/data_04.asp";
					break;
				case 1 : //¿µ»óÀÚ·á
					url = "/data/data_05.asp";
					break;
				case 2 : //»çÁøÀÚ·á
					url = "/data/data_06.asp";
					break;
				case 3 : //Ã¢¿ø¼Ò½Ä
					url = "/data/data_07.asp";
					break;
			}
			break;

		case 5 : //ÀÚÀ¯°Ô½ÃÆÇ
			switch (sidx) {
				case 1 : //ÀÚÀ¯°Ô½ÃÆÇ
					url = "/board/board_01.asp";
					break;
			}
			break;

		case 6 : //ÈÄ¿øÇÏ±â
			switch (sidx) {
				case 1 : //ÈÄ¿øÇÏ±â
					url = "/support/support_01.asp";
					break;
			}
			break;

		default :
			url = "/";
			break;
	}

	url = (isKeyPress)?"/lib/chk_menu.asp":url;

	if (midx) {
		url = url + "?midx=" + midx + "&sidx=" + sidx;
	} else if (sidx) {
		url = url + "?sidx=" + sidx;
	}

	with (document.form1) {
		try {
			cpage.value = "";
		} catch (e) {}
		try {
			searchKind.value = "";
		} catch (e) {}
		try {
			searchText.value = "";
		} catch (e) {}

		target = (isKeyPress)?"HIDDEN":"_self";
		action = url;
		submit();
	}
}

function _viewImg(value) {
	window.open( "/lib/viewImg.asp?value=" + value, "bigimg", "width=100,height=100,top=10,left=10,toolbar=no,location=no,menubar=no,scrollbars=no,resizable=no,status=no" );
}

function fileDown(value) {
	with (document.form1) {
		downfilename.value = value;

		target = "HIDDEN";
		action = "/lib/download.asp";
		submit();

		target = "_self";
	}
}

function findZip() {
	var url		= "/lib/find_addr.asp";

	var params	= "";
		params	= params + "?zip=zip";
		params	= params + "&addr1=addr1";
		params	= params + "&addr2=addr2";

	var w = 450;
	var h = 310;

	var l = (screen.width  - w) / 2;
	var t = (screen.height - h) / 2 - 200;

	window.open( url + params, "findZip", "width=" + w + ",height=" + h + ",left=" + l + ",top=" + t + ",toolbar=no,location=no,menubar=no,scrollbars=no,resizable=no,status=no" );
}

// =====================================================================
// ----- 1. ÇÃ·¡½¬ °ü·Ã ½ÃÀÛ -------------------------------------------

// ÇÃ·¡½¬ - Åõ¸í
function swf_trans(src,w,h)	// (ÀÌ¸§, ³ÐÀÌ, ³ôÀÌ)
{
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="bgcolor" value="#ffffff">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="menu" value="false">';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" allowScriptAccess="sameDomain" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';

	html += '<\/object>';
	document.write(html);
}

// ÇÃ·¡½¬ - ¸ÞÀÎ
function swf_top(src,w,h)	// (ÀÌ¸§, ³ÐÀÌ, ³ôÀÌ)
{
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="param" width="'+w+'%" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="bgcolor" value="#ffffff">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="menu" value="false">';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'%" height="'+h+'" swliveconnect="true" id="param" allowScriptAccess="sameDomain" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';

	html += '<\/object>';
	document.write(html);
}
// ----- 1. ÇÃ·¡½¬ °ü·Ã ³¡ ---------------------------------------------
// =====================================================================

function numberChk(obj) {
	if (isNaN(obj.value)) {
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
		obj.select();
		obj.focus();
		return;
	}
}

function NumberFormat(obj) {
	numberChk(obj);

	obj.value = obj.value.replaceAll(",", "");
	obj.value = NumberFormating(obj.value);
}

function NumberFormating(values) {
	var str="";
	var hi;
	var int = values;

	if (int >= 1000) {
		while (int >= 1000) {
			hi = Math.floor(int/1000);
			lostr = "000" + int%1000;
			len = lostr.length;
			lostr = lostr.substring(len-3,len);
			if (!str) {
				str = lostr;
			} else {
				str = lostr + "," + str;
			}
			int = Math.floor(int/1000);
		}
		str = hi + "," + str;

		return str;
	} else {
		return (int == "")?0:int;
	}
}

function UnNumberFormat(obj) {
	obj.value = obj.value.replaceAll(",", "");
	obj.select();
}

String.prototype.replaceAll = function(oldStr, newStr) {
	var rStr = oldStr;

	rStr = rStr.replace(/\\/g, "\\\\");
	rStr = rStr.replace(/\^/g, "\\^");
	rStr = rStr.replace(/\$/g, "\\$");
	rStr = rStr.replace(/\*/g, "\\*");
	rStr = rStr.replace(/\+/g, "\\+");
	rStr = rStr.replace(/\?/g, "\\?");
	rStr = rStr.replace(/\./g, "\\.");
	rStr = rStr.replace(/\(/g, "\\(");
	rStr = rStr.replace(/\)/g, "\\)");
	rStr = rStr.replace(/\|/g, "\\|");
	rStr = rStr.replace(/\,/g, "\\,");
	rStr = rStr.replace(/\{/g, "\\{");
	rStr = rStr.replace(/\}/g, "\\}");
	rStr = rStr.replace(/\[/g, "\\[");
	rStr = rStr.replace(/\]/g, "\\]");
	rStr = rStr.replace(/\-/g, "\\-");

  	var re = new RegExp(rStr, "g");
    return this.replace(re, newStr);
}


String.prototype.trim = function() {
	return this.replace(/^(\s+)|(\s+)$/g,"");
}

// ##########################################################################
// ##
// ## Html Editor °ü·Ã
// ##
// ##########################################################################

_editor_url = "/lib/htmlarea/";

var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);

if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
	document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
	document.write(' language="JavaScript"></scr' + 'ipt>');
} else {
	document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>');
}

function LoadHtmlEditor(formName) {
	LoadHtmlEditor(formName, 300);
}

function LoadHtmlEditor(formName, _height) {
	var config = new Object();    // create new config object

	config.width = "100%";
	config.height = _height;
	config.bodyStyle = 'background-color: white; font-family: "±¼¸²"; font-size: 9pt; color:555555;';
	config.debug = 0;

	// NOTE:  You can remove any of these blocks and use the default config!

	config.toolbar = [
		['fontname'],
		['fontsize'],
	//    ['fontstyle'],
		['bold','italic','underline','separator'],
		['strikethrough','subscript','superscript','separator'],
		['linebreak'],
		['justifyleft','justifycenter','justifyright','separator'],
		['OrderedList','UnOrderedList','Outdent','Indent','separator'],
		['forecolor','backcolor','separator'],
		['HorizontalRule','Createlink','InsertImage','InsertTable','htmlmode','popupeditor'],
	//    ['about','help','popupeditor'],
	];

	config.fontnames = {
		"±¼¸²":            "±¼¸²",
		"±¼¸²Ã¼":          "±¼¸²Ã¼",
		"µ¸¿ò":            "µ¸¿ò",
		"µ¸¿òÃ¼":          "µ¸¿òÃ¼",
		"¹ÙÅÁ":            "¹ÙÅÁ",
		"¹ÙÅÁÃ¼":          "¹ÙÅÁÃ¼",
		"±Ã¼­":            "±Ã¼­",
		"±Ã¼­Ã¼":          "±Ã¼­Ã¼",
		"Arial":           "arial, helvetica, sans-serif",
		"Courier New":     "courier new, courier, mono",
		"Georgia":         "Georgia, Times New Roman, Times, Serif",
		"Tahoma":          "Tahoma, Arial, Helvetica, sans-serif",
		"Times New Roman": "times new roman, times, serif",
		"Verdana":         "Verdana, Arial, Helvetica, sans-serif",
		"impact":          "impact",
		"WingDings":       "WingDings"
	};

	config.fontsizes = {
		"1 (8 pt)":  "1",
		"2 (10 pt)": "2",
		"3 (12 pt)": "3",
		"4 (14 pt)": "4",
		"5 (18 pt)": "5",
		"6 (24 pt)": "6",
		"7 (36 pt)": "7"
	  };

	//config.stylesheet = "http://www.domain.com/sample.css";

	config.fontstyles = [   // make sure classNames are defined in the page the content is being display as well in or they won't work!
	  { name: "headline",     className: "headline",  classStyle: "font-family: arial black, arial; font-size: 28px; letter-spacing: -2px;" },
	  { name: "arial red",    className: "headline2", classStyle: "font-family: arial black, arial; font-size: 12px; letter-spacing: -2px; color:red" },
	  { name: "verdana blue", className: "headline4", classStyle: "font-family: verdana; font-size: 18px; letter-spacing: -2px; color:blue" }

	// leave classStyle blank if it's defined in config.stylesheet (above), like this:
	//  { name: "verdana blue", className: "headline4", classStyle: "" }
	];

	editor_generate(formName, config);
}


function na_getCookie(name) {
	var nameOfCookie = name + "=";
	var x = 0;
	while (x <= document.cookie.length) {
		var y = (x+nameOfCookie.length);
		if (document.cookie.substring(x, y) == nameOfCookie) {
			if ((endOfCookie = document.cookie.indexOf(";", y)) == -1)
				endOfCookie = document.cookie.length;

			return unescape(document.cookie.substring(y, endOfCookie ));
		}

		x = document.cookie.indexOf(" ", x) + 1;

		if (x == 0)
			break;
	}
	return "";
}

function na_setCookie(name, value, expiredays) {
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() + expiredays);

	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
