<%    /**
     * **********************************************************
     * @@ Program Name  : base_info_modify.jsp
     * @@ Description	: 집계문서 기본정보 변경
     * @@ Author	: 기현테크
     * @@ Create Date	: 2010-11-24
     * @@ History	:
     * @@***********************************************************
     */
%>

<%@ page contentType="text/html; charset=UTF-8"
         import="java.util.Date"
         import="java.util.List"
         import="java.text.SimpleDateFormat"
         import="javax.jdo.PersistenceManager"
         import="javax.jdo.Query"
         import="javax.jdo.Transaction"
         import="kr.co.kihyun.beans.entity.util.*"
         import="kr.co.kihyun.beans.entity.*"
         import="kr.co.kihyun.moumi.MoumiConfig"
         import="kr.co.kihyun.moumi.report.MReport"
         import="kr.co.kihyun.beans.user.HttpSSOLogin"
         import="kr.co.kihyun.beans.totsys.report.Report"
         import="kr.co.kihyun.beans.totsys.report.ReportList"
         import="kr.co.kihyun.lang.MString"
         import="kr.co.kihyun.lang.MLong"
         import="kr.co.kihyun.lang.Encoder"
         import="kr.co.kihyun.lang.MInteger"
         import="java.net.URLEncoder"
         import="java.net.URLDecoder"
         import="kr.co.kihyun.beans.user.Dept"
         import="kr.co.kihyun.beans.user.User"
         import="kr.co.kihyun.beans.user.DeptView"
         import="kr.co.kihyun.util.MDate"
         import="kr.co.kihyun.text.html.TagFilter"
         import="kr.co.kihyun.text.html.ServletUtil"
         import="kr.co.kihyun.lang.StringConverter"
         import="kr.co.kihyun.service.PrssReportsService"
         import="kr.co.kihyun.service.vo.CodeVO"
         import="kr.co.kihyun.beans.entity.Board"
         import="kr.co.kihyun.beans.entity.TotDocAppendType"
         import="org.slf4j.Logger"
         import="org.slf4j.LoggerFactory"%>
<%@ page import="java.util.Map.Entry"%>
<%@ page import="kr.co.kihyun.moumi.Moumi"%>
<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>
<%   // Logger LOG = LoggerFactory.getLogger(this.getClass());
    PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager());
    Transaction tx = pm.currentTransaction();
    //파일취합인지 확인하는 변수
    TotDocAppendType appendType=TotDocAppendType.COPY;
    try {
        /**
         * ******** 기존 session내의 userId *********
         */
        String usID = HttpSSOLogin.getLoginID(request);
        int sysAuth = HttpSSOLogin.getSysAuth(request);
//사용하지 않으므로 주석처리함,
//        String deptID = HttpSSOLogin.getDeptID(request);
//-----------

        /**
         * ******** 파일첨부 내역 보기 추가 *********
         */

        String notify = "";
        if ((String) session.getAttribute("notify") != "" || (String) session.getAttribute("notify") != null) {
            notify = (String) session.getAttribute("notify");
        }
        notify = MString.checkNull(request.getParameter("notify"), "");


//사용하지 않으므로 주석처리함,
//        Long boardID = MLong.parseLong(request.getParameter("boardID"));
//-----------
        /**
         * **추가끝**
         */


        /**
         * **** Parameter *****
         */
        //String url_sysadm = clearXSS(request.getParameter("url"), "");
        Long docID = MLong.parseLong(request.getParameter("docID"), null);
        String redirectURI = clearXSS(request.getParameter("redirectURI"), "");
    //LJH
        //String deptListView = clearXSS(request.getParameter("deptListView"),"");
        String deptListView = clearXSS(request.getParameter("deptListView"), "true");
        String docType = clearXSS(request.getParameter("docType"), null);
//        System.out.println("docType :::::  " + docType);

        tx.begin();
        /**
         * **** Doc list data get *****
         */
        TotDoc pc = pm.getObjectById(TotDoc.class, docID);
        String docName = pc.getName();
        ExecutionCode execCode = pc.getExecutionCode();
        String regID = pc.getUser(pm).getId();
        Date startDate = pc.getStartDate() == null ? new Date() : pc.getStartDate();
        Date endDate = pc.getEndDate();
        AccessAuth accAuth = pc.getAccessAuth();
        AcceptanceLimitStrategy strategy = pc.getAcceptanceLimitStrategy();
        TotDocProcess prss = pc.getProcess(pm);
        int docGroupID = pc.getType().ordinal();
        Long repID = pc.getMasterTotDoc() == null ? null : pc.getMasterTotDoc().getId();
        MDept mDept = pm.getObjectById(MDept.class, pc.getDept());
		appendType = pc.getAppendType();
        Board board = pc.getBoard();

        tx.rollback();

        /**
         * ******** 시작, 종료 년, 월, 일 *********
         */
        Date currentDate = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        SimpleDateFormat hourFormat = new SimpleDateFormat("HH");
        String stDate = dateFormat.format(startDate);
        String stTime = hourFormat.format(startDate);
        String edDate = dateFormat.format(endDate);
        String edTime = hourFormat.format(endDate);
        String curDate = dateFormat.format(currentDate);
        String curTime = hourFormat.format(currentDate);

        String setTheTime = pc.getProcess(pm) == TotDocProcess.REG ? "등록" : pc.getProcess(pm) == TotDocProcess.END ? "종료" : "";
//        System.out.println("setTheTime :::; " + setTheTime);
        Report report = new Report();
        int allReportCount = report.getAllCount(docID);


          //2014.10.14 Delete by KWON,HAN : 위를 아래와 같이 변경하였으나 사용하지 않으므로 주석
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//        PrssReportsService prssService = new PrssReportsService(pm);
////
////        String deptIDs = "";
////        String deptNames = "";
////
//        List list = null;
//        list = prssService.getReportDeptListByDocId(docID);
//        int allReportCount = list.size();
//
//        if( list != null && list.size() > 0 ) {
//            for (int i = 0; i < listCount; i++) {
//                CodeVO codeVO = (CodeVO)list.get(i);
//                if (i != 0) {
//                    deptIDs   += "," + codeVO.getCode();
//                    deptNames += "," + codeVO.getValue();
//                } else {
//                    deptIDs   = codeVO.getCode();
//                    deptNames = codeVO.getValue();
//                }
//            }
//        }
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



        String boardTitle = "";
        String boardContents = "";
        String usrFilenames = "";
        String svrFilenames = "";
        int fileCount = 0;
        String[] usrFilenameList = null;
        String[] svrFilenameList = null;


            tx.begin();
            boardTitle = board.getTitle();
            boardContents = TagFilter.convertSpace(MString.checkNull(board.getContents()));
            //첨부파일을 가져오는 부분에서 속도 저하 : 파일용량에 영향을 받는다
            for (Entry<String, List<Byte>> entry : board.getAttachments().entrySet()) {
                usrFilenames += entry.getKey() + ";";
                svrFilenames += entry.getKey() + ";";
            }
            //fileCount = board.getAttachments().size();

            usrFilenameList = usrFilenames.split(";");
            svrFilenameList = svrFilenames.split(";");
            if(!"".equals(svrFilenames)) {
                fileCount = usrFilenameList.length;
            }

            tx.rollback();

        /**
         * ****파일첨부보기 내역 추가 *****
         */
//사용하지 않으므로 주석처리함,
//        String boardGroupID = Category.ID_TOT_DOC_COMMENT;
//        String url = clearXSS(request.getParameter("url"), "");
//-----------

//        String[] usrFilenameList = usrFilenames.split(";");
//        String[] svrFilenameList = svrFilenames.split(";");

        /**
         * ****추가끝*****
         */
        //System.out.println("execCode.getDeptName()=" + execCode.getDeptName());
%>
	<!--첨부파일보기 추가 -->
	<script src="/totsys/common/js/jquery.custom.indicator.js"></script>
	<script>


    function ok() {
        opener.dform.notify.value = document.getElementById('EditCtrl').value;
//                        alert(opener.dform.notify.value);
        self.close();
    }

    function cancel() {
        self.close();
    }

    function formLoad() {
    <%if (!MString.isNull(notify)) {%>
        document.getElementById('EditCtrl').value = '<%=TagFilter.convertSingle(notify)%>';
    <%} else {%>
        document.getElementById('EditCtrl').value = opener.dform.notify.value == "null" ? "" : opener.dform.notify.value;
    <%}%>
    }

</script>
<!--추가끝-->
<script src="/totsys/common/js/util.js"></script>
<script src="/totsys/common/js/calendar.js"></script>
<script src="/totsys/common/js/drag.js"></script>
<script src="/totsys/common/js/date.js"></script>
<script src="/totsys/common/js/popup.js"></script>
<script src='/totsys/common/js/mouse.js'></script>
<script>
    totCount = 0;
    function formSubmit(sExecType) {

        if (dform.docName.value == '') {
            alert('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.dataNameCheck")%>');
            dform.docName.focus();
            return;
        } else if (dform.accAuth[0].checked == false && dform.accAuth[1].checked == false && dform.accAuth[2].checked == false && dform.accAuth[3].checked == false) {
            alert('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.docAuth")%>');
            return;

<% if("등록".equals(setTheTime)) { %>
        } else if ((dform.stDate.value == '') || (dform.stTime.value == '')) {
            //시작일을 입력하지 않으셨습니다.
            alert('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.startDateCheck")%>');
            dform.stDate.focus();
            return;
<% } %>

        } else if ((dform.edDate.value == '') || (dform.edTime.value == '')) {
            //종료일을 입력하지 않으셨습니다.
            alert('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.endDateCheck")%>');
            dform.edDate.focus();
            return;
        } else if (containsChars(dform.docName, '\\\/\:\*\?\"\<\>\|')) {
            alert("<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.dataNameSymboleCheck")%>"+" \\ / : * ? \" < > |");
            dform.docName.focus();
            return;
            //}else if (containsChars(dform.docName,'￦/?"<>|!,*&^%$#@~;')) {

        } else if (getByteSize(dform.docName.value) >= 200) {
            // 자료명의 데이터 길이수 체크. 2014.12.01 by YOUNGJUN,CHO
            // 200 byte 가 넘지 않도록 자료명의 길이를 제한한다.
            alert("자료명의 길이는 한글기준 66자 이내여야 합니다.");
            dform.docName.focus();
            return;
        }

        var stDate = document.dform.stDate.value;
        var stTime = document.dform.stTime.value;
        var edDate = document.dform.edDate.value;
        var edTime = document.dform.edTime.value;

<% if("등록".equals(setTheTime)) { %>
        var stOriginDate = document.dform.stOriginDate.value;
        var stOriginTime = document.dform.stOriginTime.value;
        var curDate = document.dform.curDate.value;
        var curTime = document.dform.curTime.value;

//alert(stOriginDate+stOriginTime)   ;
//alert(curDate+curTime)   ;
//alert(stDate+stTime)   ;

        //변경이 일어난 경우
        //시작일이 현재일시보다 이전이면 안된다.
        if(stOriginDate+stOriginTime != stDate+stTime) {
            if( !isDateTrue(curDate+curTime, stDate+stTime) ) {
                //시작일시를 현재일시 이후 다시 선택하여 주십시오.
                alert("시작일시를 현재일시 이후로 다시 설정하여 주십시오.");
                document.dform.stDate.value = stOriginDate;
                document.dform.stTime.value = stOriginTime;
                document.dform.stDate.focus();
                document.dform.stDate.select();
                return false;
            }
        }
<% } %>

        if( !isDateTrue(stDate+stTime, edDate+edTime) ) {
            //종료일은 시작일 이후 날짜로 다시 선택하여 주십시오.
            alert("<%= MoumiConfig.getMessageBundle().getString("moumi.message.popup.startEndDateCheck") %>");
            document.dform.edDate.focus();
            document.dform.edDate.select();
            return false;
        }

        if (!<%=deptListView.equals("true")%>)
        {
            document.dform.deptCountText.value = "<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.submitDevision")%>";
            dform.deptChange.value = "0";
        }
        else if (dform.deptChange.value == "0")
        {
            alert('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.submitDevisionCheck")%>');
            deptSelect();
            return;
        }
        else {
            //집계종료방법이 종료일지정이고, 집계시작(PRSS) 버튼을 클릭한 경우
            if(document.dform.acceptanceLimitStrategy[0].checked == true && sExecType == 'start') {
                if (!confirm("종료일이 "+ edDate + "일 "+ edTime + "시 입니다.\n\n종료일이 맞으면 [확인]을 선택해 주세요. \n\n아니면 [취소]를 선택하여 종료일을 수정하고 집계시작을 해 주세요.")) {
                    return;
                }
            }
            dform.title.value = dform.docName.value;
<% if("등록".equals(setTheTime)) { %>
            if(stOriginDate+stOriginTime != stDate+stTime) {
                document.dform.setTheTime.value = "수정";
            }
<% } %>
            dform.submit();
            $.customIndicator.show(window.self);
        }
    }

    function insertForm() {
        init();
        EditCtrl.document.body.innerHTML = '<%=StringConverter.toOneLine(TagFilter.convertSingle(boardContents))%>';
    }

    function setEndDate() {
        document.getElementById('endDate').style.display = 'inline';
        document.getElementById('submitLimit').style.display = 'none';
    }

    function setSubmitLimit() {
        document.getElementById('endDate').style.display = 'none';
        document.getElementById('submitLimit').style.display = 'inline';
        dform.submitLimit.focus();
    }

    function setEndManually() {
        document.getElementById('endDate').style.display = 'none';
        document.getElementById('submitLimit').style.display = 'none';
    }

    function totRange1() {
        //alert(document.dform.totRange[0].value);
        totCount++;
        document.dform.deptIDs.value = "";
        document.dform.deptNames.value = "";
        document.dform.handyName.value = "";
        document.dform.handyName.readOnly = false;
    <%if (!deptListView.equals("false")) {%>
        document.dform.deptCountText.value = "<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.submitDevision")%>";
        dform.deptChange.value = "0";
    <%}%>
    }

    function totRange2() {
        //alert(document.dform.totRange[1].value);
        totCount++;
        document.dform.deptIDs.value = "";
        document.dform.deptNames.value = "";
        document.dform.handyName.value = "";
        document.dform.handyName.value = "<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.innerTot_doc")%>";
        document.dform.handyName.readOnly = true;
    <%if (!deptListView.equals("false")) {%>
        document.dform.deptCountText.value = "<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.submitDevision")%>";
        dform.deptChange.value = "0";
    <%}%>
    }

    function containsChars(input, chars) {
        for (var inx = 0; inx < input.value.length; inx++) {
            if (chars.indexOf(input.value.charAt(inx)) != -1)
                return true;
        }
        return false;
    }
    function doresize(ifr)
    {	
    	//서식수정 iframe 크기 정돈
        $(ifr).height(ifr.contentWindow.document.body.scrollHeight+100);
        $(ifr.contentWindow.document.body).css('overflow','hidden');
    }
</script>

<script>
    function cancle() {
        var frm = document.docCancle;
        if ("<%=regID%>" == "<%=usID%>" || "<%=MoumiConfig.SYSADM%>" == "<%=sysAuth%>" || "<%=MoumiConfig.SUB_SYSADM%>" == "<%=sysAuth%>") {
            if (confirm('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.tot_docMessageDel")%>')) {
                frm.submit();
            }
        } else {
            alert('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.tot_docCanelRegist")%>');
        }
    }

    function endDoc() {
        if ("<%=regID%>" == "<%=usID%>" || "<%=MoumiConfig.SYSADM%>" == "<%=sysAuth%>" || "<%=MoumiConfig.SUB_SYSADM%>" == "<%=sysAuth%>") {
            var check = confirm('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.doc_listEnd")%>');
            if (check == true)
            {
                document.endForm.userID.value = "<%=usID%>";
                document.endForm.submit();
            }
            else
                return;
        }
        else
        {
            alert('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.doc_listEndPossible")%>');
        }
    }

    function reProcess() {
        if ("<%=regID%>" == "<%=usID%>" || "<%=MoumiConfig.SYSADM%>" == "<%=sysAuth%>" || "<%=MoumiConfig.SUB_SYSADM%>" == "<%=sysAuth%>") {
            var frm = document.rePrss;
            if (confirm('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.tot_docCancelReprss")%>')) {
                frm.submit();
            }
        } else {
            alert('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.docReprss")%>');
        }
    }

    function docDel() {
    <%if (repID == null) {%>
        if ("<%=regID%>" == "<%=usID%>" || "<%=MoumiConfig.SYSADM%>" == "<%=sysAuth%>" || "<%=MoumiConfig.SUB_SYSADM%>" == "<%=sysAuth%>") {
            var frm = document.Del;
            if (confirm('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.docForeverDelete")%>')) {
                frm.submit();
            }
        } else {
            alert('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.docRegistDelete")%>');
        }
    <%} else {%>
        alert('<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.sub_doc_list")%>');
    <%}%>
    }

    //body onload 시에 호출된다.
    $(document).ready(function() {
        //@@@ test : 첨부파일을 가져오는 부분에서 속도 저하가 발생한다.
        //popupViewInner("0", "file0", "206565");

    	//미진행자료일 경우 종료방법 기본값으로 기간지정 선택
    	if('<%=docType%>'=='REG'){
    		$('#rdLimitByDeadlineStrategy').prop('checked',true);
    	}
    });

    /**
     * Ajax기능을 사용하여 서버에 첨부파일 리스트을 요청하는 함수
     * @param {type} p_deptId
     * @param {type} p_lov_type
     * @returns {undefined}
     */
    function popupViewInner(p_index, obj_id, p_boardID){
        $.ajax({
            url:"/servlet/kr.co.kihyun.service.servlet.AjaxProcessServlet",
            type:"POST",
            dataType:"json",
            async: true,
            data:{
                proc_type:"board_attatch_file",
                index:p_index,
                file_index:obj_id,
                board_id:p_boardID
            },
            success:function(data) {
                fn_callBackForSuccess(data);
            },
            error:function(e) {
                alert("error=" + e);
            },
            beforeSend:function() {
                $.customIndicator.show(window.self);
            },
            complete:function() {
                $.customIndicator.hide(window.self);
            }
        });
    }

    /**
     * fn_getDeptLOV함수의 성공 시 호출되는 함수
     * @param {type} data
     * @returns {undefined}
     */
    function fn_callBackForSuccess(data) {
        var fileCount = 0
        var fileNames = "";
        var fileName = "";
        var fileNameEncode = "";
        var fileList = "";

        if( data != null ) {
            for(var i = 0; i < data.length; i++ ) {
                fileNames += data[i].fileName;
                fileCount += 1;

                fileName  = data[i].fileName;
                fileNameEncode  = data[i].fileNameEncode;

                fileList += "<%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.file")%> "+(i+1)+" <a href=\'/servlet/kr.co.kihyun.text.html.HttpViewer?saveAs="+fileNameEncode+"&fileName="+fileNameEncode+"&docID=<%=docID%>\' target=\'hiddenFrame\'>" + fileName+ "</a>";
            }
            document.getElementById("fileCount").value = fileCount;
            document.getElementById("usrFilenames").value = fileNames;
            document.getElementById("svrFilenames").value = fileNames;
            document.getElementById("fileNameList").innerHTML = fileList;
        }
     }

            /**
             * 시작일과 종료일의 정합성 체크 함수
             * @param {type} stDate
             * @param {type} edDate
             * @returns {Boolean}
             */
            function isDateTrue(stDate, edDate) {
                if(stDate <= edDate) {
                    return true;
                }
                return false;
            }

            //calendar.js 에서 날짜를 선택하면 실행되는 콜백함수
            function fn_CalSetValue(obj, value) {
                var stDate = document.dform.stDate.value;
                var stTime = document.dform.stTime.value;
                var edDate = document.dform.edDate.value;
                var edTime = document.dform.edTime.value;

                if( !isDateTrue(stDate+stTime, edDate+edTime) ) {
                    //종료일은 시작일 이후 날짜로 다시 선택하여 주십시오.
                    alert("<%= MoumiConfig.getMessageBundle().getString("moumi.message.popup.startEndDateCheck") %>");
                    document.dform.edDate.focus();
                    document.dform.edDate.select();
                    return false;
                }

                return true;
            }

</script>
<form name="Del" action="/servlet/kr.co.kihyun.beans.totsys.totper.HttpDocDel" method="post">
    <input type="hidden" name="docID" value="<%=docID%>">
    <input type="hidden" name="userID" value="<%=usID%>">
    <input type="hidden" name="docType" value="<%= docType%>">
    <input type="hidden" name="url" value="">
</form>
<form name="endForm" method="post" action="/servlet/kr.co.kihyun.beans.totsys.totper.HttpDocEnd">
    <input type="hidden" name="docID" value="<%= docID%>">
    <input type="hidden" name="userID" value="<%= usID%>">
    <input type="hidden" name="docType" value="<%= docType%>">
</form>

<form name="rePrss" action="/servlet/kr.co.kihyun.beans.totsys.totper.HttpReProcess" method="post">
    <input type="hidden" name="docID" value="<%= docID%>">
    <input type="hidden" name="userID" value="<%= usID%>">
    <input type="hidden" name="docType" value="<%= docType%>">
</form>
<!--기본정보수정용 폼(문서끝까지 단일폼으로 이어지도록 설계)-->
<form name="dform" action="/servlet/kr.co.kihyun.beans.totsys.doc.HttpDocModifyer" method="post">
    <!--문서기본정보값(아래쪽의 문서명,시작일,종료일 등 선택값도 포함)-->
    <input type="hidden" name="docID" value="<%=docID%>">
    <input type="hidden" name="docType" value="<%=docType%>">
    <input type="hidden" name="prss">
<% if("등록".equals(setTheTime)) { %>
    <input type="hidden" name="stOriginDate" value="<%=stDate%>">
    <input type="hidden" name="stOriginTime" value="<%=stTime%>">
    <input type="hidden" name="curDate" value="<%=curDate%>">
    <input type="hidden" name="curTime" value="<%=curTime%>">
<% } else { %>
    <input type="hidden" name="stDate" value="<%=stDate%>">
    <input type="hidden" name="stTime" value="<%=stTime%>">
<% } %>
    <input type="hidden" name="appendType" value="<%=pc.getAppendType().toString()%>">
    <input type="hidden" name="setTheTime" value="<%=  setTheTime%>" >
    <input type="hidden" name="docGroupID" value="<%=docGroupID%>">
    <input type="hidden" name="deptCount"> <!--조직도선택리스트값-->
    <input type="hidden" name="deptIDs">
    <input type="hidden" name="deptNames">
    <input type="hidden" name="userIDs">
    <input type="hidden" name="userNames"> <!--입력요령 및 첨부파일값-->
    <input type="hidden" name="boardID">
    <input type="hidden" name="notify" value="<%= boardContents%>"/>
    <input type="hidden" id="fileCount"  name="fileCount" value="<%=fileCount%>">
    <input type="hidden" id="usrFilenames"  name="usrFilenames" value="<%=usrFilenames%>">
    <input type="hidden" id="svrFilenames"  name="svrFilenames" value="<%=svrFilenames%>">
    <input type="hidden" name="fileInfos"><!--프로세스종료 후 되돌아갈 페이지주소(이 파일을 include할때 부모페이지에서 param속성으로 설정한다.)-->
    <input type="hidden" name="redirectURI" value="<%=redirectURI%>">
    <%
        if (!deptListView.equals("false")) {
    %>
    <input type="hidden" name="deptChange" value="1">
    <%
        }
    %>

    <tr style="padding-top: 10px;">
	    <td colspan="4" class="kecttep_title tal" style="width: 14px;">
	    <img alt="글머리" src="/totsys/common/images/ico_3.gif"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.information")%>
	    </td>
    </tr>
    <tr>
        <td>
            <table class="kecttep_list_table">
                <tr>
                    <td class="kecttep_tdmenu" style="padding-left: 20px; width: 120px;">
                       <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.doc")%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.name")%>
                    </td>
                    <td class="kecttep_last_graytd" style="padding-left: 15px; padding-right: 10px; width:100px;">
                        <input name="docName" value="<%=docName%>" type="text" size="100" class="inputtxt" style="ime-mode:active" >
                    </td>
                    <td class="kecttep_tdmenu" style="padding-left: 20px; width: 120px;">
                        <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.executionCode")%></td>
                    <td class="kecttep_list_graytd" style="padding-left: 15px;">
                        <%= (execCode != null && execCode.getDeptName() != null) ? execCode.getDeptName() : mDept.getName()%>_
                        <input name="execNum" type="text" class="inputtxt" style="width: 50px;" value="<%=execCode == null || execCode.getNumber() == null ? "" : execCode.getNumber()%>">
                        (<input name="execDate" type="text" size="10" value="<%=execCode == null || execCode.getDate() == null ? "" : dateFormat.format(execCode.getDate())%>"
                                readonly onclick="showSetWin('dform.execDate');"
                                style="cursor: hand;" class="inputtxt"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.day")%>&nbsp;<a
                                href="#" onclick="showSetWin('dform.execDate');"><img alt="달력" src="/totsys/common/images/date.gif" align="middle"></a>)
                    </td>
                </tr>
                </tr>
                    <!-- 서식형태 -->
                   <td class="kecttep_tdmenu" style="padding-left: 20px;">
                       <%= TotDocType.FORM_DOC%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.form")%>
                   </td>
                   <td class="kecttep_last_graytd" style="padding-left: 15px;">
                       <label class="label-cotent1" onmouseover="balloon_on('한글이나 엑셀에서 작성한 파일을 붙여넣기 하여 서식을 생성한 후 취합하는 방법(서식외 첨부파일 제출 가능)',this,5,0)" onmouseout="balloon_off()">
                           <input type="radio" name="appendType" value="<%= TotDocAppendType.COPY%>" <%= appendType == TotDocAppendType.COPY ? " checked" : ""%> disabled>
                                <%= TotDocType.FORM_DOC%>+<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.file")%>
                       </label>
                       <label class="label-cotent1" onmouseover="balloon_on('한글이나 엑셀에서 작성한 파일을 붙여넣기 하여 서식을 생성한 후 취합하는 방법(서식 입력만 가능)',this,5,0)" onmouseout="balloon_off()">
                           <input type="radio" name="appendType" value="<%= TotDocAppendType.SYSTEM%>" <%= appendType == TotDocAppendType.SYSTEM ? " checked" : ""%> disabled>
                                <%= TotDocType.FORM_DOC%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.copy")%>
                       </label>
                       <label class="label-cotent1" onmouseover="balloon_on('첨부파일로 제출된 자료를 취합(압축저장)하는 방법',this,5,0)" onmouseout="balloon_off()">
                           <input type="radio" name="appendType" value="<%= TotDocAppendType.FILE%>" <%= appendType == TotDocAppendType.FILE ? " checked" : ""%> disabled>
                                <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.file")%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.tot_doc")%>
                       </label>

                       <label class="label-cotent1" onmouseover="balloon_on('이전에 집계한 서식을 다시 재사용하여 문서를 생성하는 방법',this,5,0)" onmouseout="balloon_off()">
                           <input id="rd<%= TotDocAppendType.REUSE%>" type="radio" name="appendType" value="<%= TotDocAppendType.REUSE%>" <%= appendType == TotDocAppendType.REUSE ? " checked" : ""%> disabled>
                               <%= TotDocType.FORM_DOC%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.box")%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.upTake")%>
                       </label>
                   </td>
                    <!--자료공유범위-->
                    <td class="kecttep_tdmenu" style="padding-left: 20px;">
                        <%=MoumiConfig.getMessageBundle().getString("moumi.message.doc")%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.type.share")%>
                    </td>
                    <td class="kecttep_list_graytd" style="padding-left: 15px;">
                        <label class="label-cotent1" onmouseover="balloon_on('문서를 생성한 담당자만 취합자료 관리',this,5,0)" onmouseout="balloon_off()">
                            <input name="accAuth" value="0" type="radio"<%= accAuth == AccessAuth.PER ? " checked" : ""%>>&nbsp;<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.personal")%>
                        </label>
                        <label class="label-cotent1" onmouseover="balloon_on('문서를 생성한 담당자와 동일 부서 사용자에게 취합자료 공유',this,5,0)" onmouseout="balloon_off()">
                            <input name="accAuth" value="1" type="radio"<%= accAuth == AccessAuth.DEPT ? " checked" : ""%>>&nbsp;<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.devision")%>
                        </label>
                        <label class="label-cotent1" onmouseover="balloon_on('문서를 생성한 담당자와 동일 기관 사용자에게 취합자료 공유',this,5,0)" onmouseout="balloon_off()">
                            <input name="accAuth" value="2" type="radio"<%= accAuth == AccessAuth.PART ? " checked" : ""%>>&nbsp;<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.coporation")%>
                        </label>
                        <label class="label-cotent1" onmouseover="balloon_on('전체 기관 사용자에게 취합 자료 공유(학교사용자 제외)',this,5,0)" onmouseout="balloon_off()">
                            <input name="accAuth" value="3" type="radio"<%= accAuth == AccessAuth.ALL ? " checked" : ""%>>&nbsp;<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.all")%>
                        </label>
                    </td>

                </tr>

                <tr>
                    <!-- 자료입력기관 -->
                    <td class="kecttep_tdmenu" style="padding-left: 20px; width: 120px;">
                        <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.dataInputDevision")%></td>
                    <td colspan="3"  class="kecttep_list_graytd" style="padding-left: 15px;">
                    	<a href="javascript:void(0);" onClick="javascript:deptSelect();">
                            <img src="/totsys/common/images/bt_dept_select2.gif" alt="<%=MoumiConfig.getMessageBundle().getString("moumi.message.button_large.submitDept")%>" valign="absmiddle" />
                        </a>
                        <input name="deptCountText" type="text" style="width: 230px; border: 0; color: black; padding-top: 3px"
                                           value='<%=allReportCount%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.devisionSelect")%>'
                                           align="absmiddle">
                                   <!--개의 기관을 선택하였습니다. -->
                    </td>
                </tr>

                <tr>
                    <!--입력요령-->
                    <td class="kecttep_tdmenu" width="120px;" style="padding-left: 20px;">
                        <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.input")%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.trick")%>
                    </td>

                    <td class="kecttep_list_graytd" style="padding-left: 15px;">
                        <a href="javascript:void(0);" onClick="javascript:inputText();">
                            <span>
                                <img src="/totsys/common/images/bt_psd.gif" alt="<%=MoumiConfig.getMessageBundle().getString("moumi.message.button_large.inputWrite")%>" />
                            </span>
                        </a>
                    </td>
                    <!--파일첨부-->
                    <td class="kecttep_tdmenu" width="120px;" nowrap style="padding-left: 20px;">
                        <%= Moumi.getMessageBundle().getString("moumi.message.tot_doc.add")%><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.file")%>
                    </td>
                    <td class="kecttep_list_graytd" style="padding-left: 15px;">
                        <%int i;
                        for (i = 0; i < (svrFilenameList.length); i++) {
                            if (svrFilenameList[i] != null && !svrFilenameList[i].equals("")) {%>
                               <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.file")%><%= (i + 1)%> :
                               <!--파일다운로드시 hidden iframe 으로 타겟을 변경하여 새창으로 안뜨게 수정. by YOUNGJUN,CHO 2014.11.26-->
                               <a href="/servlet/kr.co.kihyun.text.html.HttpViewer?saveAs=<%=URLEncoder.encode(svrFilenameList[i], "UTF-8")%>&fileName=<%=URLEncoder.encode(svrFilenameList[i], "UTF-8")%>&docID=<%=docID%>" target="hiddenIframe">
                               <%
									int checkComma = svrFilenameList[i].lastIndexOf(".");
			                        int checkCommaBefore = svrFilenameList[i].lastIndexOf("_");
				                        svrFilenameList[i] = svrFilenameList[i].substring(0, checkCommaBefore).concat(svrFilenameList[i].substring(checkComma));
								%>
                               <%= svrFilenameList[i]%></a></br>
                            <%} else {%>
                               &nbsp;
                            <%}%>
                        <%}%>
                        <span id="fileNameList" style="white-space: nowrap;"></span>
                    </td>
                </tr>
                <!--추가끝-->
                <tr>
                    <!--집계종료방법-->
                    <td class="kecttep_tdmenu" style="width: 115px; padding-left: 20px;">
                        <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.endMethod")%>
                    </td>
                    <td colspan="3" class="kecttep_list_graytd" style="padding-left: 15px;">

<% if("등록".equals(setTheTime)) { %>
                        <!--  기간 지정 -->
                        <span>
                        <label style="width:70px;">
                            <input id="rd<%= LimitByDeadlineStrategy.class.getSimpleName()%>" type="radio" name="acceptanceLimitStrategy" onclick="setEndDate();" value="<%= LimitByDeadlineStrategy.class.getSimpleName()%>"<%= strategy instanceof LimitByDeadlineStrategy ? " checked" : ""%> />기간지정&nbsp;
                        </label>
                        </span>
                        <span id="sttDate" style="display: inline;">
                            <input id="st<%= LimitByDeadlineStrategy.class.getSimpleName()%>" name="stDate" type="text" size="10" value="<%=stDate%>" readonly
                                   <% if (strategy instanceof LimitByDeadlineStrategy) {%> onclick="showSetWin('dform.stDate');" <%}%>
                                   style="cursor: hand;" class="inputtxt"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.day")%>&nbsp;
                            <% if (strategy instanceof LimitByDeadlineStrategy) {%>
                                <a id="ln<%= LimitByDeadlineStrategy.class.getSimpleName()%>" href="#" onclick="showSetWin('dform.stDate');">
                            <%}%>
                                <img id="img<%= LimitByDeadlineStrategy.class.getSimpleName()%>" src="/totsys/common/images/date.gif" align="middle">
                            <% if (strategy instanceof LimitByDeadlineStrategy) {%>
                                </a>
                            <%}%>
                            &nbsp;
                            <input id="stT<%= LimitByDeadlineStrategy.class.getSimpleName()%>" name="stTime" type="text" size="3" maxlength="2" value="<%=stTime%>" onclick="this.focus(); this.select();" onBlur="checkNum(this, '2'); checkMaxNum(this, 00, 23);" class="inputtxt"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.time")%>
                        </span> ~
                        <span id="endDate" style="display: inline;">
                            <input id="ed<%= LimitByDeadlineStrategy.class.getSimpleName()%>" name="edDate" type="text" size="10" value="<%=edDate%>" readonly
                                   <% if (strategy instanceof LimitByDeadlineStrategy) {%> onclick="showSetWin('dform.edDate');" <%}%>
                                   style="cursor: hand;" class="inputtxt"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.day")%>&nbsp;
                            <% if (strategy instanceof LimitByDeadlineStrategy) {%>
                                <a id="ln<%= LimitByDeadlineStrategy.class.getSimpleName()%>" href="#" onclick="showSetWin('dform.edDate');">
                            <%}%>
                                <img alt="달력" id="img<%= LimitByDeadlineStrategy.class.getSimpleName()%>" src="/totsys/common/images/date.gif" align="middle">
                            <% if (strategy instanceof LimitByDeadlineStrategy) {%>
                                </a>
                            <%}%>
                            &nbsp;
                            <input id="edT<%= LimitByDeadlineStrategy.class.getSimpleName()%>" name="edTime" type="text" size="3" maxlength="2" value="<%=edTime%>" onclick="this.focus(); this.select();" onBlur="checkNum(this, '2'); checkMaxNum(this, 00, 23);" class="inputtxt"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.time")%>
                        </span>
<% } else if("종료".equals(setTheTime)){ %>
                        <!-- 시작일 -->
                         <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.startDate")%> : <%= stDate%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.day")%> <%= stTime%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.time")%>
                        <!-- 종료일지정 -->
                        <label>
                            <input id="rd<%= LimitByDeadlineStrategy.class.getSimpleName()%>" type="radio" name="acceptanceLimitStrategy" onclick="setEndDate();" value="<%= LimitByDeadlineStrategy.class.getSimpleName()%>"<%= strategy instanceof LimitByDeadlineStrategy ? " checked" : ""%> /><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.endScheduled")%>
                        </label>
                        <span id="endDate" style="display: inline;">
                            <input id="ed<%= LimitByDeadlineStrategy.class.getSimpleName()%>" name="edDate" type="text" size="10" value="<%=edDate%>"
                                   onclick="showSetWin('dform.edDate');"
                                   style="cursor: hand;" class="inputtxt"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.day")%>&nbsp;
                                <a id="ln<%= LimitByDeadlineStrategy.class.getSimpleName()%>" href="#" onclick="showSetWin('dform.edDate');">
                                <img alt="달력" id="img<%= LimitByDeadlineStrategy.class.getSimpleName()%>" src="/totsys/common/images/date.gif" align="middle">
                                </a>
                            &nbsp;
                            <input id="edT<%= LimitByDeadlineStrategy.class.getSimpleName()%>" name="edTime" type="text" size="3" maxlength="2" value="<%=edTime%>" onclick="this.focus(); this.select();" onBlur="checkNum(this, '2'); checkMaxNum(this, 00, 23);" class="inputtxt"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.time")%>
                        </span>
<% } else { %>
 <!-- 시작일 -->
                         <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.startDate")%> : <%= stDate%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.day")%> <%= stTime%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.time")%>
                        <!-- 종료일지정 -->
                        <label>
                            <input id="rd<%= LimitByDeadlineStrategy.class.getSimpleName()%>" type="radio" name="acceptanceLimitStrategy" onclick="setEndDate();" value="<%= LimitByDeadlineStrategy.class.getSimpleName()%>"<%= strategy instanceof LimitByDeadlineStrategy ? " checked" : ""%> /><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.endScheduled")%>
                        </label>
                        <span id="endDate" style="display: inline;">
                            <input id="ed<%= LimitByDeadlineStrategy.class.getSimpleName()%>" name="edDate" type="text" size="10" value="<%=edDate%>" readonly
                                   <% if (strategy instanceof LimitByDeadlineStrategy) {%> onclick="showSetWin('dform.edDate');" <%}%>
                                   style="cursor: hand;" class="inputtxt"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.day")%>&nbsp;
                            <% if (strategy instanceof LimitByDeadlineStrategy) {%>
                                <a id="ln<%= LimitByDeadlineStrategy.class.getSimpleName()%>" href="#" onclick="showSetWin('dform.edDate');">
                            <%}%>
                                <img alt="달력" id="img<%= LimitByDeadlineStrategy.class.getSimpleName()%>" src="/totsys/common/images/date.gif" align="middle">
                            <% if (strategy instanceof LimitByDeadlineStrategy) {%>
                                </a>
                            <%}%>
                            &nbsp;
                            <input id="edT<%= LimitByDeadlineStrategy.class.getSimpleName()%>" name="edTime" type="text" size="3" maxlength="2" value="<%=edTime%>" onclick="this.focus(); this.select();" onBlur="checkNum(this, '2'); checkMaxNum(this, 00, 23);" class="inputtxt"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.time")%>
                        </span>
     <% } %>

                        <label>
                            <input id="rd<%= LimitBySubmitDateStrategy.class.getSimpleName()%>" type="radio" name="acceptanceLimitStrategy" onclick="setSubmitLimit();"
                               value="<%= LimitBySubmitDateStrategy.class.getSimpleName()%>"<%= strategy instanceof LimitBySubmitDateStrategy ? " checked" : ""%> /><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.endBySubmitCount")%>
                        </label>
                        <span id="submitLimit" style="display: <%= strategy instanceof LimitBySubmitDateStrategy ? "inline" : "none"%>;">
                            <input id="cnt<%= LimitBySubmitDateStrategy.class.getSimpleName()%>" type="text" name="submitLimit" onfocus="this.select();" onblur="checkNum(this, '2');" class="inputtxt" style="width: 2em; text-align: right;" value="<%= pc.getAcceptanceLimitStrategy().getLimitCount()%>"/>
                            <%= MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.coporation")%>
                        </span>
                        <label>
                            <input id="rd<%= UnlimitStrategy.class.getSimpleName()%>" type="radio" name="acceptanceLimitStrategy" onclick="setEndManually();"
                               value="<%= UnlimitStrategy.class.getSimpleName()%>"<%= strategy instanceof UnlimitStrategy ? " checked" : ""%> /><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.endManually")%>
                        </label>
                    </td>
                </tr>
            </table>
			<script>
                    function deptSelect() {
                        var height = screen.height;
                        var width = screen.width;
                        var leftpos = width / 2 - 350;
                        var toppos = height / 2 - 350;
                        //totCount = 기관/내부에서 선택 변경이 일어났을때 edit_dept_list 에 onload를 제어하기 위한 변수 (기존 부서 정보 호출여부)
                        if (totCount == 0) {
                            var urlname = "/totsys/common/web/report_dept/edit_dept_list2.jsp?section=1&docID=<%=docID%>";
                        } else {
                            var urlname = "/totsys/common/web/report_dept/edit_dept_list2.jsp?section=1&docID=<%=docID%>&totCount=1";
                        }
                        post = window.open(urlname, "post", "width=900, height=600, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + leftpos + ",top=" + toppos);
                        post.focus();
                    }

                    function inputText() {
                        window.open('/totsys/totper/mydocbox/regbox/popup_input_form.jsp?docID=<%= docID%>', 'makepoll', 'width=870,height=550,scrollbars=yes,resizable=yes');
                    }
                    //ie10,11 호환성 기본정보 표 줄 색 통일
                    $('.kecttep_list_table td').css('border-bottom','1px solid #eee');
                </script>
        </td>
    </tr>
<!--</form>-->
    <tr><td>&nbsp;</td></tr>
    <tr>
        <td colspan="4" class="center">
            <table style="height: 35px;">
                <tr>
                    <% if (docType.equals("REG") || docType.equals("PRSS")) {%>
                    <td>
                        <!--// 저장 button -->
                        <a href="javascript:void(0);" onclick="dform.prss.value = '<%=docType%>';formSubmit('save');">
                            <img src="/totsys/common/images/bt_save.gif" alt="<%= MoumiConfig.getMessageBundle().getString("moumi.message.button_large.save")%>" />
                        </a>
                    <%}%>
                    <% if (!docType.equals("PRSS")) {
                    %>
                        <!--// 집계시작 button -->
                        <a href="javascript:void(0);" onclick="dform.prss.value = '<%= TotDocProcess.PRSS.name()%>';formSubmit('start');">
                            <img src="/totsys/common/images/bt_input_write.gif" alt="<%= MoumiConfig.getMessageBundle().getString("moumi.message.button_large.startNow")%>" />
                        </a>
                    <% }%>
                        <!--// 취소 button -->
                        <a href="<%=redirectURI%>">
                            <img src="/totsys/common/images/bt_cancle.gif" alt="<%= MoumiConfig.getMessageBundle().getString("moumi.message.button_large.cancel")%>" />
                        </a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr><td>&nbsp;</td></tr>
	<!-- 파일취합시 서식수정 안나오게 -->
    <%if(appendType!=TotDocAppendType.FILE){ %>
    <tr style="padding-top: 10px">
        <td colspan="4">
            <table>
                <tr>
                    <td style="width: 14px;"><img alt="글머리" src="/totsys/common/images/ico_3.gif"></td>
                    <td class="kecttep_title tal" style="padding-left: 5px;">
                        <%=TotDocProcess.FORM%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.info")%>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table>
        </td>
    </tr>


    <div id="formDiv" style="display: none; padding-left: 10; padding-top:20; width: <%=session.getAttribute("formWidth")%>; height: 0; overflow-x: auto; overflow-y: auto;">
    </div>
    <td id="container">
        <iframe	src="/totsys/common/web/documents/form_content_modify/form_content_modify_2.jsp?docID=<%=docID%>&gubun=form"
                name='subUpload' width="100%"  height="100%" marginwidth="0" marginheight="0" frameborder="no" onload="doresize(this);">
        </iframe>
        <!-- 다음단계 iframe -->
        <iframe id="nextifr" name="nextifr" src="about:blank" style="display: none;" width="100%"  height="100%" marginwidth="0" marginheight="0" frameborder="no" onload="doresize(this);"></iframe>
    </td>


<!--    <tr style="padding-top: 10px">
        <td colspan="4">
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <%--
                        <td style="width: 14"><img src="/totsys/common/images/ico_3.gif"></td>
                        <td class="kecttep_title" style="padding-left: 5; width: 115;"
                                align="left"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.input")%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.trick")%>/<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.relationDoc")%></td>
                        <td class="kecttep_div_show" align="left"><a href="#"
                                onClick="javascript:inputText();"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.view")%></a>
                        <td>&nbsp;</td>
                    --%>
                </tr>
                <tr>
                    <td height="3" colspan="4"></td>
                </tr>
            </table>
        </td>
    </tr>-->

    <%} %>

    <tr>
        <td colspan="4">
<!-- ie10,11 display:'none;' 스타일 에러 수정 -->
        <span id="list2" style="display:none;">
                <table class="kecttep_list_table" style="border: 1px;">
                    <!-- 제목 -->
                    <tr>
                        <td class="kecttep_tdmenu" style="width: 120px;height: 25px;">
                            <img alt="말머리" src="/totsys/common/images/reg_icon.gif" align="absmiddle"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.title")%>
                        </td>
                        <td class="kecttep_top_graytd center">
                            <input class=inputtxt style="width: 99%" name="title" value="<%=boardTitle%>">
                        </td>
                    </tr>

                    <!-- 파일첨부 ---->
					<tr>
                        <td class="kecttep_tdmenu" width="120px;">
                            <img alt="말머리" src="/totsys/common/images/reg_icon.gif" align="absmiddle"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.relationDoc")%>
                        </td>
                        <td class="kecttep_list_graytd">
                            <iframe src="/totsys/common/inc/board/doc/write_file_upload.jsp?boardGroupID=<%= Category.ID_TOT_DOC_COMMENT%>&execMode=init&docID=<%= docID%>"
                                    name='subUpload'
                                    width="100%"
                                    frameborder=0
                                    scrolling=no
                                    marginheight=0
                                    marginwidth=2
                                    height="45">
                            </iframe></td>
                    </tr>
                    <!-- 내용 -->
                    <tr>

                         <!--내용 간격 수정-->
                        <td colspan="2" style="height: 200px;"> <td colspan="2" style="height: 400px;">
                            <!-- 내용 간격 수정 끝 -->
                                <form name="gocomp0" action="/Mail-bin/send_mail.frame" method=post>
                                <input type="hidden" name=What value=0>
                                <input type="hidden" name=BODY>
                                <input type="hidden" name=CMD value=''>
                                <input type="hidden" name=MSGID value=''>
                                <input type="hidden" name=TO>
                                <input type="hidden" name=CC>
                                <input type="hidden" name=BCC>
                                <input type="hidden" name=SUBJECT>
                                <input type="hidden" name=XSUBJECT value=''>
                                <input type="hidden" name=PID value='11295'>
                            </form>
                            <form name=Mail_Form target=_parent method=post action="/Mail-bin/start_mail/simplehtml">
                                <input type="hidden" name=SENDACTION value="">
                                <input type="hidden" name=RESV_Y value="">
                                <input type="hidden" name=RESV_M value="">
                                <input type="hidden" name=RESV_D value="">
                                <input type="hidden" name=RESV_H value="">
                                <input type="hidden" name=ISLINEANS value="">
                                <input type="hidden" name=PID value="11295">
                                <input type="hidden" name=MSGID value=>
                                <input type="hidden" name=LINKURL value="">
                                <input type="hidden" name=LINKCOMMENT value="">
                                <input type="hidden" name=KEYWORD value="">
                                <input type="hidden" name=KEYTYPE value="">
                                <input type="hidden" name=FOLDER value="">
                                <input type="hidden" name=mpage value="">
                                <input type="hidden" name=UseCompose value="">
                                <SCRIPT LANGUAGE='javascript' src='/totsys/common/js/editor.js'></script>
                                <iframe
                                    id='i_fontcolor'
                                    style='background-color: #ffffff; border: 1px double #BFBFBF; cursor: hand; position: absolute; visibility: hidden;'
                                    scrolling=no
                                    frameborder=0
                                    width=120
                                    height=120>
                                </iframe>
                                <iframe
                                    id='i_backcolor'
                                    style='background-color: #ffffff; border: 1px double #BFBFBF; cursor: hand; position: absolute; visibility: hidden;'
                                    scrolling=no
                                    frameborder=0
                                    width=120
                                    height=120>
                                </iframe>
                                <iframe
                                    id='i_image'
                                    style='color: #000000; background-color: #efefef; border: 1px double #BFBFBF; cursor: default; position: absolute; visibility: hidden;'
                                    scrolling=no
                                    frameborder=0
                                    width=325
                                    height=85>
                                </iframe>
                                <iframe
                                    id='i_link'
                                    style='color: #000000; background-color: #efefef; border: 1px double #BFBFBF; cursor: default; position: absolute; visibility: hidden;'
                                    scrolling=no
                                    frameborder=0
                                    width=325
                                    height=70>
                                </iframe>
                                <iframe
                                    id='i_emoticon'
                                    style='background-color: #efefef; border: 1px double #BFBFBF; cursor: hand; position: absolute; visibility: hidden;'
                                    scrolling=no
                                    frameborder=0
                                    width=125
                                    height=125>
                                </iframe>

                                <div id='editctrl'  style='display: show; width: "*"; height: "*";'>
                                    <iframe
                                        name='EditCtrl'
                                        id="ifrm_EditCtrl"
                                        width='100%'
                                        height='100%'
                                        scrolling='YES'
                                        onfocus='layeroff();'
                                        onblur='nowkong.SaveSelection();'
                                        frameborder="0">
                                    </iframe>
                                </div>
                                <input type="hidden" name=FORSAVE
                                       value="&lt;HEAD&gt;
                                       &lt;STYLE&gt;
                                       P {margin-top:2px;margin-bottom:2px;}
                                       &lt;/STYLE&gt;
                                       &lt;/HEAD&gt;
                                       &lt;BODY oncontextmenu='return false;' style='background-color: ; background-image: url(); ' topmargin=11 leftmargin=11&gt;
                                       &lt;/BODY&gt;">
                                <input type="hidden" name=BODY value="">
                                <input type="hidden" name=BODYBG value="">
                                <input type="hidden" name=BODYBGC value="">
                            </form>
                            <script>
                                init();
                                insertForm();

                                <% if (docType.equals("PRSS")) {%>
                                var rdDeadLine = document.getElementById("rd<%= LimitByDeadlineStrategy.class.getSimpleName()%>");
                                var txEndDate = document.getElementById("ed<%= LimitByDeadlineStrategy.class.getSimpleName()%>");
                                //var lnDeadLine     = document.getElementById("ln<%= LimitByDeadlineStrategy.class.getSimpleName()%>");
                                var txEndTime = document.getElementById("edT<%= LimitByDeadlineStrategy.class.getSimpleName()%>");
                                var imgDate = document.getElementById("img<%= LimitByDeadlineStrategy.class.getSimpleName()%>");
                                var rdSubmitDate = document.getElementById("rd<%= LimitBySubmitDateStrategy.class.getSimpleName()%>");
                                var rdUnlimit = document.getElementById("rd<%= UnlimitStrategy.class.getSimpleName()%>");
                                <% if (strategy instanceof LimitByDeadlineStrategy) {%>
                                rdDeadLine.disabled = false;
                                txEndDate.readOnly = false;
                                //lnDeadLine.disabled = false;
                                txEndTime.readOnly = false;
                                imgDate.disabled = false;
                                rdSubmitDate.disabled = true;
                                rdUnlimit.disabled = true;
                                <%} else if (strategy instanceof LimitBySubmitDateStrategy) {%>
                                rdDeadLine.disabled = true;
                                txEndDate.readOnly = true;
                                //lnDeadLine.disabled = true;
                                txEndTime.readOnly = true;
                                imgDate.disabled = true;
                                rdSubmitDate.disabled = false;
                                rdUnlimit.disabled = true;
                                <%} else if (strategy instanceof UnlimitStrategy) {%>
                                rdDeadLine.disabled = true;
                                txEndDate.readOnly = true;
                                //lnDeadLine.disabled = true;
                                txEndTime.readOnly = true;
                                imgDate.disabled = true;
                                rdSubmitDate.disabled = true;
                                rdUnlimit.disabled = false;
                                <%}
                                                }%>

                            </script>
                </table>
            </span>
        </td>
    </tr>

<iframe name="hiddenIframe" width="0" height="0" style="display: none;"></iframe>
</body>
</html>
    <%
        } catch (Exception ex) {
            ex.printStackTrace();
            out.println(kr.co.kihyun.text.html.ServletUtil.getJavaScript("location='/servlet/kr.co.kihyun.beans.user.HttpSSOLogin?mode=logout';"));
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
            pm.close();
        }
    %>
