

	/***********************************************************************
	 * flash ÆÄÀÏ load
		Url : swf °æ·Î
		Width : swf width
		Height : swf height
	 */
	function MakeFlash(Url,Width,Height)
	{                 
	  document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + Width + "\" height=\"" + Height + "\">"); 
	  document.writeln("<param name=\"movie\" value=\"" + Url + "\">"); 
	  document.writeln("<param name=\"quality\" value=\"high\" />");     
	  document.writeln("<param name=\"wmode\" value=\"transparent\">"); 
	  document.writeln("<embed src=\"" + Url + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + Width + "\"  height=\"" + Height + "\">"); 
	  document.writeln("</object>");     
	}


	function MakeObject(Url,Width,Height)
	{                 
	  document.writeln("<object ID='WebCtrl' classid=\"clsid:BFED6D92-F1BE-4539-B310-3317A274C12D\" codebase=\"\" width=\"" + Width + "\" height=\"" + Height + "\">"); 
	  document.writeln("</object>");     
	}

	/// **** number_format() ÇÔ¼ö
	function NumberFormat(fn)
	{
		   var str = fn.value;
		   var Re = /[^0-9]/g;
		   var ReN = /(-?[0-9]+)([0-9]{3})/;
		   str = str.replace(Re,'');              

		   while (ReN.test(str)) 
		   { 
				str = str.replace(ReN, "$1,$2"); 
		   }

		   fn.value = str;
	}

	function Loading() 
	{ 
		if (document.getElementById) 
		{   
			document.getElementById("HideDiv").style.display = "none"; 
		} 
		else 
		{ 
			if (document.layers) 
			{   
				document.hidepage.visibility = "HideDiv" ; 
			} 
			else 
			{   
				document.all.hidepage.style.visibility = "HideDiv" ; 
			} 
		} 
	} 
	
	function getComma(number) {
		number = '' + number;
		if (number.length > 3) {

		var mod = number.length % 3;
		var output = (mod > 0 ? (number.substring(0,mod)) : '');
			for (i=0 ; i < Math.floor(number.length / 3); i++) {
			if ((mod == 0) && (i == 0))
				output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
			else
				output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
			}
		return (output);
		}
		else return number;
	}

	function Trim(str) 
	{
		return str.replace(/(^\s*)|(\s*$)/g, "");
	}


	//¸ñÀû	: ¾î¶°ÇÑ °æ¿ì¿¡µµ Ã¢´Ý±â ¿©ºÎ ¹°¾îº¸Áö ¾Ê°í °­Á¦·Î Ã¢´Ý±â
	//»ç¿ë¹ý	: <a href="JavaScript:winClose()">Ã¢´Ý±â</a>
	function Close() 
	{
		self.opener = self;
		top.window.close();
	}

	/// **** ¼ýÀÚ¸¸ Çã¿ë
	function onlyNumber(Input , Msg)
	{
		if (isNaN(Input.value))
		{
			alert(Msg);
			Input.value = Input.defaultValue;
			Input.select();
			return;
		}
		return true;
	}

	function commaSplit(srcNumber) 
	{ 
		var txtNumber = '' + srcNumber; 
		var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])'); 
		var arrNumber = txtNumber.split('.'); 

		arrNumber[0] += '.'; 
		do 
		{ 
			arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2'); 
		} 
		while (rxSplit.test(arrNumber[0])); 

		if (arrNumber.length > 1) 
		{ 
			return arrNumber.join(''); 
		} 
		else 
		{ 
			return arrNumber[0].split('.')[0]; 
		} 
	} 

	/// **** ÀÌ¹ÌÁö ÆÄÀÏ¸¸ ¾÷·Îµå °¡´É
	function ChkEXT(Values)
	{	
		if (Values.replace(/ /g , "") != "")
		{
			Values = Values.toLowerCase();
			if (Values.match(/\.(gif|jpg|jpeg|bmp|png|)$/i)) 
			{
				return true;
			}
		}
	}


	/// ******** »õÃ¢ °¡¿îµ¥¼­ ¶ç¿ì±â 
	function OpenWin(Url, Name, w, h, scroll) 
	{
		if (IsXpSp2User()) h = parseInt(h) + 30

		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		var Options = 'height=' + h + ', width=' + w + ',top= ' + wint + ',left=' + winl + ',scrollbars=' + scroll + ',resizable=no';
		var Popup = window.open(Url, Name, Options)
		if (Popup == null) 
		{
			alert("Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ½Ê½Ã¿À.");
			return;
		}
	}
	
	function ImgResize(f , MaxSize) 
	{
		if (f.width > MaxSize) 
		{
			f.width = MaxSize;
			f.onclick = function() 
			{
			   //window.open(f.src, "_blank");
			   ShowPicture(f.src) ;
			}
			f.style.cursor = "pointer";
		}
	}

	function ShowPicture(src) 
	{
	  var imgObj = new Image();
	  imgObj.src = src;
	  var wopt = "scrollbars=no,status=no,resizable=no";
	  wopt += ",width=" + imgObj.width;
	  wopt += ",height=" + imgObj.height;
	  var wbody = "<head><title>»çÁø º¸±â</title>";
	  wbody += "<script language='javascript'>";
	  wbody += "function finalResize(){";
	  wbody += "  var oBody=document.body;";
	  wbody += "  var oImg=document.images[0];";
	  wbody += "  var xdiff=oImg.width-oBody.clientWidth;";
	  wbody += "  var ydiff=oImg.height-oBody.clientHeight;";
	  wbody += "  window.resizeBy(xdiff,ydiff);";
	  wbody += "}";
	  wbody += "</"+"script>";
	  wbody += "</head>";
	  wbody += "<body onLoad='finalResize()' style='margin:0'>";
	  wbody += "<a href='javascript:window.close()' title='»çÁøÀ» Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.'><img src='" + src + "' border=0></a>";
	  wbody += "</body>";
	  winResult = window.open("about:blank","",wopt);
	  winResult.document.open("text/html", "replace");
	  winResult.document.write(wbody);
	  winResult.document.close();
	  return;
	}

/***********************************************************************
 * focus ÀÌµ¿
 */
	function MoveFocus(varControl, varNext) 
	{     
		if(varControl.value.length == varControl.maxLength) 
		{ 
		  varNext.focus(); 
		  varNext.select(); 
		} 
	}  


/************************************************************************
 * ÀÔ·ÂµÈ °ªÀÇ ±æÀÌ ±¸ÇÏ±â
 */
	function StrLength(str)
	{
		var len;
		var temp;
		var len_;

		len_ = str.value.replace( / /g , "") ;
		len = len_.length;
		var tot_cnt = 0;
		
		for(k = 0; k < len ; k ++)
		{
			temp = str.value.charAt(k);
			if(escape(temp).length > 4) tot_cnt += 2;
			else tot_cnt++;
		}
		return tot_cnt;
	}



	function ShowPicture(src) 
	{
	  var imgObj = new Image();
	  imgObj.src = src;
	  var wopt = "scrollbars=no,status=no,resizable=no";
	  wopt += ",width=" + imgObj.width;
	  wopt += ",height=" + imgObj.height;
	  var wbody = "<head><title>»çÁø º¸±â</title>";
	  wbody += "<script language='javascript'>";
	  wbody += "function finalResize(){";
	  wbody += "  var oBody=document.body;";
	  wbody += "  var oImg=document.images[0];";
	  wbody += "  var xdiff=oImg.width-oBody.clientWidth;";
	  wbody += "  var ydiff=oImg.height-oBody.clientHeight;";
	  wbody += "  window.resizeBy(xdiff,ydiff);";
	  wbody += "}";
	  wbody += "</"+"script>";
	  wbody += "</head>";
	  wbody += "<body onLoad='finalResize()' style='margin:0'>";
	  wbody += "<a href='javascript:window.close()'><img src='" + src + "' border=0></a>";
	  wbody += "</body>";
	  winResult = window.open("about:blank","",wopt);
	  winResult.document.open("text/html", "replace");
	  winResult.document.write(wbody);
	  winResult.document.close();
	  return;
	}

/***********************************************************************
 * ÀÌ¹ÌÁö ¾÷·Îµå Àü  ÀÌ¹ÌÁö ¹Ì¸®º¸±â
 *
 */
	function PreviewImg()
	{
		var ImgPreView  = "Img";
		var IdName = "ID_preImg";
		var tmp = event.srcElement.value.toLowerCase();
		var MaxFileSize = 3145728 ; 
		var DenyFileSize = 469743 ;
		var FileSize = 0;
		if(tmp.match(/\.(gif|jpg|jpeg|bmp|png|)$/i)) 
		{	

			if(navigator.userAgent.indexOf('MSIE') > 0 && navigator.appVersion.indexOf('MSIE 7.') > 0)
			{
				var fso = new ActiveXObject("Scripting.FileSystemObject");
				var f = fso.GetFile(event.srcElement.value);
				FileSize = f.size;      
			}
			else
			{
				var img = new Image();
				img.dynsrc = event.srcElement.value ;
				FileSize = img.fileSize ; 
			}

			if (FileSize > MaxFileSize)
			{
				alert("ÆÄÀÏ »çÀÌÁî´Â 3MB¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nÆÄÀÏ ¿ë·®À» È®ÀÎÇØ ÁÖ¼¼¿ä.");
				event.srcElement.value = "";
				return;
			}

			if (FileSize == DenyFileSize)
			{
				alert("ÆÄÀÏ »çÀÌÁî´Â 3MB¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nÆÄÀÏ ¿ë·®À» È®ÀÎÇØ ÁÖ¼¼¿ä..");
				event.srcElement.value = "";
				return;
			}

			document.all[IdName].style.display = "";
			document.images[ImgPreView].src = event.srcElement.value;
			document.images[ImgPreView].style.display = '';

		}
		else 
		{	
			alert("ÀÌ¹ÌÁö ÆÄÀÏ¸¸ ¹Ì¸®º¸±â ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
			document.frm.Img.value = "" ;
			event.srcElement.value = "";
			document.all[IdName].style.display = "none";
			document.images[ImgPreView].style.display = "none";
		}
	}

	/// **** Ã¼Å© ¹Ú½º Ã³¸®
	function ChgTR(CheckBox)
	{
		if (CheckBox.checked)
		{
			while (CheckBox.tagName!="TR")
			{
				CheckBox = CheckBox.parentElement;
			}
			CheckBox.className = "Checked";
		}
		else
		{
			while (CheckBox.tagName!="TR")
			{
				CheckBox = CheckBox.parentElement;
			}
			CheckBox.className = "NotChecked";
		}
	}


	/// *********** ÀüÃ¼ ¼±ÅÃ 
	function ExecSelect(f)
	{	
		for ( i = 0 ; i < f.Exec.length ; i++ )
		{
			if (f.Exec[i].checked) 
			{
				f.Exec[i].checked = false;
				ChgTR(f.Exec[i]);
			}
			else 
			{
				f.Exec[i].checked = true;
				ChgTR(f.Exec[i]);
			}
		}
	}

/***********************************************************************
 * sp2 »ç¿ëÀÚ ¿©ºÎ Ã¼Å©
 *
 */
	function IsXpSp2User()
	{
		if(window.navigator.userAgent.indexOf("SV1") != -1) return true;
		else return false;
	}

/***********************************************************************
 * IE 7.0 »ç¿ëÀÚ ¿©ºÎ Ã¼Å©
 *
 */
	function IsIE70User()
	{
		if(window.navigator.userAgent.indexOf("MSIE 7.0") != -1) return true;
		else return false;
	}

/************************************************************************
 * ÀÔ·ÂµÈ ÁÖ¹Îµî·Ï ¹øÈ£·Î ³ªÀÌ °¡Á®¿À±â
 */
	function getAge(Jumin1, Jumin2) 
	{
		var Year = parseInt(Jumin1.substring(0,2), 10);
		var Month = parseInt(Jumin1.substring(2,4), 10);
		var Day = parseInt(Jumin1.substring(4,6), 10);

		var s = Jumin2.substring(0,1);
		if (s == 3 || s == 4 ) Year += 2000;
		else Year += 1900;
		
		var Dt = new Date();
		var nYear = Dt.getFullYear();
		var nMonth = Dt.getMonth();
		var nDay = Dt.getDate();
		
		if ( (nDay - Day) < 0 ) nMonth --;
		if ( (nMonth - Month) < 0 ) nYear --;
		
		var Result = nYear - Year
		return Result;
	}

/***********************************************************************
 * ³»¿ë º¹»ç
 *
 */
	function CopyText(obj, name) 
	{
			obj.select();
			text = obj.createTextRange();
			text.execCommand("copy");
			alert(name + '¸¦ º¹»çÇÏ¿´½À´Ï´Ù. \n\nCtrl+V ¶Ç´Â ÆÄÀÏ -> ºÙ¿©³Ö±â ÇÏ¿© »ç¿ëÇÏ¼¼¿ä.');
	}


	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 ;
	}

	function SetCookie( name, value, expiredays )  
	{  
		var todayDate = new Date();  
		todayDate.setDate( todayDate.getDate() + expiredays ); 
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"  
	}  


/************************************************************************
 * ÀÔ·Â °¡´ÉÇÑ ±ÛÀÚ Ã¼Å©(¿µ¹®/ÇÑ±Û)
 *  maxlen : ÇÑ±Û±âÁØ(2byte)
 */
	function ChkStrLen(maxlen,field)
	{
	   var temp; //µé¾î¿À´Â ¹®ÀÚ°ª...
	   var msglen;
	   msglen = maxlen*2;
	   var value= field.value;
	   
	   l =  field.value.length; 
	   tmpstr = "" ;

	   if (l == 0)
	   {
		value = maxlen*2;
	   }
	   else 
	   {
		  for(k=0;k<l;k++)
		  {
			temp =value.charAt(k);
			if (escape(temp).length > 4) msglen -= 2;
		    else msglen--;
		
		   if(msglen < 0) 
		   {
	          alert("ÃÑ ¿µ¹® "+(maxlen*2)+"ÀÚ ÇÑ±Û " + maxlen + "ÀÚ ±îÁö ÀÔ·ÂÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
			  field.value= tmpstr;
	          break;
		   }
		   else 
		   {
			   tmpstr += temp;
		    }
		 }
	   }
	 }


   /***********************************************************************
    * ÄÚ¸àÆ® iframe height
    */	
	function SetHeightComment()
	{       
		Height=document.frames["Ifrm_CommentList"].document.body.scrollHeight;
		document.getElementById("Ifrm_CommentList").style.height = Height; 
	} 
	
	function init_iframe()
	{
		SetHeightComment();
		setTimeout('init_iframe()' , 1) 
	}

	function SetHeightLastest()
	{       
		Height = document.frames["Ifrm_Lastest"].document.body.scrollHeight;

		document.getElementById("Ifrm_Lastest").style.height = Height; 
	} 

	function SetIframe(frmName , Url , width)
	{
		document.writeln("<iframe name=\"Ifrm_CommentList\" src=\"" + Url + "\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" topmargin=\"0\" scrolling=\"no\" height=\"100\" width=\"" + width + "\" onload=\"init_iframe()\"></iframe>")
	}

	function SetIframe_Lastest(frmName , Url , width)
	{
		document.writeln("<iframe name=\"Ifrm_Lastest\" src=\"" + Url + "\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" topmargin=\"0\" scrolling=\"no\" height=\"100\" width=\"" + width + "\" onload=\"SetHeightLastest()\"></iframe>")
	}

	function frmCheck_Search()
	{
		var f = document.frmSearch;
		if (!ChkText(f.Search_Keyword , "°Ë»öÇÏ½Ç ´Ü¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.")) return false ;
		if (!ChkText(f.Search_Option , "°Ë»öÇÏ½Ç ÀÚ·á½ÇÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.")) return false ;
	}

	function frmCheck_Search_()
	{
		var f = document.frmSearch;
		if (!ChkText(f.Search_Keyword , "°Ë»öÇÏ½Ç ´Ü¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.")) return false ;
		if (f.Search_Option.value == "A") 
		{
			//f.action = "/Search/Search.asp" ; 
			f.submit();
		}
		else 
		{
			ActionPage = "/Board/?tbl=" + f.Search_Option.value + "&Search_b_Keyword=" + f.Search_Keyword.value ;
			location.href = ActionPage ;
			return;
		}
	}

/***********************************************************************
 * ÆË¾÷Ã¢ Å©±â Á¦¾î
 */
	function ResizePopup(Width , Height)
	{
		if (IsXpSp2User()) Height = parseInt(Height) + 30

		window.resizeTo(Width ,Height)		
	}

/***********************************************************************
 * ÂÊÁö º¸³»±â
 */
	function ExecSendMsg(ToUserIdx)
	{
		OpenWin("/MyPage/Msg_Write.asp?ToUserIdx=" + ToUserIdx, "Popup_Msg" , "700" , "390" , "no")
	}
	
	function ExecPresentPoint(ToUserIdx)
	{
		window.open("/MyPage/PresentPoint.asp?ToUserIdx=" + ToUserIdx , "_blank");
	}

	function setForm(ToUserIdx , ToUserNickName)
	{
		document.writeln("<FORM name='frmTmp' method='post' >") ;
		document.writeln("<INPUT TYPE='HIDDEN' name='ToUserIdx' value='" + ToUserIdx + "'>");
		document.writeln("<INPUT TYPE='HIDDEN' name='ToUserNickname' value='" + ToUserNickName + "'>");
		document.writeln("</FORM>") ;
	}

/***********************************************************************
 * Ä«Å×°í¸® ¸Þ´º
 */
	function ShowMenu(ID)
	{
		if (ID)
		{
			var ID = eval("document.all.ID_" + ID);
			var len = ID.length;

			if (len == null)
			{
				ID.style.display = "block";
			}
			else
			{
				for (i = 0 ; i < len ; i ++)
				{
					if (ID[i].style.display == "block") ID[i].style.display="none"
					else ID[i].style.display="block"
				}
			}
		}
		else
		{
			return false;
		}
	}


/***********************************************************************
 * È¸¿øÁ¤º¸
 */
	var layername = "rg_layer_div"

	function rg_layer_action(name, status)
	{
		var obj = document.all[name];

		if (typeof(obj) == 'undefined') {
			return;
		}

		if (status) {
			obj.style.visibility = status;
		} else {
			if(obj.style.visibility == 'visible')
				obj.style.visibility='hidden';
			else
				obj.style.visibility='visible';
		}
	}

	function ShowMemberLayer(UserIdx , IsWriter)
	{
		var obj = document.all[layername];
		var x, y;
		var body = "";
		var height = 0;
		var FtpInfo ;
		
		x = event.clientX + document.body.scrollLeft - 10;
		y = event.clientY + document.body.scrollTop + 5;

		obj.style.posLeft = x;
		obj.style.posTop = y;
		
		if (IsWriter == "N")
		{
			body += "<tr bgcolor=#FFFFFF onmouseover=this.style.backgroundColor='#E5E5E5' onmouseout=this.style.backgroundColor='#FFFFFF' ";
			body += " onmousedown=\"ExecSendMsg('" + UserIdx + "');\" >"
			body += " <td align=left height=23 style='cursor:hand;'>&nbsp;ÂÊÁöº¸³»±â&nbsp;&nbsp;</td></tr>";
			height += 20;
			

			body += "<tr  bgcolor=#FFFFFF onmouseover=this.style.backgroundColor='#E5E5E5' onmouseout=this.style.backgroundColor='#FFFFFF' ";
			body += " onmousedown=\"ExecPresentPoint('" + UserIdx + "');\" style='cursor:hand;'>"
			body += " <td align=left height=23>&nbsp;Em ¼±¹°&nbsp;&nbsp;</td></tr>";
			height += 20;
		}
		if (body) 
		{
			var layer_body ;
			layer_body = "<table border=0 width=90 bgcolor=#000000 cellpadding=1 cellspacing=1>" ; 
			layer_body += body + "</table>";
			obj.innerHTML = layer_body;
			obj.style.width = 130;
			obj.style.height = height;
			obj.style.visibility='visible';
		}
	}

	function rg_init_layer(layername)
	{
		document.writeln("<div id="+layername+" style='position:absolute; left:1px; top:1px; width:1px; height:1px; z-index:1; visibility: hidden' onmousedown=\"rg_layer_action('"+layername+"', 'hidden')\" onmouseout=\"rg_layer_action('"+layername+"', 'hidden')\" onmouseover=\"rg_layer_action('"+layername+"', 'visible')\">");
		document.writeln("</div>");
	}
	
	rg_init_layer('rg_layer_div');


/***********************************************************************
 * TV Æí¼ºÇ¥ ¿ÀÇÂ
 */
	function viewTVschedule(tbl)
	{
		var wint = screen.height - 150;
		window.open("/TVschedule/TVschedule.asp?tbl=" + tbl , "TVschedule" , "width=1020 , top=0 , scrollbars=Yes , height=" + wint);
	}

	function viewTVschedule_V2(tbl,EID)
	{
		var wint = screen.height - 150;
		window.open("/TVschedule/TVschedule.asp?tbl=" + tbl + "&EID=" + EID , "TVschedule" , "width=1020 , top=0 , scrollbars=Yes , height=" + wint);
	}

/***********************************************************************
 * ÅøÆÁ
 */
	function msgposit_list(evt)
	{
		if(navigator.appName == "Netscape")
		{
			document.getElementById("helpbox").style.left = evt.pageX + 10;
			document.getElementById("helpbox").style.top  = evt.pageY + 10;
		} 
		else 
		{
			document.getElementById("helpbox").style.posLeft = event.x + 20 + document.body.scrollLeft;
			document.getElementById("helpbox").style.posTop  = event.y - 35 + document.body.scrollTop;
			document.getElementById("helpbox").style.display = 'block';
		}
	}

	function msgset_list()
	{
		var str = ToolMsg;
		var text;
		text ='<table align="center" border="0" cellpadding="10" cellspacing="0" style="border-width:1; border-color:#cccccc; border-style:solid;font-size:9pt;">';
		text += '<tr><td align=left bgcolor="lightyellow" style=padding-left:3px;>'+str+'</td></tr></table>';
		helpbox.innerHTML=text;
	}

	function msghide_list()
	{
		document.getElementById("helpbox").innerHTML = "";
	}