	/*********************************************************************************************
		Name : JScript Library
		Made : Áö¼º¸ñ
	**********************************************************************************************/



	/**********************************************************************************************
		Browser
	**********************************************************************************************/

	// [2006-11-29 : Áö¼º¸ñ] À¥ºê¶ó¿ìÀú Á¾·ù¸¦ °¡Á®¿Â´Ù.
	function getBrowser() {
		var _agt = navigator.userAgent.toLowerCase();
		var _browser = "";
		
		if (_agt.indexOf("msie") != -1) {
			if (_agt.indexOf("msie 7.0") != -1) {
				_browser = "msie 7.0";
			}
			else if (_agt.indexOf("msie 6.0") != -1) {
				_browser = "msie 6.0";
			}
			else {
				_browser = "msie";
			}
		}
		else if (_agt.indexOf("firefox") != -1) {
			_browser = "firefox";
		}
		else if (_agt.indexOf("opera") != -1) {
			_browser = "opera";
		}
		else {
			_browser = _agt;
		}

		return _browser;
	}
	
	// [2006-11-29 : Áö¼º¸ñ] À¥ºê¶ó¿ìÀú°¡ IE 7.0ÀÎÁö È®ÀÎÇÑ´Ù.
	function isIE7() {
		return (getBrowser() == "msie 7.0") ? true : false;
	}
	
	// [2006-11-29 : Áö¼º¸ñ] À¥ºê¶ó¿ìÀú°¡ IE 6.0ÀÎÁö È®ÀÎÇÑ´Ù.
	function isIE6() {
		return (getBrowser() == "msie 6.0") ? true : false;
	}

	// [2006-11-29 : Áö¼º¸ñ] À¥ºê¶ó¿ìÀú°¡ IEÀÎÁö È®ÀÎÇÑ´Ù.
	function isIE() {
		return (getBrowser().indexOf("msie") != -1) ? true : false;
	}

	// [2005-03-24 : Áö¼º¸ñ] XP ¼­ºñ½ºÆÑ 2 ¼³Ä¡µÆ´ÂÁö ¿©ºÎ È®ÀÎ
	function isXPSP2() {
		return (window.navigator.userAgent.indexOf("SV1") != -1) ? true : false;
	}
	
	// [2006-11-29 : Áö¼º¸ñ] À¥ºê¶ó¿ìÀú°¡ FireFoxÀÎÁö È®ÀÎÇÑ´Ù.
	function isFirefox() {
		return (getBrowser() == "firefox") ? true : false;
	}





	/**********************************************************************************************
		[Common] Undefine
	**********************************************************************************************/

	function undefine(obj, valTrue, valFalse) {
	
		_valTrue  = (valTrue != "undefined") ? true : valTrue;
		_valFalse = (valFalse != "undefined") ? false : valFalse;
	
		return (obj != undefined) ? _valTrue : _valFalse;
	
	}





	/**********************************************************************************************
		[Common - Prototype] String
	**********************************************************************************************/

	// ÀÛ ¼º : 2005-03-22 Áö¼º¸ñ
	// ¼³ ¸í : Trim Method Ãß°¡
	String.prototype.trim = function() 
	{
		return this.replace(/(^\s*)|(\s*$)/g, "");
	}


	// ÀÛ ¼º : 2005-03-22 Áö¼º¸ñ
	// ¼³ ¸í : ¹®ÀÚÀÇ Bytes ±æÀÌ¸¦ °è»êÇÑ´Ù.
	String.prototype.len = function() 
	{
		var str = this;
		var intLen = 0;
		for(j = 0; j < str.length; j++) {
			var chr = str.charAt(j);
			intLen += (chr.charCodeAt() > 128) ? 2 : 1
		}
		return intLen;
	}


	// ÀÛ ¼º : 2006-02-23 Áö¼º¸ñ
	// ¼³ ¸í : ¸¶Áö¸· ¹®ÀÚ ¹ÝÈ¯
	// Âü °í : °ÅÄ£¸¶·ç <comfuture@maniacamp.com> ´Ô ¼Ò½º Âü°í
	String.prototype.hasFinalConsonant = function(str) {
		str = this != window ? this : str; 
		var strTemp = str.substr(str.length-1);
		return ((strTemp.charCodeAt(0)-16)%28!=0);
	}




	/**********************************************************************************************
		[Common - Function] String
	**********************************************************************************************/

	// ÀÛ ¼º : 2006-02-23 Áö¼º¸ñ
	// Âü °í : °ÅÄ£¸¶·ç <comfuture@maniacamp.com> ´Ô ¼Ò½º Âü°í
	function josa(str,tail) {
		return (str.hasFinalConsonant()) ? tail.substring(0,1) : tail.substring(1,2);
	}


	// [2005-03-28 : Áö¼º¸ñ] Left
	function left(strObj, intLeft) {
		return strObj.substring(0, intLeft);
	}


	// [2006-02-15 : Áö¼º¸ñ] Byte ±âÁØÀ¸·Î ¹®ÀÚ¸¦ ÀÚ¸¥´Ù.
	function leftByte(strObj, lenByte) {
		var str = strObj;
		var intLen = 0;
		var intSize = 0;
		
		for(j = 0; j < str.length; j++) {
			var chr = str.charAt(j);
			intLen += (chr.charCodeAt() > 128) ? 2 : 1;
			
			if (intLen <= lenByte) {
				intSize++;
			}
		}

		return left(str, intSize);
	}


	// [2005-03-28 : Áö¼º¸ñ] Right
	function right(strObj, intRight) {
		return strObj.substring(strObj.length - intRight, strObj.length);
	}


	// [2005-03-23 : Áö¼º¸ñ] ¼ýÀÚÀÎÁö È®ÀÎ
	function isNumeric(obj) {
		var pattern = /^[0-9]+$/;
		return (pattern.test(obj.value)) ? true : false;
	}


	// [2006-02-15 : Áö¼º¸ñ] Byte ±âÁØÀ¸·Î ¹®ÀÚ¿­ ±æÀÌ¸¦ Ã¼Å©ÇÑ´Ù.
	function chkMaxString(obj, byteMaxNum) {
		var content = obj.value;
		if (content.len() > byteMaxNum) {
			alert('ÃÖ´ë ÇÑ±Û'+ (byteMaxNum / 2) +'ÀÚ (¿µ¹®'+ byteMaxNum +'ÀÚ)±îÁö ÀÔ·ÂÇØÁÖ¼¼¿ä. \nÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿À¸·Î »èÁ¦ µË´Ï´Ù.');
			obj.value = leftByte(content, byteMaxNum);
			obj.focus();
			return false;
		}
		else {
			return true;
		}
	}





	/**********************************************************************************************
		[Common Function] Message Box
	**********************************************************************************************/

	// ÀÛ ¼º : 2006-02-23 Áö¼º¸ñ
	// Âü °í : °ÅÄ£¸¶·ç <comfuture@maniacamp.com> ´Ô ¼Ò½º Âü°í
	function doMessage(name, type) {
		var pattern = /{([a-zA-Z0-9_]+)\+?([°¡-Èþ]{2})?}/;
		pattern.exec(type);
		var tail = (RegExp.$2) ? josa(eval(RegExp.$1),RegExp.$2) : "";
		alert(type.replace(pattern,eval(RegExp.$1) + tail));
	}	





	/**********************************************************************************************
		[Common Function] Radio Button
	**********************************************************************************************/

	// ÀÛ¼º : 2005-03-22 Áö¼º¸ñ - Radio ButtonÀÇ °ªÀ» ¹ÝÈ¯ÇÑ´Ù.
	// ¼öÁ¤ : 2006-02-15 Áö¼º¸ñ - object¸¦ Á¦´ë·Î ¸ø °¡Á®¿À´Â °æ¿ì°¡ ÀÖ¾î¼­ ¼öÁ¤
	//        2006-02-16 Áö¼º¸ñ - object ´ë½Å objectÀÇ NameÀ» ³Ñ±â´Â °æ¿ì¿¡µµ ½ÇÇàµÇ°Ô ¼öÁ¤
	//        2006-02-21 Áö¼º¸ñ - id°¡ ¿©·¯°³ Áßº¹µÇ´Â °´Ã¼ÀÇ °æ¿ì ¿¹¿Ü Ã³¸®
	function rbValue(obj) {
		
		var objName;
		
		if (typeof(obj) == "object") {
			if (obj.length > 1) {
				objName = obj[0].name;
			}
			else {
				objName = obj.name;
			}
		}
		else {
			objName = obj;
		}
		
		arrObj = document.getElementsByName(objName);

		// var bElement = true;
		var ci = -1;

		for (i = 0; i < arrObj.length; i++) {
			if (arrObj[i].tagName == "INPUT" && arrObj[i].getAttribute("TYPE") == "radio") {
				// bElement = bElement && true;
				ci = (arrObj[i].checked) ? i : ci;
			}
			//else {
			//	bElement = bElement && false;
			//}
		}

		return (ci > -1) ? arrObj[ci].value : null;
		//return (bElement) ? obj[ci].value : false;
	}


	// [2005-03-29 : Áö¼º¸ñ] °ªÀ» Ã¼Å©ÇÑ´Ù.
	// Âü°í : getElementById·Î ÇÏ´Â °æ¿ì Radio Button´Â ¹®Á¦°¡ »ý±â¹Ç·Î getElementByName ±ÇÀå
	//        JScript¿¡¼­ ÇØ´çÇÏ´Â value¸¦ °¡Áø Radio ButtonÀ» Ã¼Å©ÇÏ±â À§ÇØ »ç¿ë
	function rbSelectValue(obj, value) {
		obj = document.getElementsByName(obj.name);
		
		for (i = 0; i < obj.length; i++) {
			if (obj[i].tagName == "INPUT" && obj[i].getAttribute("TYPE") == "radio") {
				if (obj[i].value == value) {
					obj[i].checked = true;
				}
			}
		}
	}


	// [2005-03-29 : Áö¼º¸ñ] Radio ButtonÀ» ¸ðµÎ Unckecked ÇÑ´Ù
	function rbUnckecked(obj) {
		for (i = 0; i < obj.length; i++) {
			if (obj[i].tagName == "INPUT" && obj[i].getAttribute("TYPE") == "radio") {
				obj[i].checked = false;
			}
		}
	}


	// [2005-03-29 : Áö¼º¸ñ] Radio ButtonÀ» ¸ðµÎ Disabled ÇÑ´Ù
	function rbDisabled(obj) {
		obj = document.getElementsByName(obj.name);
	
		for (i = 0; i < obj.length; i++) {
			if (obj[i].tagName == "INPUT" && obj[i].getAttribute("TYPE") == "radio") {
				obj[i].disabled = true;
			}
		}
	}





	/**********************************************************************************************
		[Common Function] Select List
	**********************************************************************************************/

	// [2006-02-06 : Áö¼º¸ñ] Select List¿¡ OptionÀ» Ãß°¡ÇÑ´Ù.
	function CreateOption(oSelect, text, value) {
		var oOption = document.createElement("OPTION");
		oOption.text  = text;
		oOption.value = value;
		oSelect.add(oOption);
	}





	/**********************************************************************************************
		[Common Function] Datetime
	**********************************************************************************************/
	
	// [2005-03-23 : Áö¼º¸ñ] ³¯Â¥ Ã¼Å© (Ref: Taeyo.pe.kr - °¡À§¼Õ´Ô) (¿¹: 20050301)
	function isDate(obj)
	{
		var bReturn = true;
		
		function gn_ArrayOfDay(l_sLeapYear)
		{
			this[0]= 0;  // <- ¾Æ¹«·± ÀÇ¹Ì°¡ ¾ø´Â °ÍÀÓ. ¹«½ÃÇØµµ ÁÁÀ½.
			this[1]= 31;
			this[2]= 28;
			if (l_sLeapYear) // À±´ÞÀÌ ¾Æ´Ï¸é...
				this[2]= 29;
			this[3]= 31;
			this[4]= 30;
			this[5]= 31;
			this[6]= 30;
			this[7]= 31;
			this[8]= 31;
			this[9]= 30;
			this[10]= 31;
			this[11]= 30;
			this[12]= 31;
		}

		// ³¯Â¥ À¯È¿¼º °Ë»ç
		// var pattern = /^([0-9]{8})-?([0-9]{1,2})-?([0-9]{1,2})$/;
		var pattern = /^([0-9]{8})$/;
		bReturn = (isNumeric(obj)) ? true : false;

		if (bReturn) {
			// ³¯Â¥ ÀÚ¸§
			var arrDate  = SpliteDate(obj);
			var l_iYear  = arrDate[0];
			var l_iMonth = arrDate[1]; 
			var l_iDay   = arrDate[2];

			// À±´Þ ±¸ºÐ
			var l_sLeapYear = (((l_iYear%4 == 0) && (l_iYear%100 != 0)) || (l_iYear%400 == 0));
			var monthDays   = new gn_ArrayOfDay(l_sLeapYear);

			// Á¶°Ç¿¡ µû¸¥ ³¯Â¥ Ã¼Å©
			var arrDateChk = new Array();
			arrDateChk[0] = (l_iYear < 1750) ? false : true;
			arrDateChk[1] = (l_iYear > 2045) ? false : true;
			arrDateChk[2] = (l_iMonth > 12)  ? false : true;
			arrDateChk[3] = ((parseInt(l_iDay) < 1) || (l_iDay > monthDays[l_iMonth])) ? false : true;
		}

		return arrDateChk[0] && arrDateChk[1] && arrDateChk[2] && arrDateChk[3];
	}


	// [2005-03-23 : Áö¼º¸ñ] ³¯Â¥ ¹®ÀÚ ÇüÅÂ
	function SpliteDate(obj) {
		var arrDate = new Array(3);

		arrDate[0] = parseInt(obj.value.substring(0,4), 10);
		arrDate[1] = parseInt(obj.value.substring(4,6), 10); 
		arrDate[2] = parseInt(obj.value.substring(6,8), 10);     

		return arrDate;
	}


	// [2006-05-03 : Áö¼º¸ñ] Date Init
	function DateInit(sDate) {

		var strDate = sDate;

		try {
			// strDate°¡ object·Î ³Ñ¾î¿ÔÀ¸¸é value°ªÀ» ¹Þ°Ô Ã³¸®ÇÑ´Ù.
			if (typeof(strDate) == "object") {
				strDate = strDate.value;
			}

			//  strDate°¡ ºó°ªÀÌ¸é ¿À´Ã ³¯Â¥·Î Ã³¸®ÇÑ´Ù.
			if (strDate == "") {
				strDate = new Date();
			}
			else if (strDate.length == 8) {
				strDate = FormatDate("yyyy/MM/dd", strDate);
			}
			else if (strDate.length == 10) {
				strDate = strDate.replace("-", "/");
			}
		}
		catch (e) {
			strDate = sDate;
		}

		if (typeof(strDate) == "object") {
			var objDate = strDate;
		}
		else {
			var objDate = new Date(strDate);
		}
	
		return objDate;
	}


	// [2005-03-28 : Áö¼º¸ñ] ³¯Â¥ ÇüÅÂ
	function FormatDate(strFormat, strDate) {

		// strDate°¡ object·Î ³Ñ¾î¿ÔÀ¸¸é value°ªÀ» ¹Þ°Ô Ã³¸®ÇÑ´Ù.
		if (typeof(strDate) == "object") {
			strDate = strDate.value;
		}

		//  strDate°¡ ºó°ªÀÌ¸é ¿À´Ã ³¯Â¥·Î Ã³¸®ÇÑ´Ù.
		if (strDate == "") {
			strDate = new Date();
		}

		// yyyy : ¿¬µµ
		// MM : ¿ù
		// dd : ÀÏ
		// tt : AM/PM
		// hh : ½Ã°£
		// mm : ºÐ
		// ss : ÃÊ




		var m_Date;
		var m_Year;
		var m_Month;
		var m_Day;
		var m_Hour;
		var m_Min;
		var m_Sec;
		var m_tt;

		if (strDate.length == 8) {
			// 20050101
			m_Year   = strDate.substring(0,4);
			m_Month  = strDate.substring(4,6);
			m_Day    = strDate.substring(6,8);
			m_Hour   = "00";
			m_Min    = "00";
		}
		else if (strDate.length == 10) {
			// 2005-01-01
			m_Year   = strDate.substring(0,4);
			m_Month  = strDate.substring(5,7);
			m_Day    = strDate.substring(8,10);
			m_Hour   = "00";
			m_Min    = "00";
		}
		else {
			var objDate = new Date(strDate);
			m_Year  = objDate.getYear();
			m_Month = objDate.getMonth() + 1;
			m_Day   = objDate.getDate();
			m_Hour  = objDate.getHours();
			m_Min   = objDate.getMinutes();
			m_Sec   = objDate.getSeconds();
		}

		m_Date = strFormat;

		// 1) ¿¬µµ (yyyy or yy)
		if (strFormat.indexOf("yy") > -1) {
			if (!(strFormat.indexOf("yyyy") > -1)) {
				m_Year = right(m_Year, 2);
				strFormat = strFormat.replace("yy", "yyyy");
			}
		}

		// 2) ¿ù (MM or M)
		if (strFormat.indexOf("MM") > -1) {
			m_Month = right("0" + m_Month, 2);
		}
		else {
			strFormat = strFormat.replace("M", "MM");
		}

		// 3) ÀÏ (dd or d)
		if (strFormat.indexOf("dd") > -1) {
			m_Day = right("0" + m_Day, 2);
		}
		else {
			strFormat = strFormat.replace("d", "dd");
		}

		// 4) tt
		if (strFormat.indexOf("tt") > -1) {
			if (m_Hour > 12) {
				m_Hour = m_Hour - 12;
				m_tt = "PM";
			}
			else {
				m_tt = "AM";
			}
		}

		// 5) ½Ã (hh or h)
		if (strFormat.indexOf("hh") > -1) {
			m_Hour = right("0" + m_Hour, 2);
		}
		else {
			strFormat = strFormat.replace("h", "hh");
		}

		// 6) ºÐ (dd or d)
		if (strFormat.indexOf("mm") > -1) {
			m_Min = right("0" + m_Min, 2);
		}
		else {
			strFormat = strFormat.replace("m", "mm");
		}

		// 7) ÃÊ (ss or s)
		if (strFormat.indexOf("ss") > -1) {
			m_Sec = right("0" + m_Sec, 2);
		}
		else {
			strFormat = strFormat.replace("s", "ss");
		}

		m_Date = m_Date.replace("yyyy", m_Year);
		m_Date = m_Date.replace("MM", m_Month);
		m_Date = m_Date.replace("dd", m_Day);
		m_Date = m_Date.replace("tt", m_tt);
		m_Date = m_Date.replace("hh", m_Hour);
		m_Date = m_Date.replace("mm", m_Min);
		m_Date = m_Date.replace("ss", m_Sec);

		return m_Date;
	
	}

	// [2006-05-03 : Áö¼º¸ñ] ÁÖ¾îÁø ³¯Â¥ÀÇ ÁöÁ¤µÈ ºÎºÐÀ» ¹ÝÈ¯ÇÕ´Ï´Ù.
	function DatePart(interval, sDate) {

		var objDate = DateInit(sDate);

		// yyyy ³â
		// q	ºÐ±â
		// m	¿ù
		// d	ÀÏ
		// w	¿äÀÏ
		// ww	ÁÖ (ÀÏ³â±âÁØ)
		// h	½Ã
		// n	ºÐ
		// s	ÃÊ

		var m_Rtn = "";

		if (interval == "ww") {
			// ÁÖ °è»êÀº ÀÏ¿äÀÏ ~ Åä¿äÀÏ ±âÁØÀÌ´Ù.
			var betweenDay = new Number(DateDiff("d", "2006-01-01", objDate));
			var beginDay   = new Number(DatePart("w", "2006-01-01"));
			var m_Rtn      = Math.floor((betweenDay + beginDay) / 7);
		}
		else {
			switch (interval) {
				case "yyyy" : m_Rtn = objDate.getYear();      break;
				case "m"    : m_Rtn = objDate.getMonth() + 1; break;
				case "d"    : m_Rtn = objDate.getDate();      break;
				case "h"    : m_Rtn = objDate.getHours();     break;
				case "n"    : m_Rtn = objDate.getMinutes();   break;
				case "s"    : m_Rtn = objDate.getSeconds();   break;
				case "w"    : 
					m_Rtn = objDate.getDay();
					if (m_Rtn == "0") { m_Rtn = "7"; }
					break;
			}
		}
		
		return m_Rtn;
	}

	// [2005-03-23 : Áö¼º¸ñ] DateDiff (date2 - date1)
	function DateDiff(interval, date1, date2) {

		var s, t;
		var ds, dt;
		var MinMilli = 1000 * 60; 
		var HrMilli  = MinMilli * 60;
		var DyMilli  = HrMilli * 24;

		// date1 ¶Ç´Â date2°¡ ºó°ªÀÌ¸é ¿À´Ã³¯Â¥·Î Ã³¸®ÇÑ´Ù.
		if (date1 == "") {
			date1 = new Date();
		}
		else {
			date1 = date1.toString();
			date1 = date1.replace("-", "/");
		}

		if (date2 == "") {
			date2 = new Date();
		}
		else {
			date2 = date2.toString();
			date2 = date2.replace("-", "/");
		}

		s = Date.parse(date1);
		t = Date.parse(date2);

		if (interval == "d") {
			ds = Math.round(Math.abs(s / DyMilli));
			dt = Math.round(Math.abs(t / DyMilli));
		}

		return dt - ds;
	}

	// [2006-01-23 : Áö¼º¸ñ] DateAdd
	// »ç¿ë : DateAdd("d", 1, "2005-01-01")
	/*
		 - yyyy	³â 
		 - q	ºÐ±â 
		 - m	¿ù 
		 - d	ÀÏ 
		 - h	½Ã 
		 - n	ºÐ 
		 - s	ÃÊ 
	*/
	function DateAdd(interval, number, date) {

		var ds, dt;
		var MinMilli = 1000 * 60; 
		var HrMilli  = MinMilli * 60;
		var DyMilli  = HrMilli * 24;
		var 

		// date°¡ ºó°ªÀÌ¸é ¿À´Ã ³¯Â¥·Î Ã³¸®
		ds = (date == "") ? new Date() : date;
		ds = ds.toString().replace("-", "/");
		dt = Date.parse(ds);

		switch (interval) {
			case "d" : dt += (number * DyMilli);	break;
			case "h" : dt += (number * HrMilli);	break;
			case "n" : dt += (number * MinMilli);	break;
		}
		
		var da =  new Date(dt);
		return da;
	}



	// ÀÛ¼º : 2005-11-11 Áö¼º¸ñ - ¿¬µµ¿Í ¿ùÀ» ¹Þ¾Æ¼­ ±× ´ÞÀÇ ¸¶Áö¸· ³¯Â¥¸¦ ¹ÝÈ¯ÇÑ´Ù.
	// »ç¿ë : lastDay("200511") 
	function getLastDay(strYyMm)
	{
		var lastDay = 0;
		var pattern = new RegExp("^(\\d{4})(0[1-9]{1}||1[0-2]{1})$");
		if (pattern.test(strYyMm) && strYyMm.length == 6) {
			var l_iYear  = (RegExp.$1);
			var l_iMonth = (RegExp.$2) * 1;

			if (l_iMonth == 1 || l_iMonth == 3 || l_iMonth == 5 || l_iMonth == 7 || l_iMonth == 8 || l_iMonth == 10 || l_iMonth == 12) {
				lastDay = 31;
			}
			else {
				if (l_iMonth == 2) {
					lastDay = (((l_iYear%4 == 0) && (l_iYear%100 != 0)) || (l_iYear%400 == 0)) ? 29 : 28;
				}
				else {
					lastDay = 30;
				}
			}
		}		
		return lastDay;
	}





	/**********************************************************************************************
		[Common Function] Visible
	**********************************************************************************************/

	// ÀÛ¼º : 2006-02-15 Áö¼º¸ñ - °´Ã¼¸¦ Toggle ÇÑ´Ù.
	// ÀÎÀÚ : bPosition - true º¯È­ / false ºñº¯È­
	function Toggle(obj, bPosition) {
		try {
			var visibility = obj.style.visibility;
			var position   = obj.style.position;
			
			obj.style.visibility = (visibility == "hidden") ? "visible" : "hidden";
			
			if (bPosition) {
				obj.style.position = (position == "absolute") ? "static" : "absolute";
			}
		}
		catch (e) { }
	}


	// ÀÛ¼º : 2006-02-15 Áö¼º¸ñ - °´Ã¼¸¦ Hidden ÇÑ´Ù.
	function Hidden(obj, bPosition) {
		try {
			obj.style.visibility = "hidden";
			
			if (bPosition) {
				obj.style.position = "absolute";
			}
		}
		catch (e) { }
	}


	// ÀÛ¼º : 2006-02-15 Áö¼º¸ñ - °´Ã¼¸¦ Visible ÇÑ´Ù.
	function Visible(obj, bPosition) {
		try {
			obj.style.visibility = "visible";
			
			if (bPosition) {
				obj.style.position = "static";
			}
		}
		catch (e) { }
	}





	/**********************************************************************************************
		[Common Function] Cookie
	**********************************************************************************************/
		
	// [2003-12-08 : Áö¼º¸ñ] Cookies
	function 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;
	}


	// [2003-12-08 : Áö¼º¸ñ] Cookies
	function getSubCookie(name, name2)
	{
		var CookieValue = getCookie(name);

		if (CookieValue == '' || CookieValue == null) { return false; }
		
		var x = 0;
		var y = 0;
		while ( x <= CookieValue.length && x != -1)
		{
			if (x != 0) { x = CookieValue.indexOf('&', x) + 1; }
			y = CookieValue.indexOf('=', y + 1);
			
			if (CookieValue.substring(x, y) == name2) {
				z = CookieValue.indexOf('&', x) + 0;
				if (z <= 0) { z = CookieValue.length; }
				return (CookieValue.substring(y + 1, z));
				break;
			}
			else {
				x = y;
			}
		}
	}





	/**********************************************************************************************
		[Common Function] Math
	**********************************************************************************************/

	// [2006-11-04 : Áö¼º¸ñ] Random Number
	function getUnique() { 
		var theUniqueID1 = (new Date()).getTime() % 1000000000; 
		var theUniqueID2 = Math.round(10000000 * Math.random()); 
		theUniqueID2 = (theUniqueID2 + "0000000").slice(0, 7); 
		return theUniqueID1 + theUniqueID2 
	} 





	/**********************************************************************************************
		[Common Function] URL
	**********************************************************************************************/

	// ÀÛ¼º : 2005-10-17 Áö¼º¸ñ 
	// ¼³¸í : ¿¬µµ¿Í ¿ùÀ» ¹Þ¾Æ¼­ ±× ´ÞÀÇ ¸¶Áö¸· ³¯Â¥¸¦ ¹ÝÈ¯ÇÑ´Ù.
	// ¼öÁ¤ : 2005-11-29 Áö¼º¸ñ - Devpia : ±è±â¸¸´ÔÀÌ ¿Ã·ÁÁÖ½Å °Í Âü°íÇØ¼­ ¼öÁ¤

	/*
	function Request(key) {
		//var url = self.document.URL;
		var url = self.document.URL;
		var value = "";
		var intRq;		// ? ÀÇ À§Ä¡
		var intBegin;
		var intEnd;

		intRq = url.indexOf("?");

		if (key != "" && intRq > -1) {
			intBegin = url.indexOf(key, url.indexOf("?")) ;
			if (intBegin > -1) {			
				intBegin = intBegin + key.length + 1;
				intEnd   = url.indexOf("&", intBegin);
				if (intEnd == -1) { intEnd = url.length; }
				value = url.substring(intBegin, intEnd);
			}
		}
		
		return value;
	}
	*/

	
	// ÀÛ¼º : 2006-02-07 Áö¼º¸ñ 
	// ¼³¸í : QueryString°ªÀ» ÀÐ´Â´Ù.
	function Request(key) {
		try {
			key = key + "=";
				
			var url = unescape(self.document.URL);
			var value = "";
			var arrParam = new Array();

			arrParam = (url.slice(url.indexOf("?") + 1, url.length)).split("&");
			
			for (var i = 0; i < arrParam.length; i++) {
				if (arrParam[i].indexOf(key) != -1) {
					value = arrParam[i].split("=")[1];
					if (value == null || value == undefined) {
						value = "";
					}
				}
			}
		}
		catch (e) {
			value = null;
		}

		return value
	}


	// ÀÛ¼º : 2006-02-07 Áö¼º¸ñ 
	// ¼³¸í : URLÀÇ host¸¦ ¹ÝÈ¯ÇÑ´Ù.
	// »ç¿ë : getUrlHost()

	function getUrlHost() {
		var value = document.URL;	
		var pattern = new RegExp("http://?(\\w+)\.?(\.*)", "i");
		pattern.exec(value);
		return RegExp.$1;
	}





	/**********************************************************************************************
		[Town Function] ¾÷¹« °ü·Ã...
	**********************************************************************************************/

	// ÀÛ¼º : 2006-02-07 Áö¼º¸ñ 
	function InsideSub(link) {
		return '/pims/main/main_inside_sub.asp?inside='+ escape(link);
	}
	
	
	// 2005-10-31 Áö¼º¸ñ
	function pimslink(boardtype, urlstr, board_no, item_seq, tid) {
		var host = (getUrlHost().indexOf("dev") == -1) ? "town" : "towndev";
		var strs = "http://"+ host +".cyworld.com/common/pims_hub.asp?urlstr="+ urlstr +"&boardtype="+ boardtype +"&board_no="+ board_no +"&item_seq="+ item_seq +"&tid="+ tid;
		window.open(strs,'person_info','height=538,width=932,scrollbars=no,resizable=yes');
	} 


	// ÀÛ¼º : 2006-02-07 Áö¼º¸ñ 
	// ¼³¸í : Hit Event È®ÀÎ¿ë (ÀüºÎ µ¿ÀÏÇÏ°í Target¸¸ ´Ù¸£´Ù.)
	function pimslink_open(boardtype, urlstr, board_no, item_seq, tid) {
		var strs = "http://"+ getUrlHost() +".cyworld.com/common/pims_hub.asp?urlstr="+ urlstr +"&boardtype="+ boardtype +"&board_no="+ board_no +"&item_seq="+ item_seq +"&tid="+ tid;
		opener.location.href = strs;
	} 





	/**********************************************************************************************
		[Town Function] À¥ÆùÆ® °ü·Ã...
	**********************************************************************************************/

	// ÀÛ¼º : 2006-11-11 Áö¼º¸ñ
	// ¼³¸í : ¹®ÀÚ¿­¿¡ ÆùÆ®¸¦ Àû¿ëÇÑ´Ù.
	// ¼öÁ¤ : 2006-11-29 - IE¿¡¼­¸¸ À¥ÆùÆ® Àû¿ëµÇ°Ô ¼öÁ¤
	function DefaultWebFont(strObj) {

		var strReplace = "";

		if (isIE() && (default_font.length > 0)) {
			strReplace = "<font face="+ default_font +" style=font-size:10pt>"+ strObj +"</font>"
		}
		else {
			strReplace = strObj
		}

		return strReplace;
	}

	// ÀÛ¼º : 2006-11-15 Áö¼º¸ñ
	// ¼³¸í : ±âº» À¥ ÆùÆ®¸¦ È­¸é¿¡ Ãâ·ÂÇÑ´Ù.
	function DefaultWebFontWrite(strObj) {
		document.write(DefaultWebFont(strObj));
	}





	/**********************************************************************************************
		[IE Function] Active-X Execute
	**********************************************************************************************/

	// ÀÛ¼º : 2006-02-07 Áö¼º¸ñ 
	// ¼³¸í : Object, Embed µî ActiveX·Î µÈ ÇüÅÂ¸¦ document.write·Î ÇüÅÂ·Î ½ÇÇà°¡´ÉÇÏ°Ô º¯È¯ÇÑ´Ù.
	function execActiveX(strActiveX, obj) {

		// ÇÃ·¡½¬¿¡¼­ ¾Ç¼º ½ºÅ©¸³Æ® ½ÇÇà¾ÈµÇ°Ô Param Ãß°¡ (AllowScriptAccess)
		if(strActiveX.toLowerCase().indexOf('</object>') > -1) {
			strActiveX = strActiveX.toLowerCase().replace('</object>', '<param name="AllowScriptAccess" value="never"></object>');
		}
		
		if (obj == undefined) {
			document.write(strActiveX);
		}
		else {
			obj.innerHTML = strActiveX;
		}
	}


	// ÀÛ¼º : 2006-02-07 Áö¼º¸ñ 
	// ¼³¸í : È®ÀåÀÚ°¡ ÇÃ·¡½¬ ÆÄÀÏÀÎ °æ¿ì ½ÇÇà½ÃÅ²´Ù.
	// ¼öÁ¤ : 2006-03-20 Áö¼º¸ñ - Parameter Ãß°¡
	function execFlash(filePath, obj, width, height) {
		
		if (width == undefined || width == null) {
			width  = 400;
			height = 300;
		}
		
		var strActiveX = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width='+ width +' height='+ height +' align=middle name=attach_img VIEWASTEXT id=OBJECT1>'
						+'	<param name="AllowScriptAccess" value="never">'
						+'	<param name="quality" value="high">'
						+'	<param name="bgcolor" value="#ffffff">'
						+'	<param name="movie" value="'+ filePath +'">'
						+'	<embed AllowScriptAccess="never" src="'+ filePath +'" width="'+ width +'" height="'+ height +'"></embed>'
						+'</object>';

		execActiveX(strActiveX, obj);
	}




	/**********************************************************************************************
		[ClipBoard]
	**********************************************************************************************/

	// ÀÛ¼º : 2006-02-07 Áö¼º¸ñ 
	// ¼³¸í : ÁÖ¾îÁø ¹®ÀÚ¸¦ Å¬¸³¸ðµå¿¡ º¹»çÇÏ°í ¸Þ¼¼ÁöÃ¢À» º¸¿©ÁØ´Ù.
	function copyClipBoard(str, name) {
		window.clipboardData.setData('text', str);
		doMessage(name, "{name+ÀÌ°¡} Å¬¸³º¸µå¿¡ º¹»çµÇ¾ú½À´Ï´Ù.");
	}





	/**********************************************************************************************
		[ÀÏÃÌ ½ÅÃ» °ü·Ã]
	**********************************************************************************************/

	function request_onedegrees(ar_id) {
		
		if (myuser_id.length == 8) {
			user_id = ar_id;
			window.open('http://www.cyworld.com/main2/ui/contact_pop.asp?tid='+ user_id, "popup_contacts", "width=300,height=305,scrollbars=no,toolbar=no, resizable=yes,menubar=no");
		}
		else {
			if (confirm("ÀÏÃÌÀ» ¸ÎÀ¸½Ã·Á¸é ·Î±×ÀÎ ÇÏ¼Å¾ß µË´Ï´Ù.\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")) {
				pims_login_popup();
			}
		}
	}





	/**********************************************************************************************
		[·Î±×ÀÎ °ü·Ã]
	**********************************************************************************************/

	function pims_login_popup() {
		var str = top.document.location.href;
		var _tid = (user_id = undefined) ? "" : user_id;
		
		window.open('/pims/main/pims_login_popup.asp?channel=minihp&dest='+ escape(str) +'&tid='+ _tid +'&direction=&rkey=', "popup_contacts", "width=300,height=335,scrollbars=no,toolbar=no, resizable=yes,menubar=no");
	}





	/**********************************************************************************************
		[iFrame]
	**********************************************************************************************/

	function iFrameResize(iFrame) {
		try {
			var innerDoc = (iFrame.contentDocument) ? iFrame.contentDocument : iFrame.contentWindow.document;
			var objToResize = (iFrame.style) ? iFrame.style : iFrame;
			iFrame.height = innerDoc.documentElement.body.scrollHeight + 3;
			return true;
		}
		catch (e) {
			return false;
		}
	}





	/**********************************************************************************************
		[POP-UP Window]
	**********************************************************************************************/

	// ÀÛ¼º : 2006-03-06
	// ¼³¸í : Å¸¿îÈ¨ÇÇ¸¦ ÆË¾÷À¸·Î ¶ç¿î´Ù.
	var g_target = "person_info";
	var g_params = "directories=no, location=no, menubar=no, resizable=yes, scrollbars=no, status=no, titlebar=no, toolbar=no, width=932, height=570, top=50, left=50";


	// ÀÛ¼º : 2006-03-08
	// ¼³¸í : Å¸¿îÈ¨ÇÇ¸¦ ¶ç¿î´Ù.
	// Âü°í : a href¿¡¼­ javascript·Î ½ÇÇà½ÃÅ² °æ¿ì returnÀ» ÇÏ¸é ¹®Á¦°¡ ¹ß»ýÇÏ¹Ç·Î event·Î ºÐ±â Ã³¸®
	// ¼öÁ¤ : 2006-07-14 Áö¼º¸ñ - url°ª¿¡ tid·Î ³Ñ¾î¿À´Â °æ¿ì Ã³¸®
	function openTownhp(url) {

		if (url.length == 8) {
			url = "http://town.cyworld.com/pims/main/pims_main.asp?tid="+ url +"&urlstr=main";	
		}
		
		var objPop = window.open(url, g_target, g_params);

		if (event != null) {
			return objPop;
		}
	}

	// ÀÛ¼º : 2006-03-08
	// ¼³¸í : object¸¦ ÅëÇØ ÆË¾÷À» °­Á¦·Î ¶ç¿î´Ù.
	// Âü°í : a href¿¡¼­ javascript·Î ½ÇÇà½ÃÅ² °æ¿ì returnÀ» ÇÏ¸é ¹®Á¦°¡ ¹ß»ýÇÏ¹Ç·Î event·Î ºÐ±â Ã³¸®
	function openTownhpDeny(url) {
		var objPop = openDeny(url, g_target, g_params);
		
		if (event != null) {
			return objPop;
		}
	}

	// ÀÛ¼º : 2006-03-06
	// ¼³¸í : object¸¦ ÅëÇØ ÆË¾÷À» °­Á¦·Î ¶ç¿î´Ù.
	// Âü°í : ÀÌº¥Æ®¿¡ »ç¿ëÇØ¾ß ÇÔ. a href¿¡¼­ »ç¿ëÇÏ¸é return ¶§¹®¿¡ ¹®Á¦ ¹ß»ý
	function openDeny(url, target, params) {
		document.write('<object id="DHTMLSafe" classid="clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A" width="1" height="1" align="middle"></object>');
		DHTMLSafe.ActivateApplets = "1";
		DHTMLSafe.ActivateActiveXControls = "1";
		return setTimeout("DHTMLSafe.DOM.Script.setTimeout(\"window.open('"+ url +"','"+ g_target +"','"+ g_params +"');\");");
	}

	// ÀÛ¼º : 2006-03-06	
	function pimslink_direct_townhp(directURL) {
		window.open(directURL,'person_info','height=538,width=932,scrollbars=no,resizable=yes');
	}
		
