var BrowserCheck, ImageError;
var ShowLoop = [];
var LanguageCode = false;
var LanguageArray = ["kr", "eng", "jp", "cn"];
var ImageExt = ["jpg", "jpeg", "gif", "png"];

if (typeof(HTMLElement) != "undefined" && typeof(HTMLElement.prototype.__defineGetter__) != "undefined") {
	HTMLElement.prototype.__defineGetter__("innerText", function() {
		if (this.textContent) {
			return this.textContent;
		} else {
			var str = this.ownerDocument.createRange();
			str.selectNodeContents(this);
			return str.toString();
		}
	});
	HTMLElement.prototype.__defineSetter__("innerText", function(sText) {
		this.innerHTML = sText;
	});
}

String.prototype.trim = function() {
	return this.replace(/(^\s*)|(\s*$)/g, "");
}

String.prototype.leftstr = function(n) {
	var Len = this.length;
	if (Len < 1 || n < 1) {
		return "";
	} else if (Len > n) {
		return this.substring(0, n);
	} else {
		return this;
	}
}

String.prototype.rightstr = function(n) {
	var Len = this.length;
	if (Len < 1 || n < 1) {
		return "";
	} else if (Len > n) {
		return this.substring(Len, (Len - n));
	} else {
		return this;
	}
}

Array.prototype.unique = function() {
	var tmp = {};
	for(var i=0; i<this.length; i++) if(typeof(tmp[this[i]]) == "undefined") tmp[this[i]] = 1;
	this.length = 0;
	for(var k in tmp) this[this.length] = k;
	return this;
}

function isNull(n) {
	return (n == null);
}

function isArray(n) {
	return Object.prototype.toString.call(n) == "[object Array]";
}

function isNumeric(n) {
	var pattern = /^\-?\d+$/;
	return (pattern.test(n));
}

function isBlank(n) {
	if(n == null) return true;
	for(var i = 0; i < n.length; i++) if((n.charAt(i) != " ") && (n.charAt(i) != "\t") && (n.charAt(i) != "\n") && (n.charAt(i) != "\r")) return false;
	return true;
}

function isInteger(n) {
	if(isBlank(n)) return false;
	for(var i = 0; i < n.length; i++) if(!isDigit(n.charAt(i))) return false;
	return true;
}

function SYMAN_MsgBox(mb_message, mb_language) {
	alert(SYMAN_LanguageMessage(mb_message, mb_language));
}

function SYMAN_MsgWrite(mb_message, mb_language) {
	document.write(SYMAN_LanguageMessage(mb_message, mb_language));
}

function SYMAN_BrowserCheck() {
	var bc_AppName = navigator.appName;
	var bc_userAgent = navigator.userAgent.replace(/\s/g, "");
	var bc_BrowserType = null;
	var bc_BrowserName = null;

	if(bc_AppName.indexOf("Internet Explorer") >= 0) {
		bc_BrowserType = "IE";
		if(bc_userAgent.indexOf("MSIE") > 0) {
			bc_BrowserName = bc_userAgent.match(/MSIE([\d].[\d])/ig);
		}
	} else if(bc_AppName.indexOf("Netscape") >= 0) {
		bc_BrowserType = "NN";
		if(bc_userAgent.indexOf("Firefox") > 0) {
			//bc_BrowserType = "FF";
			bc_userAgent = bc_userAgent.replace(/\//ig, "");
			bc_BrowserName = bc_userAgent.match(/Firefox([\d].[\d])/ig);
		} else if(bc_userAgent.indexOf("Netscape")>0) {
			bc_userAgent = bc_userAgent.replace(/\//ig, "");
			bc_BrowserName = bc_userAgent.match(/Netscape([\d].[\d])/ig);
		}
	}
	return [bc_BrowserType, bc_BrowserName, bc_userAgent];
}
BrowserCheck = SYMAN_BrowserCheck();

function SYMAN_ScriptSrc(ss_id, ss_src) {
	var ss_script, ss_obj;
	ss_obj = $(ss_id);
	if (ss_obj) ss_obj.parentNode.removeChild(ss_obj);
	ss_script = document.createElement("script");
	ss_script.language = "javascript";
	ss_script.type = "text/javascript";
	ss_script.src = ss_src;
	ss_script.id = ss_id;
	document.body.appendChild(ss_script);
}

function SYMAN_LanguageCode(lc_language) {
	if (lc_language) for(var i in LanguageArray) if (LanguageArray[i] == lc_language) return lc_language;
	lc_language = LanguageCode;
	if (!lc_language) lc_language = LanguageCode = (document.getElementById("language_code")) ? document.getElementById("language_code").value : LanguageArray[0];
	return lc_language;
}

function SYMAN_LanguageAlt(la_target) {
	var la_length, la_language, la_message;
	la_length = arguments.length;
	if (la_length == 2) {
		la_message = SYMAN_LanguageMessage(arguments[1]);
		la_target.alt = la_message;
		la_target.title = la_message;
	} else {
		la_language = SYMAN_LanguageCode();
		for(var i=0; i<LanguageArray.length&&i<=la_length; i++) {
			if (la_language == LanguageArray[i]) {
				la_target.alt = arguments[i + 1];
				la_target.title = arguments[i + 1];
				break;
			}
		}
	}
}

function SYMAN_LanguageContent() {
	var lc_length, lc_language;
	lc_length = arguments.length;
	if (lc_length == 1) {
		SYMAN_MsgWrite(arguments[0]);
	} else {
		lc_language = SYMAN_LanguageCode();
		for(var i=0; i<LanguageArray.length&&i<=lc_length; i++) {
			if (lc_language == LanguageArray[i]) {
				document.write(arguments[i]);
				break;
			}
		}
	}
}

function SYMAN_SubstrCount(sc_string, sc_target) {
	var sc_count = 0;
	var sc_len = sc_target.length;
	for(var i=0; i<sc_string.length; i++) if(sc_string.substr(i, sc_len) == sc_target) sc_count++;
	return sc_count;
}

function SYMAN_NumberCheck(target) {
	if(!isNumeric(target.value.replace(/\s/g, ""))) {
		SYMAN_MsgBox("ERROR_NUMBERS");
		target.value = "";
		target.focus();
	} else {
		target.value = parseInt(target.value, 10);
	}
}

function SYMAN_AlnumCheck(target) {
	var pattern = /^[\w]{1,}$/;
	if(!pattern.test(target.value)) {
		SYMAN_MsgBox("ERROR_ALNUM");
		target.value = "";
		target.focus();
	}
}

function SYMAN_IDCheck(target) {
	var pattern = /^[\w_\-]{1,}$/;
	if(!pattern.test(target.value)) {
		SYMAN_MsgBox("ERROR_SALNUM");
		target.value = "";
		target.focus();
	}
}

function SYMAN_CodeCheck(target) {
	var pattern = /^[\w_\-\.\(\)]{1,}$/;
	if(!pattern.test(target.value)) {
		SYMAN_MsgBox("ERROR_SALNUM");
		target.value = "";
		target.focus();
	}
}

function SYMAN_getCookie(gc_target) {
	var gc_string, gc_length, gc_cookie, gc_end, i, j;
	gc_cookie = document.cookie.length;
	if(gc_cookie > 0) {
		i = 0;
		gc_string = new String(gc_target + "=");
		gc_length = gc_string.length;
		while(i < gc_cookie) {
			j = i + gc_length;
			if(document.cookie.substring(i, j) == gc_string) {
				gc_end = document.cookie.indexOf (";", j);
				if (gc_end == -1) gc_end = document.cookie.length;
				return unescape(document.cookie.substring(j, gc_end));
			}
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
	}
	return "";
}

function SYMAN_setCookie(sc_target, sc_value, sc_expiredays) {
	var sc_date, sc_string;
	sc_string = sc_target + "=" + escape(sc_value) + "; path=/;";
	if (isNumeric(sc_expiredays)) {
		sc_date = new Date();
		sc_date.setDate(sc_date.getDate() + parseInt(sc_expiredays, 10));
		sc_string += " expires=" + sc_date.toGMTString() + ";";
	}
	document.cookie = sc_string;
}

function SYMAN_delCookie(dc_target) {
	SYMAN_setCookie(dc_target, "", 0);
}

function SYMAN_BusinoCheck(sc_str) {
	//return true;// 임시 체크 중지
	var sc_sum, sc_list, sc_array, sc_check;
	sc_sum = 0;
	sc_list = new Array(10);
	sc_array = new Array("1", "3", "7", "1", "3", "7", "1", "3", "5");
	for(var i=0; i<10; i++) sc_list[i] = sc_str.substring(i, (i + 1));
	for(var i=0; i<9; i++) sc_sum += sc_list[i] * sc_array[i];
	sc_check = (sc_sum + parseInt((sc_list[8] * 5) / 10)) % 10;
	return (((sc_check != 0) ? 10 - sc_check : 0) != sc_list[9]) ? false : true;
}

function SYMAN_FimeExt(fe_file) {
	var fe_ext, fe_length;
	fe_ext = fe_file.split(".");
	fe_length = fe_ext.length;
	return (fe_length > 1) ? fe_ext[(fe_length - 1)] : "";
}

function SYMAN_FileChcek(fc_file, fc_permit) {
	var fc_ext;
	if (fc_file.value) {
		if (fc_permit && fc_permit != undefined) {
			fc_ext = SYMAN_FimeExt(fc_file.value).toUpperCase();
			fc_permit = fc_permit.replace(/\s/g, "").toUpperCase().split(",");
			for(var i=0; i<fc_permit.length; i++) if (fc_permit[i] == fc_ext) return true;
			SYMAN_MsgBox("\"" + fc_ext + "\" 파일은 업로드 허용된 형식의 파일이 아닙니다.\n\n※ 사용파일 : " + fc_permit.join(", "));
			fc_file.focus();
			return false;
		} else {
			return true;
		}
	} else {
		SYMAN_MsgBox("업로드 파일을 선택하세요.");
		fc_file.focus();
		return false;
	}
}

function SYMAN_ImageCheck(ic_file, ic_width, ic_height) {
	var ic_image, ic_pattern;
	if (!SYMAN_FileChcek(ic_file, ImageExt.join(","))) {
		return false;
	} else {
		ic_image = new Image();
		ic_image.src = ic_file.value;
		ic_pattern = /^[\d\s]{1,}$/;
		if(ic_pattern.test(ic_width)) {
			ic_width = parseInt(ic_width, 10);
			if (ic_image.width > ic_width) {
				SYMAN_MsgBox("이미지 가로 사이즈가 " + ic_width + "Pixel을 넘을 수 없습니다.\n\n※ 사용이미지해상도 : " + ic_image.width + " X " + ic_image.height + " [Pixel]");
				ic_file.focus();
				return false;
			}
		}
		if(ic_pattern.test(ic_height)) {
			ic_height = parseInt(ic_height, 10);
			if (ic_image.height > ic_height) {
				SYMAN_MsgBox("이미지 세로 사이즈가 " + ic_height + "Pixel을 넘을 수 없습니다.\n\n※ 사용이미지해상도 : " + ic_image.width + " X " + ic_image.height + " [Pixel]");
				ic_file.focus();
				return false;
			}
		}
		return true;
	}
}

function SYMAN_ImageAdjust(ia_target, ia_width, ia_height, ia_mode) {
	var ia_image, ia_image_width, ia_image_height, ia_rate_width, ia_rate_height, ia_print_width, ia_print_height;
	if (ia_target.tagName == "IMG") {
		if (!isNumeric(ia_width)) ia_width = ia_target.width;
		if (!isNumeric(ia_height)) ia_height = ia_target.height;
		ia_image = new Image();
		ia_image.src = ia_target.src;
		ia_image_width = ia_image.width;
		ia_image_height = ia_image.height;
		ia_width = parseInt(ia_width, 10);
		ia_height = parseInt(ia_height, 10);
		if (ia_mode != "stuffing" && ia_image_width < ia_width && ia_image_height < ia_height) {
			ia_print_width = ia_image_width;
			ia_print_height = ia_image_height;
		} else {
			ia_rate_width = ia_width / ia_image_width;
			ia_rate_height = ia_height / ia_image_height;
			if(ia_rate_width < ia_rate_height) {
				ia_print_width = ia_width;
				ia_print_height = Math.round(ia_image_height * ia_rate_width);
			} else {
				ia_print_width = Math.round(ia_image_width * ia_rate_height);
				ia_print_height = ia_height;
			}
		}
		if (ia_print_width > 0 && ia_print_height > 0) {
			ia_target.width = ia_print_width;
			ia_target.height = ia_print_height;
		}
	}
}

function SYMAN_ImageView(iv_target) {
	var iv_image, iv_src, iv_ext, iv_win, iv_left, iv_top, iv_width, iv_height, iv_check;
	if (typeof(iv_target) == "object") {
		if (iv_target.tagName != "IMG") return;
		iv_src = iv_target.src;
	} else if (typeof(iv_target) == "string") {
		iv_ext = SYMAN_FimeExt(iv_target).toLowerCase();
		iv_check = false;
		for(var i=0; i<ImageExt.length; i++) if (ImageExt[i] == iv_ext) iv_check = true;
		if (!iv_check) return;
		iv_src = iv_target;
	} else {
		return;
	}
	iv_image = new Image();
	iv_image.src = iv_src;
	iv_width = iv_image.width + 20;
	iv_height = iv_image.height + 20;
	if(iv_width > 1000) iv_width = 1000;
	if(iv_height > 800) iv_height = 800;
	iv_left = screen.availWidth / 2 - iv_width / 2;
	iv_top = screen.availHeight / 2 - iv_height / 2;
	iv_win = window.open("about:blank", "", "left=" + iv_left + ", top=" + iv_top + ", width=" + iv_width + ", height=" + iv_height + ", scrollbars=1, resizable=1, menubar=no, toolbar=no, location=no, directories=no, status=no");
	if(iv_win) {
		iv_win.document.open();
		iv_win.document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title> </title>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"nationality\" content=\"korean\" />\n<meta name=\"content-language\" content=\"kr\" />\n<meta name=\"author\" content=\"CentumSoft\" />\n<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n<meta http-equiv=\"imagetoolbar\" content=\"no\" />\n<style type=\"text/css\">\nbody { margin-left:0px; margin-top:0px; margin-right:0px; margin-bottom:0px; }\n</style>\n</head>\n<body onclick='self.close()' oncontextmenu=\"return false\" ondragstart=\"return false\" onselectstart=\"return false\">\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n<tr>\n<td><img src=\"" + iv_src + "\" border=\"0\" alt=\"Close\" /></td>\n</tr>\n</table>\n</body>\n</html>");
		iv_win.document.close();
		iv_win.document.title = document.title;
	}
}

function SYMAN_ImageError(ie_target, ie_print) {
	if (!ie_print) ie_print = ImageError;
	ie_target.src = ie_print;
}

function SYMAN_DateCheck(dc_year, dc_month, dc_day) {
	var dc_daymax = new Array(null, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
	if (!dc_year || !dc_month || !dc_day) return false;
	dc_year = parseInt(dc_year, 10);
	dc_month = parseInt(dc_month, 10);
	dc_day = parseInt(dc_day, 10);
	if (dc_year < 1 || dc_year > 9999 || dc_month < 1 || dc_month > 12 || dc_day < 1) return false;
	if (dc_month == 2 && (dc_year % 4) == 0) if ((dc_year % 100) != 0 || (dc_year % 400) == 0) dc_daymax[2] = 29;
	return (dc_day > dc_daymax[dc_month]) ? false : true;
}

function SYMAN_DateInput(di_value) {
	var di_date, di_year, di_array, di_len, di_mark;
	di_date = new Date();
	di_array = new Array();
	if (!di_value || di_value == undefined) return false;
	di_year = di_date.getFullYear() + "";
	di_mark = SYMAN_SubstrCount(di_value, "-");
	di_value = di_value.replace(/[-/\\.]/g, "-").replace(/[^\d-]/g, "");
	if (di_mark == 1) {
		di_array = ("-" + di_value).split("-");
	} else if (di_mark == 2) {
		di_array = di_value.split("-");
	} else {
		di_value = di_value.replace(/[-]/g, "").rightstr(8);
		di_len = di_value.length;
		if (di_len == 3) {
			di_array[0] = di_year;
			di_array[1] = "0" + di_value.substr(0, 1);
			di_array[2] = di_value.substr(1, 2);
		} else if (di_len == 4) {
			di_array[0] = di_year;
			di_array[1] = di_value.substr(0, 2);
			di_array[2] = di_value.substr(2, 2);
		} else if (di_len == 6) {
			di_array[0] = di_value.substr(0, 2);
			di_array[1] = di_value.substr(2, 2);
			di_array[2] = di_value.substr(4, 2);
		} else if (di_len == 8) {
			di_array[0] = di_value.substr(0, 4);
			di_array[1] = di_value.substr(4, 2);
			di_array[2] = di_value.substr(6, 2);
		} else {
			return false;
		}
	}
	if (di_array[0].length != 4) {
		if (di_array[2].length == 4) {
			di_array[3] = di_array[2];
			di_array[2] = di_array[1];
			di_array[1] = di_array[0];
			di_array[0] = di_array[3];
		} else if(!di_array[0]) {
			di_array[0] = di_year;
		} else {
			di_array[0] = di_array[0].rightstr(2);
			di_array[0] = (parseInt(di_array[0], 10) >= 70) ? "19" + di_array[0] : "20" + di_array[0];
		}
	}
	return (SYMAN_DateCheck(di_array[0], di_array[1], di_array[2])) ? di_array[0] + "-" + (("0" + di_array[1]).rightstr(2)) + "-" + (("0" + di_array[2]).rightstr(2)) : false;
}

function SYMAN_ShowLoop(sl_name, sl_action) {
	var sl_length;
	if (document.getElementById(sl_name)) {
		sl_length = document.getElementsByName(sl_name).length - 1;
		if (!isNumeric(ShowLoop[sl_name])) ShowLoop[sl_name] = 0;
		if (sl_action == "up") {
			if (ShowLoop[sl_name] >= sl_length) {
				ShowLoop[sl_name] = 0;
			} else {
				ShowLoop[sl_name]++;
			}
		} else if (sl_action == "down") {
			if (ShowLoop[sl_name] <= 0) {
				ShowLoop[sl_name] = sl_length;
			} else {
				ShowLoop[sl_name]--;
			}
		} else {
			return;
		}
		for(var i=0; i<=sl_length; i++) document.getElementsByName(sl_name)[i].style.display = (ShowLoop[sl_name] == i) ? "" : "none";
	}
}

function SYMAN_ShowLayer() {
	if(arguments.length > 0) {
		for(var i=1; i<arguments.length; i++) if(document.getElementById(arguments[i])) document.getElementById(arguments[i]).style.display = "none";
		if(document.getElementById(arguments[0])) document.getElementById(arguments[0]).style.display = "";
	}
}

function SYMAN_ShowMainMenu(t, n) {
	for(var i=1; i<=t; i++) if(document.getElementById("sub_manu_"+i)) document.getElementById("sub_manu_"+i).style.display = "none";
	if(n && document.getElementById("sub_manu_"+n)) document.getElementById("sub_manu_"+n).style.display = "block";
}

function SYMAN_CheckIndex(target) {
	if(target) {
		if(target.length == undefined) {
			if(target.checked) return 0;
		} else {
			for(var i=0; i<target.length; i++) if(target[i].checked) return i;
		}
	}
	return -1;
}

function SYMAN_CheckAll(target) {
	if(target) {
		if(target.length == undefined) {
			target.checked = (target.checked == true) ? false : true;
		} else {
			for(var i=0; i<target.length; i++) target[i].checked = (target[i].checked == true) ? false : true;
		}
	}
}

function SYMAN_GroupCheckBox(gcb_total, gcb_group, gcb_mode) {
	var gcb_check, gcb_count, gcb_value;
	if(gcb_mode == true || gcb_mode == "1") {
		gcb_check = (gcb_total.checked) ? true : false;
		for(gcb_count=0; gcb_count<gcb_group.length; gcb_count++) gcb_group[gcb_count].checked = !gcb_check;
	} else {
		for(gcb_count=0, gcb_value=0; gcb_count<gcb_group.length; gcb_count++) if(gcb_group[gcb_count].checked) gcb_value++;
		gcb_check = (gcb_value == gcb_group.length || (gcb_value == 0)) ? true : false;
		if(gcb_check) for(gcb_count=0; gcb_count<gcb_group.length; gcb_count++) gcb_group[gcb_count].checked = false;
	}
	gcb_total.checked = gcb_check;
}

function SYMAN_WindowZoom(wz_target, wz_percent) {
	var wz_zoom, wz_max, wz_min;
	wz_zoom = false;
	wz_max = 150;
	wz_min = 80;
	//if (BrowserCheck[0] == "IE") {
		if (wz_target) {
			if (!wz_target.style.zoom) wz_target.style.zoom = "100%";
			if (isNumeric(wz_percent)) {
				wz_percent = parseInt(wz_percent, 10)
				wz_zoom = parseInt(wz_target.style.zoom, 10) + wz_percent;
				if (wz_percent > 0 && wz_zoom > wz_max) {
					wz_zoom = wz_max;
				} else if (wz_percent < 0 && wz_zoom < wz_min) {
					wz_zoom = wz_min;
				}
			} else {
				wz_zoom = 100;
			}
			wz_target.style.zoom = wz_zoom + "%";
		}
	//} else {
		//SYMAN_MsgBox("ERROR_ZOOM");
	//}
	return wz_zoom;
}

function SYMAN_WindowNew(wn_url) {
	var wn_win = window.open(wn_url);
	if(wn_win) wn_win.location.href = wn_url;
}

function SYMAN_WindowOpen(wo_url, wo_name, wo_width, wo_height, wo_scrollbars, wo_resize, wo_option) {
	wo_option = (wo_option == undefined) ? "" : wo_option;
	var wo_left = (screen.availWidth / 2) - (wo_width / 2);
	var wo_top = (screen.availHeight / 2) - (wo_height / 2);
	var wo_win = window.open(wo_url, wo_name, "left="+wo_left+", top="+wo_top+", width="+wo_width+", height="+wo_height+", scrollbars="+wo_scrollbars+", resizable="+wo_resize+" "+wo_option);
	if(wo_win) wo_win.focus();
}

function SYMAN_WindowLog(wl_group, wl_target) {
	SYMAN_WindowOpen("./recruit.global.php?action_mode=LogView&action_group=" + wl_group + "&idx=" + wl_target, "", 280, 400, "1", "0");
}

function SYMAN_MouseLock(ml_action) {
	var ml_target = ["input", "select", "textarea", "object"];

	function ml_Lock(e) { return (ml_action && ml_target.indexOf(e.target.tagName.toLowerCase()) == -1) ? false : true; }

	if (ml_action) {
		if (typeof(document.onselectstart) == "undefined") {
			window.onmousedown = ml_Lock;
		} else {
			document.onselectstart = function() { return false };
			document.oncontextmenu = function() { return false };
			document.ondragstart = function() { return false };
		}
	} else {
		if (typeof(document.onselectstart) == "undefined") {
			window.onmousedown = function() { return true };
		} else {
			document.onselectstart = null;
			document.oncontextmenu = null;
			document.ondragstart = null;
		}
	}
}

function SYMAN_FrameAutoSize(fas_target){
	var fas_body = fas_target.contentWindow.document.body;
	fas_target.style.height = fas_body.scrollHeight + (fas_body.offsetHeight - fas_body.clientHeight);
}

function SYMAN_TableAdd() {
	var ta_rows = arguments[0].insertRow(arguments[0].rows.length);
	var ta_cell = new Array();
	for(var i=0; i<(arguments.length - 1); i++) {
		ta_cell[i] = ta_rows.insertCell(i);
		ta_cell[i].innerHTML = arguments[(i + 1)];
	}
}

function SYMAN_TableDelete(td_table, td_limit, td_target) {
	if (td_table) {
		var td_len = td_table.rows.length;
		if (td_target == undefined) td_target = td_len - 1;
		if (td_len > td_limit) {
			td_table.deleteRow(td_target);
			return true;
		}
	}
	return false;
}

function SYMAN_OptionLastAppend(ola_target, ola_value, ola_text, ola_title) {
	var ola_option, ola_length, ola_count;
	if (ola_target) {
		ola_count = 3;
		ola_length = arguments.length;
		ola_option = document.createElement("option");
		ola_option.value = ola_value;
		ola_option.text = ola_text;
		ola_option.title = (ola_title == undefined) ? ola_text : ola_title;
		while (ola_length > (ola_count + 2)) {
			ola_count++;
			if (arguments[ola_count] != "value" && arguments[ola_count] != "text" && arguments[ola_count] != "title") ola_option.setAttribute(arguments[ola_count], arguments[(ola_count + 1)]);
			ola_count++;
		}
		try {
			ola_target.add(ola_option, null);
		} catch(ex) {
			ola_target.add(ola_option);
		}
	}
}

function SYMAN_OptionSelectedEdit(ose_target, ose_value, ose_text, ose_title) {
	var ose_option, ose_length, ose_count, ose_selected;
	if (ose_target) {
		ose_count = 3;
		ose_length = arguments.length;
		ose_selected = ose_target.selectedIndex;
		if (ose_selected >= 0) {
			ose_option = ose_target.options[ose_selected];
			if(ose_value != undefined) ose_option.value = ose_value;
			if(ose_text != undefined) ose_option.text = ose_text;
			if(ose_title != undefined) ose_option.title = ose_title;
			while (ose_length > (ose_count + 2)) {
				ose_count++;
				if (arguments[ose_count] != "value" && arguments[ose_count] != "text" && arguments[ose_count] != "title") ose_option.setAttribute(arguments[ose_count], arguments[(ose_count + 1)]);
				ose_count++;
			}
		}
	}
}

function SYMAN_OptionSelectedDelete(osd_target) {
	if (osd_target) for(var i=(osd_target.length-1); i>=0; i--) if (osd_target.options[i].selected) osd_target.remove(i);
}

function SYMAN_OptionReset(or_target, or_index, or_support) {
	var or_count = or_index;
	if(!or_support) or_support = 0;
	while (document.getElementsByName(or_target)[or_count]) {
		document.getElementsByName(or_target)[or_count].length = or_support;
		or_count++;
	}
}

function SYMAN_OptionDataReading(odl_url, odl_target, odl_index, odl_support) {
	var odl_count, odl_selected;
	odl_count = odl_index;
	if(!odl_support) odl_support = 0;
	SYMAN_OptionReset(odl_target.name, odl_index, odl_support);
	if(odl_target[odl_index]) {
		odl_selected = odl_target.selectedIndex;
		if((odl_selected + 1) > odl_support) {
			SYMAN_ScriptSrc("category_data", odl_url + "?action_mode=CategoryOptionSelect&category_individual=" + odl_target.name + "&category_target=" + odl_index + "&category_parents=" + odl_target.options[odl_selected].value);
		}
	}
}

function SYMAN_OptionSort(os_target, os_mode) {
	var os_temp, os_length;
	var os_selected_target, os_selected_opponent;
	var os_option_temp, os_option_target, os_option_opponent;
	if(os_target) {
		os_selected_target = os_target.selectedIndex;
		if(os_selected_target == -1) {
			SYMAN_MsgBox("SORT_DESTINATION");
		} else if(os_mode == "up" || os_mode == "down") {
			os_length = os_target.length;
			if (os_length < 2) {
				SYMAN_MsgBox("SORT_TWO_MORE");
			} else {
				if(os_mode == "up") {
					if(os_selected_target <= 0) return false;
					os_selected_opponent = os_selected_target - 1;
				} else {
					if(os_selected_target >= (os_target.options.length - 1)) return false;
					os_selected_opponent = os_selected_target + 1;
				}
				os_temp = document.createElement("option");
				try {
					os_target.add(os_temp, null);
				} catch(ex) {
					os_target.add(os_temp);
				}
				os_option_temp = os_target.options[os_length];
				os_option_target = os_target.options[os_selected_target];
				os_option_opponent = os_target.options[os_selected_opponent];
				os_option_temp.text = os_option_target.text;
				os_attribute_target = os_option_target.attributes;
				for(var i=(os_attribute_target.length - 1); i>=0; i--) {
					if(os_attribute_target[i].specified) {
						os_option_temp.setAttribute(os_attribute_target[i].nodeName, os_attribute_target[i].nodeValue);
						os_option_target.removeAttribute(os_attribute_target[i].nodeName);
					}
				}
				os_option_target.text = os_option_opponent.text;
				os_attribute_opponent = os_option_opponent.attributes;
				for(var i=(os_attribute_opponent.length - 1); i>=0; i--) {
					if(os_attribute_opponent[i].specified) {
						os_option_target.setAttribute(os_attribute_opponent[i].nodeName, os_attribute_opponent[i].nodeValue);
						os_option_opponent.removeAttribute(os_attribute_opponent[i].nodeName);
					}
				}
				os_option_opponent.text = os_option_temp.text;
				os_attribute_temp = os_option_temp.attributes;
				for(var i=0; i<os_attribute_temp.length; i++) if(os_attribute_temp[i].specified) os_option_opponent.setAttribute(os_attribute_temp[i].nodeName, os_attribute_temp[i].nodeValue);
				os_target.selectedIndex = os_selected_opponent;
				os_target.remove(os_length);
				return true;
			}
		}
	}
	return false;
}

function SYMAN_OptionValue(ov_target, ov_save) {
	var ov_temp = "";
	if(ov_target) {
		for(var i=0; i<ov_target.options.length; i++) ov_temp += ov_target.options[i].value + "|";
		ov_save.value = ov_temp.substring(0, ov_temp.length-1);
	}
}

function SYMAN_DivPrint(dp_target, dp_print, dp_scrollbars, dp_resize) {
	var dp_win, dp_width, dp_height, dp_left, dp_top;
	dp_width = dp_target.offsetWidth;
	dp_height = dp_target.offsetHeight;
	if(dp_print == undefined || dp_print == "") dp_print = "auto";
	if(dp_resize == undefined || dp_resize == "") dp_resize = "no";
	if(dp_scrollbars == undefined || dp_scrollbars == "") dp_scrollbars = "no";
	if(dp_scrollbars != "no") dp_width += 20;
	if(BrowserCheck[0] == "NN") dp_width += 40;
	dp_left = screen.availWidth / 2 - dp_width / 2;
	dp_top = screen.availHeight / 2 - dp_height / 2;
	dp_win = window.open("about:blank", "", "left=" + dp_left + ", top=" + dp_top + ", width=" + dp_width + ", height=" + dp_height + ", scrollbars=" + dp_scrollbars + ", resizable=" + dp_resize + ", menubar=no, toolbar=no, location=no, directories=no, status=no");
	if(dp_win) {
		dp_win.document.open();
		dp_win.document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title> </title>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"nationality\" content=\"korean\" />\n<meta name=\"content-language\" content=\"kr\" />\n<meta name=\"author\" content=\"CentumSoft\" />\n<meta name=\"Keywords\" content=\"동해안권\" />\n<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n<meta http-equiv=\"imagetoolbar\" content=\"no\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/common.css\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/default.css\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/layout.css\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/main.css\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/tour.css\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/festival.css\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/food_stay.css\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/guide.css\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/qna.css\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/theme.css\" />\n<link rel=\"stylesheet\" media=\"screen, print\" href=\"/share/css/board.css\" />\n<script language=\"javascript\" type=\"text/javascript\">\nfunction SYMAN_LanguageContent() {}\nfunction SYMAN_ImageError() {}\nfunction SYMAN_ImageAdjust() {}\nfunction SYMAN_LanguageAlt() {}\nfunction SYMAN_LanguageMessage() {}\n</script>\n</head>\n<body oncontextmenu=\"return false\" ondragstart=\"return false\" onselectstart=\"return false\" onclick='self.close()'>\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n<tr>\n<td align=\"left\">\n" + dp_target.innerHTML + "\n</td>\n</tr>\n</table>\n</body>\n</html>");
		dp_win.document.close();
		dp_win.document.title = document.title;
		if (dp_print == "yes") {
			dp_win.print();
		} else if(dp_print == "auto") {
			dp_win.print();
			dp_win.close();
		}
	}
}

function SYMAN_MultiStringCutter(mcs_target, mcs_print, mcs_width, mcs_height, mcs_margin, mcs_insert) {
	var mcs_count, mcs_string, mcs_rows
	if (document.getElementsByName(mcs_target) != undefined && document.getElementsByName(mcs_print) != undefined && mcs_width != null && mcs_height != null) {
		if(mcs_margin == null) mcs_margin = 17;
		if(mcs_insert == null) mcs_insert = "...";
		try {
			for(mcs_count=0; mcs_count<document.getElementsByName(mcs_print).length; mcs_count++) {
				mcs_string = document.getElementsByName(mcs_target)[mcs_count].value.trim();
				document.getElementsByName(mcs_print)[mcs_count].innerHTML = mcs_string;
				document.getElementsByName(mcs_print)[mcs_count].style.width = mcs_width - mcs_margin;
				if (document.getElementsByName(mcs_print)[mcs_count].scrollHeight > mcs_height && mcs_string != "" && mcs_width != "" && mcs_height != "") {
					do {
						mcs_string = mcs_string.substring( 0, mcs_string.length - 1 ).trim();
						document.getElementsByName(mcs_print)[mcs_count].innerHTML = mcs_string;
					} while(document.getElementsByName(mcs_print)[mcs_count].scrollHeight > mcs_height && mcs_string.length > 1);
					document.getElementsByName(mcs_print)[mcs_count].innerHTML += mcs_insert;
				}
				document.getElementsByName(mcs_print)[mcs_count].style.width = mcs_width;
			}
		} catch(e) {
			SYMAN_MsgBox(e.description);
		}
	}
}

function SYMAN_ListSort(ls_frm, ls_action, ls_target) {
	if (ls_frm.order_target && ls_frm.order_sort) {
		if(ls_frm.action_mode) ls_frm.action_mode.value = ls_action;
		if(ls_frm.order_target.value == ls_target) {
			ls_frm.order_sort.value = (ls_frm.order_sort.value == "down") ? "up" : "down";
		} else {
			ls_frm.order_target.value = ls_target;
		}
		ls_frm.submit();
	}
}

function SYMAN_ListPaging(lp_frm, lp_action, lp_page) {
	if (lp_frm.page) {
		if(lp_frm.action_mode) lp_frm.action_mode.value = lp_action;
		lp_frm.page.value = lp_page;
		lp_frm.submit();
	}
}

function SYMAN_PostSearch(frm, post1, post2, addr) {
	//document.domain = "";
	//SYMAN_WindowOpen("", "popup_post", 367, 252, "1", "0");
}


