<%--
  - Author(s)  : Hyung min Son
  - Date       : 2014.07.25
  - Description: 결격 사유 팝업
  --%>

<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="kr.co.udapsoft.common.*" %>
<%@ page import="com.udapsoft.waf.system.*" %>
<%@ page import="com.udapsoft.waf.common.*" %>
<%@ page import="com.udapsoft.waf.common.ui.HTMLMaker" %>
<%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
<%@ page import="kr.co.hsnc.common.util.*"%>
<%@ page import="kr.co.hsnc.common.util.ValueObject" %>
<%@ page import="kr.co.hsnc.common.sql.*" %>
<%@ page import="kr.co.hsnc.common.sql.RowSet" %>
<%@ page import="kr.co.hsnc.common.sql.util.*" %>

<%-- <%@ include file="/jsp/work/taglib.jsp" %> --%>

<jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />

<%
	ctx.init(request, response); 
	HandlerStorage storage = ctx.getHandlerStorage();
	ValueObject params = storage.getParams();
	ValueObject user = ctx.getUser();
	String ROW =   (String) storage.get("ROW");
	String DISQ_REASON =   (String) storage.get("DISQ_REASON");
	//String DISQ_REASON2 = new String(URLDecoder.decode(DISQ_REASON,"UTF-8"));
%>

<%@ page contentType="text/html; charset=utf-8" %>
<SCRIPT language="JavaScript">

function doPageInit() {
		replace2();
	}
	
	function doClose()
	{
     	returnValue = null;
     	parent.DisqReasonClose(returnValue);
	}

	function goSave(){
		if($("#DISQ_REASON").val().length > 0){
			 replace();
			var returnValue = new Array();
			returnValue[0] = "<%=ROW%>";
			returnValue[1] = $("#DISQREASON").val();
			parent.DisqReasonClose(returnValue);
		}else{
			var returnValue = new Array();
			returnValue[0] = "<%=ROW%>";
			returnValue[1] = $("#DISQ_REASON").val();
			parent.DisqReasonClose(returnValue);
		}
	}
	
	function replace(){
		var content = $("#DISQ_REASON").val();
/* 		content = content.replace(/\r\n/g, '<br>');
		content = content.replace(/\n/g, '<br>');
		content = content.replace(/\r/g, '<br>'); */
		$("#DISQREASON").val(content);
	}
	
	function replace2(){
		var content = unescape($("#DISQREASON").val());
/* 		content = content.replace('<br>',"\n");
		content = content.replace('<br>',"\n");
		content = content.replace('<br>',"\r"); */
		$("#DISQ_REASON").val(content);
	}

	document.body.onload = doPageInit;


</SCRIPT>
<modular:search id="form1">
	<modular:key id="fevent" />
</modular:search>

<FORM name="form1" method="post" style="width:580px">
<INPUT type="hidden" name="ROW" value="<%=ROW%>">
<INPUT type="hidden" name="DISQREASON" value="<%=DISQ_REASON%>">
  
<table  id="t1" width="100%" border="0" cellspacing="0" cellpadding="0" class="ftit_table">
	<colgroup>
		<col width="150" />
		<col width="*" />
	</colgroup>
	<tr>
   		<th>
   		</th>
   		<td align="right">
       		<span class="btnSearch center" id="btnSearch"><a href="javascript:goSave();">저장</a></span>
   		</td>
  	</tr>
</table>  

<TABLE class="form-table">
		<colgroup>
			<col width="150" />
			<col />
		</colgroup>
  <TR height="100"> 
    <TH class="required" style="text-align:center">결격사유</TH>
	<TD><textarea name="DISQ_REASON" id="DISQ_REASON" style="width:99%; height:140px; overflow-y:auto" maxlength="4000" class="input byteChk ctrlTarget"></textarea></TD>
  </TR>
</TABLE>
</FORM>
