rosewiper 2023-12-08
선거문자 20건 신규 기능 1차 기능 개발 완료 - 화면 처리 기능 개발 - 전송 기능은 미개발
 - 화면 처리 기능 개발
 - 전송 기능은 미개발
@1eef366c59b1cb7af59cf53c0a0ec6dc5d8a9f1e
src/main/java/itn/let/mjo/msgcampain/service/MjonCandidateService.java
--- src/main/java/itn/let/mjo/msgcampain/service/MjonCandidateService.java
+++ src/main/java/itn/let/mjo/msgcampain/service/MjonCandidateService.java
@@ -1,19 +1,52 @@
 package itn.let.mjo.msgcampain.service;
 
+import java.util.List;
+
 public interface MjonCandidateService {
 
 	// 선거문자 후보자 정보 불러오기
-	public MjonCandidateVO selectCandidateDataInfo(String userId) throws Exception;
-	
-	// 선거문자 후보자 등록 처리
-	public int insertCandidateDataInfo(MjonCandidateVO mjonCandidateVO) throws Exception;
-	
-	// 선거문자 후보자 정보 수정
-	public int updateCandidateDataInfo(MjonCandidateVO mjonCandidateVO) throws Exception;
-	
-	// 선거문자 후보자 삭제 처리
-	public int deleteCandidateDataInfo(MjonCandidateVO mjonCandidateVO) throws Exception;
-	
-	// 선거문자 후보자 등록/수정시 회원정보 테이블 세금계산서 정보 수정해주기
-	public int updateTaxBillMemberInfo(MjonCandidateVO mjonCandidateVO) throws Exception;
+		public MjonCandidateVO selectCandidateDataInfo(String userId) throws Exception;
+		
+		// 선거문자 후보자 등록 처리
+		public int insertCandidateDataInfo(MjonCandidateVO mjonCandidateVO) throws Exception;
+		
+		// 선거문자 후보자 정보 수정
+		public int updateCandidateDataInfo(MjonCandidateVO mjonCandidateVO) throws Exception;
+		
+		// 선거문자 후보자 삭제 처리
+		public int deleteCandidateDataInfo(MjonCandidateVO mjonCandidateVO) throws Exception;
+		
+		// 선거문자 후보자 등록/수정시 회원정보 테이블 세금계산서 정보 수정해주기
+		public int updateTaxBillMemberInfo(MjonCandidateVO mjonCandidateVO) throws Exception;
+		
+		//선거문자 20건 발송 전체 수신목록 입력
+		public int insertCandidateTWCallToData(List<MjonCandidateTWVO> mjonCandidateTWVO) throws Exception;
+		
+		//선거문자 20건 기존 등록 수신목록 모두 취소 시키기
+		public int updateCandidateTWCallToDataCancel(String mberId) throws Exception;
+		
+		//선거문자 20건 회원 Call_seq 최대값 불러오기
+		public int selectCandidateTWMaxCallSeq(String mberId) throws Exception;
+		
+		//선거문자 20건 수신목록 20개 불러오기 페이징 처리
+		public List<?> selectCampainTWCalltoList(MjonCandidateTWVO mjonCandidateTWVO) throws Exception;
+		
+		//선거문자 20건 수신목록 초기화 기능 - 등록된 수신목록 send_flag를 C로 변경 처리함.
+		public int updateMsgTWCallToListResetByMberId(MjonCandidateTWVO mjonCandidateTWVO) throws Exception;
+		
+		//선거문자 20건 수신목록 선택 삭제기능
+		public int updateMsgTWCallToListChkDel(MjonCandidateTWVO mjonCandidateTWVO) throws Exception;
+		
+		//선거문자 20건 수신목록 건수 표시 정보 조회(전체건수, 발송완료 건수, 미방송 건수)
+		public MjonCandidateTWVO selectMsgTWCallToTotCount(MjonCandidateTWVO mjonCandidateTWVO) throws Exception;
+		
+		//선거문자 20건 받는사람 정보 단건추가 진행 - 번호추가 기능에서 사용
+		public int insertCandidateTWCallToDataOnlyAdd(MjonCandidateTWVO mjonCandidateTWVO) throws Exception;
+		
+		//선거문자 20건 중복연락처 조회 
+		public int selectCandidateTWCallToDupleCnt(MjonCandidateTWVO mjonCandidateTWVO) throws Exception;
+		
+		//선거문자 20건 마지막 번호 불러오기
+		public int selectMsgCallToSeqNum(String mberId) throws Exception;
+		
 }
 
src/main/java/itn/let/mjo/msgcampain/service/MjonCandidateTWVO.java (added)
+++ src/main/java/itn/let/mjo/msgcampain/service/MjonCandidateTWVO.java
@@ -0,0 +1,125 @@
+package itn.let.mjo.msgcampain.service;
+
+import java.util.List;
+
+import itn.let.uss.umt.service.UserDefaultVO;
+
+public class MjonCandidateTWVO extends UserDefaultVO{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1492279559142297416L;
+	
+	private int campainTmpId;
+	private List<Integer> campainTmpIdList;
+	private String mberId;
+	private int callSeq;
+	private String callTo;
+	private List<String> callToList;
+	private String[] callToArr;
+	private String sendFlag;
+	
+	private String frstRegisterId;
+	private String frstRegistPnttm;
+	private String lastUpdtPnttm;
+	private String lastUpdusrId;
+	
+	private int sendComplete;
+	private int sendReady;
+	private int totCallToCnt;
+	
+	public int getCampainTmpId() {
+		return campainTmpId;
+	}
+	public void setCampainTmpId(int campainTmpId) {
+		this.campainTmpId = campainTmpId;
+	}
+
+	public List<Integer> getCampainTmpIdList() {
+		return campainTmpIdList;
+	}
+	public void setCampainTmpIdList(List<Integer> campainTmpIdList) {
+		this.campainTmpIdList = campainTmpIdList;
+	}
+	public String getMberId() {
+		return mberId;
+	}
+	public void setMberId(String mberId) {
+		this.mberId = mberId;
+	}
+	public int getCallSeq() {
+		return callSeq;
+	}
+	public void setCallSeq(int callSeq) {
+		this.callSeq = callSeq;
+	}
+	public String getCallTo() {
+		return callTo;
+	}
+	public void setCallTo(String callTo) {
+		this.callTo = callTo;
+	}
+	public List<String> getCallToList() {
+		return callToList;
+	}
+	public void setCallToList(List<String> callToList) {
+		this.callToList = callToList;
+	}
+	public String[] getCallToArr() {
+		return callToArr;
+	}
+	public void setCallToArr(String[] callToArr) {
+		this.callToArr = callToArr;
+	}
+	public String getSendFlag() {
+		return sendFlag;
+	}
+	public void setSendFlag(String sendFlag) {
+		this.sendFlag = sendFlag;
+	}
+	public String getFrstRegisterId() {
+		return frstRegisterId;
+	}
+	public void setFrstRegisterId(String frstRegisterId) {
+		this.frstRegisterId = frstRegisterId;
+	}
+	public String getFrstRegistPnttm() {
+		return frstRegistPnttm;
+	}
+	public void setFrstRegistPnttm(String frstRegistPnttm) {
+		this.frstRegistPnttm = frstRegistPnttm;
+	}
+	public String getLastUpdtPnttm() {
+		return lastUpdtPnttm;
+	}
+	public void setLastUpdtPnttm(String lastUpdtPnttm) {
+		this.lastUpdtPnttm = lastUpdtPnttm;
+	}
+	public String getLastUpdusrId() {
+		return lastUpdusrId;
+	}
+	public void setLastUpdusrId(String lastUpdusrId) {
+		this.lastUpdusrId = lastUpdusrId;
+	}
+	public int getSendComplete() {
+		return sendComplete;
+	}
+	public void setSendComplete(int sendComplete) {
+		this.sendComplete = sendComplete;
+	}
+	public int getSendReady() {
+		return sendReady;
+	}
+	public void setSendReady(int sendReady) {
+		this.sendReady = sendReady;
+	}
+	public int getTotCallToCnt() {
+		return totCallToCnt;
+	}
+	public void setTotCallToCnt(int totCallToCnt) {
+		this.totCallToCnt = totCallToCnt;
+	}
+
+	
+}
src/main/java/itn/let/mjo/msgcampain/service/impl/MjonCandidateDAO.java
--- src/main/java/itn/let/mjo/msgcampain/service/impl/MjonCandidateDAO.java
+++ src/main/java/itn/let/mjo/msgcampain/service/impl/MjonCandidateDAO.java
@@ -1,15 +1,19 @@
 package itn.let.mjo.msgcampain.service.impl;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.springframework.stereotype.Repository;
 
 import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
+import itn.let.mjo.msgcampain.service.MjonCandidateTWVO;
 import itn.let.mjo.msgcampain.service.MjonCandidateVO;
 
 @Repository("mjonCandidateDAO")
 public class MjonCandidateDAO  extends EgovAbstractDAO {
 
 	public MjonCandidateVO selectCandidateDataInfo(String userId) throws Exception{
-	
+		
 		return (MjonCandidateVO) select("mjonCandidateDAO.selectCandidateDataInfo", userId);
 	}
 	
@@ -33,4 +37,140 @@
 		
 		return update("mjonCandidateDAO.updateTaxBillMemberInfo", mjonCandidateVO);
 	}
+	
+	//선거문자 20건 발송 전체 수신목록 입력
+	public int insertCandidateTWCallToData(List<MjonCandidateTWVO> mjonCandidateTWVO) throws Exception{
+		return update("mjonCandidateDAO.insertCandidateTWCallToData", mjonCandidateTWVO);
+	}
+	
+	public int updateCandidateTWCallToDataCancel(String mberId) throws Exception{
+		
+		return update("mjonCandidateDAO.updateCandidateTWCallToDataCancel", mberId);
+		
+	}
+	
+	//선거문자 20건 회원 Call_seq 최대값 불러오기
+	public int selectCandidateTWMaxCallSeq(String mberId) throws Exception{
+		return (int) select("mjonCandidateDAO.selectCandidateTWMaxCallSeq",mberId);
+	}
+	
+	//선거문자 20건 수신목록 20개 불러오기 페이징 처리
+	@SuppressWarnings("unchecked")
+	public List<?> selectCampainTWCalltoList(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		return (List<?>) list("mjonCandidateDAO.selectCampainTWCalltoList", mjonCandidateTWVO);
+		
+	}
+	
+	//선거문자 20건 수신목록 초기화 기능 - 등록된 수신목록 send_flag를 C로 변경 처리함.
+	public int updateMsgTWCallToListResetByMberId(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		int resultCnt = 0;
+		
+		try {
+			
+			resultCnt = update("mjonCandidateDAO.updateMsgTWCallToListResetByMberId", mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("updateMsgTWCallToListResetByMberId DAO Error!!! " + e);
+		}
+		
+		return resultCnt;
+	}
+	
+	//선거문자 20건 수신목록 선택 삭제기능
+	public int updateMsgTWCallToListChkDel(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		int resultCnt = 0;
+		
+		try {
+			
+			List<Integer> campainTmpIdList = new ArrayList<Integer>();
+			List<Integer> cmpTmpIdList = new ArrayList<Integer>();
+			
+			for(String id : mjonCandidateTWVO.getCallToArr()) {
+				
+				campainTmpIdList.add(Integer.parseInt(id));
+				
+			}
+			
+			mjonCandidateTWVO.setCampainTmpIdList(campainTmpIdList);
+			
+			resultCnt = update("mjonCandidateDAO.updateMsgTWCallToListChkDel", mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("updateMsgTWCallToListChkDel DAO Error!!! " + e);
+		}
+		
+		return resultCnt;
+		
+	}
+	
+	
+	//선거문자 20건 수신목록 건수 표시 정보 조회(전체건수, 발송완료 건수, 미방송 건수)
+	public MjonCandidateTWVO selectMsgTWCallToTotCount(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		MjonCandidateTWVO result = new MjonCandidateTWVO();
+		
+		try {
+			
+			result = (MjonCandidateTWVO) select("mjonCandidateDAO.selectMsgTWCallToTotCount", mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("selectMsgTWCallToTotCount DAO Error!!! " + e);
+		}
+		
+		return result;
+		
+	}
+	
+	//선거문자 20건 받는사람 정보 단건추가 진행 - 번호추가 기능에서 사용
+	public int insertCandidateTWCallToDataOnlyAdd(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		int resultCnt = 0;
+		
+		try {
+			
+			resultCnt = update("mjonCandidateDAO.insertCandidateTWCallToDataOnlyAdd", mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("insertCandidateTWCallToDataOnlyAdd DAO Error!!! " + e);
+		}
+		
+		return resultCnt;
+		
+	}
+	
+	//선거문자 20건 중복연락처 조회 
+	public int selectCandidateTWCallToDupleCnt(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		int resultCnt = 0;
+		
+		try {
+			
+			resultCnt = (int) select("mjonCandidateDAO.selectCandidateTWCallToDupleCnt", mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("selectCandidateTWCallToDupleCnt DAO Error!!! " + e);
+		}
+		
+		return resultCnt;
+		
+	}
+	
+	//선거문자 20건 callSeq 번호 불러오기
+	public int selectMsgCallToSeqNum(String mberId) throws Exception{
+		
+		int resultNum = 0;
+		
+		try {
+			
+			resultNum = (int) select("mjonCandidateDAO.selectMsgCallToSeqNum", mberId);
+			
+		} catch (Exception e) {
+			System.out.println("selectMsgCallToSeqNum Service DAO Error!!! " + e);
+		}
+		
+		return resultNum;
+		
+	}
 }
src/main/java/itn/let/mjo/msgcampain/service/impl/MjonCandidateServiceImpl.java
--- src/main/java/itn/let/mjo/msgcampain/service/impl/MjonCandidateServiceImpl.java
+++ src/main/java/itn/let/mjo/msgcampain/service/impl/MjonCandidateServiceImpl.java
@@ -1,11 +1,15 @@
 package itn.let.mjo.msgcampain.service.impl;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.annotation.Resource;
 
 import org.springframework.stereotype.Service;
 
 import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
 import itn.let.mjo.msgcampain.service.MjonCandidateService;
+import itn.let.mjo.msgcampain.service.MjonCandidateTWVO;
 import itn.let.mjo.msgcampain.service.MjonCandidateVO;
 
 @Service("mjonCandidateService")
@@ -38,4 +42,172 @@
 	public int updateTaxBillMemberInfo(MjonCandidateVO mjonCandidateVO) throws Exception{
 		return mjonCandidateDAO.updateTaxBillMemberInfo(mjonCandidateVO);
 	}
+	
+	//선거문자 20건 발송 전체 수신목록 입력
+	public int insertCandidateTWCallToData(List<MjonCandidateTWVO> mjonCandidateTWVO) throws Exception{
+		
+		int resultCnt = 0;
+		
+		try {
+			
+			//기존에 저장된 회원의 미전송된 모든 데이터의 SEND_FLAG를 취소 처리함(값을 C 로변경)
+			String mberId = mjonCandidateTWVO.get(0).getMberId();
+			mjonCandidateDAO.updateCandidateTWCallToDataCancel(mberId);
+			
+			resultCnt = mjonCandidateDAO.insertCandidateTWCallToData(mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("insertCandidateTWCallToData Service Imple Error!!! " + e);
+		}
+		
+		return resultCnt;
+	}
+	
+	//선거문자 20건 기존 등록 수신목록 모두 취소 시키기
+	public int updateCandidateTWCallToDataCancel(String mberId) throws Exception{
+		
+		int resultCnt = 0;
+		
+		try {
+			
+			resultCnt = mjonCandidateDAO.updateCandidateTWCallToDataCancel(mberId);
+			
+		} catch (Exception e) {
+			System.out.println("updateCandidateTWCallToDataCancel Service Imple Error!!! " + e);
+		}
+		
+		return resultCnt;
+		
+	}
+	
+	//선거문자 20건 회원 Call_seq 최대값 불러오기
+	public int selectCandidateTWMaxCallSeq(String mberId) throws Exception{
+		
+		int resultCnt = 0;
+		
+		try {
+			
+			resultCnt = mjonCandidateDAO.selectCandidateTWMaxCallSeq(mberId);
+			
+		} catch (Exception e) {
+			System.out.println("selectCandidateTWMaxCallSeq Service Imple Error!!! " + e);
+		}
+		
+		return resultCnt;
+	}
+	
+	//선거문자 20건 수신목록 20개 불러오기 페이징 처리
+	public List<?> selectCampainTWCalltoList(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		List<?> resultList = new ArrayList<>();
+		
+		try {
+			
+			resultList = mjonCandidateDAO.selectCampainTWCalltoList(mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("selectCampainTWCalltoList Service Imple Error!!! " + e);
+		}
+		
+		return resultList;
+	}
+	
+	//선거문자 20건 수신목록 초기화 기능 - 등록된 수신목록 send_flag를 C로 변경 처리함.
+	public int updateMsgTWCallToListResetByMberId(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		int resultCnt = 0;
+		
+		try {
+			
+			resultCnt = mjonCandidateDAO.updateMsgTWCallToListResetByMberId(mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("updateMsgTWCallToListResetByMberId Service Imple Error!!! " + e);
+		}
+		
+		return resultCnt;
+	}
+	
+	
+	//선거문자 20건 수신목록 선택 삭제기능
+	public int updateMsgTWCallToListChkDel(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		int resultCnt = 0;
+		
+		try {
+			
+			resultCnt = mjonCandidateDAO.updateMsgTWCallToListChkDel(mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("updateMsgTWCallToListChkDel Service Imple Error!!! " + e);
+		}
+		
+		return resultCnt;
+		
+	}
+	
+	//선거문자 20건 수신목록 건수 표시 정보 조회(전체건수, 발송완료 건수, 미방송 건수)
+	public MjonCandidateTWVO selectMsgTWCallToTotCount(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		MjonCandidateTWVO result = new MjonCandidateTWVO();
+		
+		try {
+			
+			result = mjonCandidateDAO.selectMsgTWCallToTotCount(mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("selectMsgTWCallToTotCount Service Imple Error!!! " + e);
+		}
+		
+		return result;
+	}
+	
+	//선거문자 20건 받는사람 정보 단건추가 진행 - 번호추가 기능에서 사용
+	public int insertCandidateTWCallToDataOnlyAdd(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		int resultCnt = 0;
+		
+		try {
+			
+			resultCnt = mjonCandidateDAO.insertCandidateTWCallToDataOnlyAdd(mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("insertCandidateTWCallToDataOnlyAdd Service Imple Error!!! " + e);
+		}
+		
+		return resultCnt;
+	}
+	
+	//선거문자 20건 중복연락처 조회 
+	public int selectCandidateTWCallToDupleCnt(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		int resultCnt = 0;
+		
+		try {
+			
+			resultCnt = mjonCandidateDAO.selectCandidateTWCallToDupleCnt(mjonCandidateTWVO);
+			
+		} catch (Exception e) {
+			System.out.println("selectCandidateTWCallToDupleCnt Service Imple Error!!! " + e);
+		}
+		
+		return resultCnt;
+		
+	}
+	
+	//선거문자 20건 callSeq 번호 불러오기
+	public int selectMsgCallToSeqNum(String mberId) throws Exception{
+		
+		int resultNum = 0;
+		
+		try {
+			
+			resultNum = mjonCandidateDAO.selectMsgCallToSeqNum(mberId);
+			
+		} catch (Exception e) {
+			System.out.println("selectCandidateTWCallToDupleCnt Service Imple Error!!! " + e);
+		}
+		
+		return resultNum;
+		
+	}
 }
 
src/main/java/itn/let/mjo/msgcampain/web/MjonMsgCampainTWDataController.java (added)
+++ src/main/java/itn/let/mjo/msgcampain/web/MjonMsgCampainTWDataController.java
@@ -0,0 +1,1368 @@
+package itn.let.mjo.msgcampain.web;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.openxml4j.opc.OPCPackage;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import egovframework.rte.fdl.idgnr.EgovIdGnrService;
+import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
+import egovframework.rte.psl.dataaccess.util.EgovMap;
+import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
+import itn.com.cmm.ComDefaultCodeVO;
+import itn.com.cmm.EgovMessageSource;
+import itn.com.cmm.JsonResult;
+import itn.com.cmm.LoginVO;
+import itn.com.cmm.service.EgovCmmUseService;
+import itn.com.cmm.service.EgovFileMngService;
+import itn.com.cmm.service.EgovFileMngUtil;
+import itn.com.cmm.util.MJUtil;
+import itn.com.cmm.util.RedirectUrlMaker;
+import itn.com.cmm.util.StringUtil;
+import itn.com.utl.fcc.service.EgovStringUtil;
+import itn.let.lett.service.HashConfVO;
+import itn.let.lett.service.LetterService;
+import itn.let.lett.service.LetterVO;
+import itn.let.mjo.addr.service.AddrGroupService;
+import itn.let.mjo.addr.service.AddrService;
+import itn.let.mjo.addr.service.AddrVO;
+import itn.let.mjo.event.service.MjonEventService;
+import itn.let.mjo.event.service.MjonEventVO;
+import itn.let.mjo.msg.service.MjonMsgService;
+import itn.let.mjo.msgcampain.service.MjonCandidateService;
+import itn.let.mjo.msgcampain.service.MjonCandidateTWVO;
+import itn.let.mjo.msgcampain.service.MjonCandidateVO;
+import itn.let.mjo.msgdata.service.MjonMsgDataService;
+import itn.let.mjo.msgdata.service.MjonMsgDataVO;
+import itn.let.mjo.msgdata.service.PhoneVO;
+import itn.let.mjo.pay.service.MjonPayService;
+import itn.let.mjo.spammsg.service.MjonSpamMsgService;
+import itn.let.mjo.symbol.service.MjonSymbolService;
+import itn.let.mjo.symbol.service.MjonSymbolVO;
+import itn.let.sym.ccm.cde.service.CateCode;
+import itn.let.sym.ccm.cde.service.EgovCcmCmmnDetailCodeManageService;
+import itn.let.sym.grd.service.MberGrdService;
+import itn.let.sym.site.service.EgovSiteManagerService;
+import itn.let.sym.site.service.JoinSettingVO;
+import itn.let.uss.umt.service.EgovMberManageService;
+import itn.let.uss.umt.service.EgovUserManageService;
+import itn.let.uss.umt.service.MberManageVO;
+import itn.let.utl.fcc.service.EgovCryptoUtil;
+
+@Controller
+public class MjonMsgCampainTWDataController {
+
+	@Resource(name = "mjonMsgService")
+    private MjonMsgService mjonMsgService;
+	
+	@Resource(name = "mjonPayService")
+    private MjonPayService mjonPayService;
+	
+	@Resource(name = "MjonMsgDataService")
+    private MjonMsgDataService mjonMsgDataService;
+	
+	@Resource(name = "LetterService")
+    private LetterService letterService;
+	
+	@Resource(name = "mjonSymbolService")
+	private MjonSymbolService mjonSymbolService;
+	
+	/** mberManageService */
+	@Resource(name = "mberManageService")
+	private EgovMberManageService mberManageService;
+	
+	@Resource (name = "AddrService")
+	private AddrService addrService;
+	
+	@Resource (name = "AddrGroupService")
+	private AddrGroupService addrGroupService;
+	
+	@Resource(name = "mjonCandidateService")
+    private MjonCandidateService mjonCandidateService;
+	
+	@Resource(name = "EgovCmmUseService")
+	private EgovCmmUseService cmmUseService;
+	
+	/** EgovMessageSource */
+    @Resource(name="egovMessageSource")
+    EgovMessageSource egovMessageSource;
+    
+    @Resource(name="EgovFileMngUtil")
+	private EgovFileMngUtil fileUtil;
+    
+    @Resource(name="EgovFileMngService")
+    private EgovFileMngService fileMngService;
+    
+    /* 암복호화 */
+	@Resource(name = "egovCryptoUtil")
+	EgovCryptoUtil egovCryptoUtil;
+	
+    @Resource(name = "egovMjonMsgGroupIdGnrService")
+    private EgovIdGnrService idgenMjonMsgGroupId;
+    
+	@Resource(name = "egovMjonCashIdGnrService")
+    private EgovIdGnrService idgenMjonCashId;
+	
+	@Resource(name = "CmmnDetailCodeManageService")
+    private EgovCcmCmmnDetailCodeManageService cmmnDetailCodeManageService;
+	
+	/** 첨부파일 저장경로 */
+	@Value("#{globalSettings['Globals.file.saveDir']}")
+	private String fileSaveDir;
+    
+	/** userManageService */
+	@Resource(name = "userManageService")
+	private EgovUserManageService userManageService;
+	
+	@Resource(name = "MjonEventService")
+    private MjonEventService mjonEventService;
+	
+	@Resource(name = "mjonSpamMsgService")
+    private MjonSpamMsgService mjonSpamMsgService;
+    
+	/** 사이트 설정 */ 
+	@Resource(name = "egovSiteManagerService")
+	EgovSiteManagerService egovSiteManagerService;
+	
+	/** 등급제 관리 서비스 */
+	@Resource(name = "mberGrdService")
+	MberGrdService mberGrdService;
+	
+    /**
+     * 선거 문자 20건씩 발송 화면 
+     * @param searchVO
+     * @param model
+     * @return	"/web/mjon/msgcampain/selectMsgTWDataView.do"
+     * @throws Exception
+     */
+	@RequestMapping(value= {"/web/mjon/msgcampain/selectMsgTWDataView.do"})
+	public String selectMsgTWDataView(@ModelAttribute("searchVO") MjonMsgDataVO searchVO
+			, CateCode cateCode
+			, HttpServletRequest request
+			, ModelMap model) throws Exception{
+		
+		String categoryType = cateCode.getCateType();
+		
+		if(categoryType == null) {
+			
+			categoryType = "N";
+			
+		}
+		
+		// 문자 카테고리 리스트 불러오기
+		List<CateCode> cateConfList = letterService.selectCateConfWithList(categoryType);
+		model.addAttribute("cateCodeList", cateConfList);	
+		
+		// 문자 해쉬태그 리스트 불러오기
+		String msgType = "M";
+		List<HashConfVO> hashTagList = letterService.selectHashTagWithList(msgType);
+		model.addAttribute("hashTagList", hashTagList);
+		
+		// 문자 리스트 불러오기
+		LetterVO letterVO = new LetterVO();
+		if(letterVO.getPageUnit() != 10) {
+			letterVO.setPageUnit(letterVO.getPageUnit());
+		}
+		
+		//로그인 권한정보 불러오기
+		LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
+		model.addAttribute("loginVO", loginVO);
+		
+		for(int i=0 ; i < cateConfList.size(); i++) {
+			if("선거".equals(cateConfList.get(i).getCateNm())) {
+				letterVO.setCategoryCode(cateConfList.get(i).getCateCode());
+			}
+		}
+		
+		//주소록에서 선택시 넘어오는 파라미터
+		if("Y".equals(searchVO.getMoveAddrFlag())) {
+			model.addAttribute("addrVO", searchVO);
+		}
+		
+		//주소록에서 선택시 넘어오는 파라미터
+		if("Y".equals(searchVO.getMoveAddrAllFlag())) {
+			AddrVO addrVO = new AddrVO();
+			
+			String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
+			if(userId != "") {
+				addrVO.setMberId(userId);
+			} 
+			addrVO.setRecordCountPerPage(100000);
+			addrVO.setFirstIndex(0);
+			addrVO.setSearchAddrGrpId(request.getParameter("searchAddrGrpId"));
+			addrVO.setSearchCondition(request.getParameter("searchCondition"));
+			addrVO.setSearchKeyword(request.getParameter("searchKeyword"));	
+			addrVO.setStartKeyword(request.getParameter("startKeyword"));
+			List<AddrVO> addrList = addrService.selectAddrList(addrVO);
+			
+			List<String> addrIdList = new ArrayList<String>();
+			for(AddrVO item : addrList) {
+				addrIdList.add(item.getAddrId());
+			}
+			
+			searchVO.setAddrIdList(addrIdList);
+			searchVO.setMoveAddrFlag("Y");
+			
+			model.addAttribute("addrVO", searchVO);
+		}				
+		
+		/** pageing */
+		PaginationInfo paginationInfo = new PaginationInfo();
+		paginationInfo.setCurrentPageNo(letterVO.getPageIndex());
+		paginationInfo.setRecordCountPerPage(letterVO.getPageUnit());
+		paginationInfo.setPageSize(letterVO.getPageSize());
+
+		letterVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
+		letterVO.setLastIndex(paginationInfo.getLastRecordIndex());
+		letterVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
+		
+		
+		List<?> resultPhoList = mjonMsgDataService.selectPhotoLetterList(letterVO);
+		
+		model.addAttribute("resultPhoList", resultPhoList);
+		paginationInfo.setTotalRecordCount( resultPhoList.size()> 0 ? ((Long)((EgovMap)resultPhoList.get(0)).get("totCnt")).intValue() : 0);
+		model.addAttribute("paginationInfo", paginationInfo);
+		
+		//발송결과 문자 재전송에서 넘어오는 경우 파마리터 전달
+		List<String> temp = searchVO.getMsgSeqList();
+		
+		if(temp != null) {
+			
+			model.addAttribute("reSendMsgVO", searchVO);
+			
+		}
+		model.addAttribute("letterVO", letterVO);
+		
+		// 문자 재전송 New
+		model.addAttribute("msgResendAllFlag", searchVO.getMsgResendAllFlag());
+		model.addAttribute("msgResendAllGroupId", searchVO.getMsgResendAllGroupId());
+		model.addAttribute("msgResendAllAdvertiseYn", searchVO.getMsgResendAllAdvertiseYn());
+		model.addAttribute("msgResendAllReplaceYn", searchVO.getMsgResendAllReplaceYn());
+		
+		return "web/msgcampain/tw/MsgTWDataView";
+	}
+	
+	 /**
+     * 선거 문자 20건씩 발송 단문/장문/그림문자 전송 화면 
+     * @param searchVO
+     * @param model
+     * @return	"/web/mjon/msgcampain/selectMsgTWDataSMLViewAjax.do"
+     * @throws Exception
+     */
+	@RequestMapping(value= {"/web/mjon/msgcampain/selectMsgTWDataSMLViewAjax.do"})
+	public String selectMsgTWDataSMLView(@ModelAttribute("searchVO") MjonMsgDataVO searchVO, CateCode cateCode, ModelMap model) throws Exception{
+		
+		//로그인 권한정보 불러오기
+    	LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
+    	String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
+    	String author = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getAuthority());
+    	
+		String categoryType = cateCode.getCateType();
+		
+		if(categoryType == null) {
+			
+			categoryType = "N";
+			
+		}
+		
+		//문자 전송 개인 단가 불러오기
+		
+		//0.이벤트 진행중이 회원 정보 불러오기.
+		//이벤트 회원 정보 테이블에서 대상자의 정보를 불러온다.
+		MjonEventVO mjonEventVO = new MjonEventVO();
+		mjonEventVO.setMberId(userId);
+		MjonEventVO eventMberInfo = mjonEventService.selectEventMsgMberDefaultInfo(mjonEventVO);
+		
+		
+		long eventDiffDate = 0;
+		float eventRemainCash = 0;
+		boolean compareEndDate = false;
+		
+		if(eventMberInfo != null) {
+			
+			String eventEndDate = eventMberInfo.getEventEndDate();
+			
+			/**
+			 * MJUtil.getCompareDate()
+			 * 현재 날짜와 파라미터 전달 날짜를 비교
+			 * 전달날짜를 지난경우 False를 리턴함.
+			 * 현재날짜 이전 혹은 같은 날짜면 True를 리턴함.
+			 * 
+			 * */
+			
+			if(eventEndDate != null) {
+				compareEndDate = MJUtil.getCompareDate(eventEndDate);
+				eventRemainCash = (float) eventMberInfo.getEventRemainCash(); 
+				
+				//이벤트 종료 일자가 지난 경우, 이벤트 상태가 종료아 아니면 종료 처리 시킴
+				//이벤트 남은 캐시가 단문 발송금액 7.5원 보다 낮으면 이벤트 종료 시킴
+				if(!compareEndDate || eventRemainCash < 7.5) {
+					
+					if(!eventMberInfo.getEventStatus().equals("E")) {
+						
+						//이벤트 상태값을 종료로 변경한다.
+						mjonEventVO.setEventInfoId(eventMberInfo.getEventInfoId());
+						mjonEventVO.setEventStatus("E");
+						mjonEventVO.setEventMemo("이벤트 발송 최소 금액(7.5) 부족 혹은 이벤트 종료일 초과되어 이벤트 종료 시킴");
+						mjonEventVO.setEventRemainCash(eventRemainCash);
+						mjonEventService.updateEventEndStatus(mjonEventVO);
+						eventMberInfo.setEventStatus("E");
+						
+					}
+					
+				}else {//이벤트 진행중이면 남은 날짜 계산해서 전달.
+					
+					/**
+					 * MJUtil.getDiffDateDay()
+					 * 현재 날짜와 파라미터 날짜 사이의 날짜 수를 계산해줌.
+					 * 
+					 * */
+					eventDiffDate = MJUtil.getDiffDateDay(eventEndDate);
+					
+				}
+			}
+			
+		}
+		
+		//남은 날짜값을 절대값으로 변경(음수로 나오기 때문)
+		model.addAttribute("eventDiffDate", Math.abs(eventDiffDate));
+		model.addAttribute("compareEndDate", compareEndDate);
+		model.addAttribute("eventRemainCash", eventRemainCash);
+		model.addAttribute("eventMberInfo", eventMberInfo);
+		
+		//1.시스템 기본 단가 정보 불러오기
+		JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo();
+		
+		// 등급제 단가 추출 => 시스템 단가에 적용
+		sysJoinSetVO = mberGrdService.selectMberGrdDefaultInfo(sysJoinSetVO, userId);
+		
+		//2.사용자 개인 단가 정보 불러오기
+		MberManageVO mberManageVO = new MberManageVO(); 
+		
+		if(!userId.equals("") && !author.equals("ROLE_ADMIN")) {
+			
+			mberManageVO = mjonMsgDataService.selectMberManageInfo(userId);
+			searchVO.setUserId(userId);
+			
+		}
+		
+		model.addAttribute("exceptSpamYn", mberManageVO.getExceptSpamYn());
+		
+		//3.사용자 개인단가 정보가 0이 아니면 개인단가 사용, 없으면 시스템 기본 단가 사용
+		Float shortPrice = mberManageVO.getShortPrice();
+		Float longPrice = mberManageVO.getLongPrice();
+		Float picturePrice = mberManageVO.getPicturePrice();
+		Float picture2Price = mberManageVO.getPicture2Price();
+		Float picture3Price = mberManageVO.getPicture3Price();
+		BigDecimal userMoney = new BigDecimal(mberManageVO.getUserMoney()).setScale(2, RoundingMode.HALF_EVEN);
+		
+		//일반 단가정보 저장 변수 셋팅 - 이벤트 캐시 부족시 일반단가로 계산하기 위해서임.20230328, 우영두추가
+		Float norShortPrice = mberManageVO.getShortPrice();
+		Float norLongPrice = mberManageVO.getLongPrice();
+		Float norPicturePrice = mberManageVO.getPicturePrice();
+		Float norPicture2Price = mberManageVO.getPicture2Price();
+		Float norPicture3Price = mberManageVO.getPicture3Price();
+		
+		//기존 소수점 2째자리에서 반올림하였으나, 정책 변경으로 소수점 버림 처리함 20220623 
+		/*int shortPrice = (int) mberManageVO.getShortPrice();
+		int longPrice = (int) mberManageVO.getLongPrice();
+		int picturePrice = (int) mberManageVO.getPicturePrice();
+		int picture2Price = (int) mberManageVO.getPicture2Price();
+		int picture3Price = (int) mberManageVO.getPicture3Price();
+		int userMoney = (int) mberManageVO.getUserMoney();*/
+		
+		String userPoint = mberManageVO.getUserPoint();
+		
+		//이벤트 진행 회원의 발송 단가 처리해주기
+		if(eventMberInfo != null && eventMberInfo.getEventStatus().equals("Y") && compareEndDate) {
+			
+			shortPrice = Float.parseFloat(eventMberInfo.getEventShortPrice());
+			longPrice = Float.parseFloat(eventMberInfo.getEventLongPrice());
+			picturePrice = Float.parseFloat(eventMberInfo.getEventPicturePrice());
+			picture2Price = Float.parseFloat(eventMberInfo.getEventPicture2Price());
+			picture3Price = Float.parseFloat(eventMberInfo.getEventPicture3Price());
+			
+			//이벤트 캐시 부족시 일반단가로 계산하기 위해서임.20230328, 우영두추가
+			if(shortPrice < 1 || longPrice < 1 || picturePrice < 1) {//이벤트 단가 적용시 일반단가도 필요하여 셋팅 해줌.
+				
+				norShortPrice = (float) sysJoinSetVO.getShortPrice();
+				norLongPrice = (float) sysJoinSetVO.getLongPrice();
+				norPicturePrice = (float) sysJoinSetVO.getPicturePrice();
+				norPicture2Price = (float) sysJoinSetVO.getPicture2Price();
+				norPicture3Price = (float) sysJoinSetVO.getPicture3Price();
+				
+			}
+			
+		}else if(shortPrice < 1 || longPrice < 1 || picturePrice < 1) {
+			
+			shortPrice = (float) sysJoinSetVO.getShortPrice();
+			longPrice = (float) sysJoinSetVO.getLongPrice();
+			picturePrice = (float) sysJoinSetVO.getPicturePrice();
+			picture2Price = (float) sysJoinSetVO.getPicture2Price();
+			picture3Price = (float) sysJoinSetVO.getPicture3Price();
+			
+		}
+		
+		model.addAttribute("shortPrice", shortPrice);
+		model.addAttribute("longPrice", longPrice);
+		model.addAttribute("picturePrice", picturePrice);
+		model.addAttribute("picture2Price", picture2Price);
+		model.addAttribute("picture3Price", picture3Price);
+		model.addAttribute("userMoney", userMoney);
+		model.addAttribute("userPoint", userPoint);
+		
+		//이벤트 캐시 부족시 일반단가로 계산하기 위해서임.20230328, 우영두추가
+		if(norShortPrice < 1 || norLongPrice < 1 || norPicturePrice < 1) {//협의 단가가 없는 경우 일반단가에 시스템 단가로 셋팅해줌
+			
+			norShortPrice = (float) sysJoinSetVO.getShortPrice();
+			norLongPrice = (float) sysJoinSetVO.getLongPrice();
+			norPicturePrice = (float) sysJoinSetVO.getPicturePrice();
+			norPicture2Price = (float) sysJoinSetVO.getPicture2Price();
+			norPicture3Price = (float) sysJoinSetVO.getPicture3Price();
+			
+		}
+		
+		model.addAttribute("norShortPrice", norShortPrice);
+		model.addAttribute("norLongPrice", norLongPrice);
+		model.addAttribute("norPicturePrice", norPicturePrice);
+		model.addAttribute("norPicture2Price", norPicture2Price);
+		model.addAttribute("norPicture3Price", norPicture3Price);
+		
+		//선거 후보자 정보 불러오기
+		MjonCandidateVO mjonCandidateVO = new MjonCandidateVO();
+		
+		if(userId != ""){
+			
+			mjonCandidateVO = mjonCandidateService.selectCandidateDataInfo(userId);
+			
+			//String cryptText = egovCryptoUtil.encrypt(plainText);
+
+			if(mjonCandidateVO != null) {
+				
+				// 주민번호 복호화 하기
+				String regidentNo1 = egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo1());
+		    	String regidentNo2 = egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo2());
+		    	
+		    	mjonCandidateVO.setRegidentNo1(regidentNo1);
+		    	mjonCandidateVO.setRegidentNo2(regidentNo2);
+				
+			}
+			
+		}
+		
+		model.addAttribute("mjonCandidateVO", mjonCandidateVO);
+		
+		// 이메일 코드조회
+		ComDefaultCodeVO voComCode = new ComDefaultCodeVO();
+		voComCode.setCodeId("ITN031");
+		model.addAttribute("emailCode", cmmUseService.selectCmmCodeDetail(voComCode));
+		
+		if(!userId.equals("")) {//로그인 했을때만 발신번호 리스트 불러오기
+			
+			//아이디 발신번호 리스트 불러오기.
+			List<String> resultSendPhonList = mjonMsgDataService.selectSendPhonNumList(userId);
+			List<String> resultPhonList = new ArrayList<String>();
+			MJUtil mjUtil = new MJUtil();
+			
+			for(String phone : resultSendPhonList) {
+				
+				resultPhonList.add(mjUtil.addDash(phone));
+				
+			}
+			model.addAttribute("resultPhonList", resultPhonList);
+			
+		}
+		
+		// 문자 카테고리 리스트 불러오기
+		List<CateCode> cateConfList = letterService.selectCateConfWithList(categoryType);
+		model.addAttribute("cateCodeList", cateConfList);	
+		
+		//그림 문자 리스트 불러오기
+		LetterVO letterVO = new LetterVO();
+		if(letterVO.getPageUnit() != 10) {
+			letterVO.setPageUnit(letterVO.getPageUnit());
+		}
+		
+		MjonSymbolVO symbolVO = new MjonSymbolVO();
+		// 특수문자 리스트 불러오기
+		List<MjonSymbolVO> symbolList = mjonSymbolService.selectMjonSymbolList(symbolVO);
+		model.addAttribute("symbolList", symbolList);
+		
+		//최근 전송 내역
+		Calendar cal = Calendar.getInstance();
+    	Date now = new Date();
+    	
+    	SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
+    	
+    	cal.setTime(now);
+    	cal.add(Calendar.DATE, -3);
+    	
+    	String chkDate = format.format(cal.getTime());
+    	
+    	searchVO.setMyMsgStDt(chkDate);	//검색 시작일 저장 - 현재날짜로 부터 3일 이전 날짜로 시작
+		List<?> resultLatestMsgList = mjonMsgDataService.selectLatestMsgList(searchVO);
+		model.addAttribute("resultLatestMsgList", resultLatestMsgList);
+		
+		//자주보내는 번호
+		List<?> resultBookMarkMsgList = mjonMsgDataService.selectBookMarkMsgList(searchVO);
+		model.addAttribute("resultBookMarkMsgList", resultBookMarkMsgList);
+		
+
+		/** pageing */
+		PaginationInfo paginationInfo = new PaginationInfo();
+		paginationInfo.setCurrentPageNo(letterVO.getPageIndex());
+		paginationInfo.setRecordCountPerPage(letterVO.getPageUnit());
+		paginationInfo.setPageSize(letterVO.getPageSize());
+
+		letterVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
+		letterVO.setLastIndex(paginationInfo.getLastRecordIndex());
+		letterVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
+		
+		List<?> resultPhoList = mjonMsgDataService.selectPhotoLetterList(letterVO);
+		
+		model.addAttribute("resultPhoList", resultPhoList);
+		paginationInfo.setTotalRecordCount( resultPhoList.size()> 0 ? ((Long)((EgovMap)resultPhoList.get(0)).get("totCnt")).intValue() : 0);
+		model.addAttribute("paginationInfo", paginationInfo);
+		model.addAttribute("mberManageVO", mberManageVO);
+		
+		//기존 작업하던 수신목록 정보가 있는지 확인
+		int callSeq = mjonCandidateService.selectMsgCallToSeqNum(userId);
+		model.addAttribute("callSeq", callSeq);
+		
+		return "web/msgcampain/tw/MsgTWDataSMLView";
+	}
+	
+	//선거문자 20건 받는사람 목록 불러오기
+	@RequestMapping(value="/web/mjon/msgcampain/selectMsgTWCallToListAjax.do")
+	public String selectMsgTWCallToListAjax(MjonCandidateTWVO mjonCandidateTWVO, ModelMap model, RedirectAttributes redirectAttributes) throws Exception{
+		
+		
+		//로그인 권한정보 불러오기
+    	LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
+    	String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
+    	
+    	if(userId.equals("")) {
+    		
+    		redirectAttributes.addFlashAttribute("message", "로그인이 필요합니다.");
+			RedirectUrlMaker redirectUrlMaker = new RedirectUrlMaker("/web/user/login/login.do");
+			return redirectUrlMaker.getRedirectUrl();
+    		
+    	}
+		
+		/** pageing */
+		PaginationInfo paginationInfo = new PaginationInfo();
+		paginationInfo.setCurrentPageNo(mjonCandidateTWVO.getPageIndex());
+		paginationInfo.setRecordCountPerPage(mjonCandidateTWVO.getPageUnit());
+		paginationInfo.setPageSize(5);
+
+		mjonCandidateTWVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
+		mjonCandidateTWVO.setLastIndex(paginationInfo.getLastRecordIndex());
+		mjonCandidateTWVO.setRecordCountPerPage(20);
+		
+		mjonCandidateTWVO.setMberId(userId);
+		List<?> resultCallToList = mjonCandidateService.selectCampainTWCalltoList(mjonCandidateTWVO);
+		
+		model.addAttribute("resultCallToList", resultCallToList);
+		paginationInfo.setTotalRecordCount( resultCallToList.size()> 0 ? ((Long)((EgovMap)resultCallToList.get(0)).get("totCnt")).intValue() : 0);
+		model.addAttribute("paginationInfo", paginationInfo);
+		model.addAttribute("mjonCandidateTWVO", mjonCandidateTWVO);
+		
+		//전체 남은 리스트 수 및 전송완료 등 건수 정보 조회
+		MjonCandidateTWVO resultTotCallToInfo = mjonCandidateService.selectMsgTWCallToTotCount(mjonCandidateTWVO);
+		
+		model.addAttribute("resultTotCallToInfo", resultTotCallToInfo);
+		
+		return "web/msgcampain/tw/MsgTWDataCallToListView";
+	}
+	
+	
+	@RequestMapping(value="/web/mjon/msgcampain/insertMyAddrTWCallToAjax.do")
+	public ModelAndView insertMyAddrTWCallToAjax(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.setViewName("jsonView");
+		
+		//로그인 권한정보 불러오기
+    	LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
+    	String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
+
+    	if(userId.equals("")) {
+    		
+    		modelAndView.addObject("result", "loginFail");
+    		modelAndView.addObject("message", "로그인이 필요합니다.");
+    		return modelAndView;
+    		
+    	}
+    	try {
+			
+    		List<String> callToList = new ArrayList<String>();
+    		int totRowDataCnt = 0;
+    		
+    		for(String callTo : mjonCandidateTWVO.getCallToArr()) {
+    			
+    			System.out.println("++++++++++++++ callTo ::: "+callTo);
+    			callToList.add(callTo);
+    			totRowDataCnt++;
+    			
+    		}
+    		
+    		//수신자 목록 중복 체크 및 디비화 처리
+    		List<String> dupCallToList = MJUtil.getDuplicateList(callToList);
+    		
+    		String dupCallCnt = Integer.toString(totRowDataCnt - dupCallToList.size());
+    		
+    		//입력되어있는 데이터의 마지막 순번(call_seq)을 조회해 온다.
+    		int maxCallSeq = mjonCandidateService.selectCandidateTWMaxCallSeq(userId);
+    		maxCallSeq += 1;//마지막 순번에 1을 더해서 다음 순번을 지정해준다.
+    		
+    		List<MjonCandidateTWVO> mjonCandidateTwVO = new ArrayList<MjonCandidateTWVO>();
+    		
+    		for(String callTo : dupCallToList) {
+    			
+    			MjonCandidateTWVO tmpCandidateTwVO = new MjonCandidateTWVO();
+    			
+    			tmpCandidateTwVO.setMberId(userId);
+    			tmpCandidateTwVO.setCallTo(callTo);
+    			tmpCandidateTwVO.setFrstRegisterId(userId);
+    			tmpCandidateTwVO.setLastUpdusrId(userId);
+    			tmpCandidateTwVO.setCallSeq(maxCallSeq);
+    			
+    			mjonCandidateTwVO.add(tmpCandidateTwVO);
+    			
+    		}
+    		
+    		int resultCnt = mjonCandidateService.insertCandidateTWCallToData(mjonCandidateTwVO);
+    		
+    		if(resultCnt > 0) {
+    			
+    			modelAndView.addObject("result", "success");
+    			modelAndView.addObject("dupCallCnt", dupCallCnt);
+    			modelAndView.addObject("maxCallSeq", maxCallSeq);
+    			
+    		}else {
+    			
+    			modelAndView.addObject("result", "fail");
+        		modelAndView.addObject("message", "주소록을 불러오는 중 오류가 발생하였습니다. 잠시 후 다시 시도해 주세요.");
+    			
+    		}
+    		
+    		
+		} catch (Exception e) {
+			System.out.println("insertMyAddrTWCallToAjax Controller Error!!! " + e);
+			modelAndView.addObject("result", "fail");
+    		modelAndView.addObject("message", "주소록을 불러오는 중 오류가 발생하였습니다. 잠시 후 다시 시도해 주세요.");
+    		return modelAndView;
+		}
+		
+		return modelAndView;
+	}
+	
+	/*
+	 * 받는사람 목록 데이터 전체 초기화 처리
+	 * 데이터베이스에 저장된 해당 회원의 발신목록 정보를 모두 초기화 처리
+	 * */
+	@RequestMapping(value="/web/mjon/msgcampain/updateMsgTWCallToListResetAjax.do")
+	public ModelAndView updateMsgTWCallToListResetAjax(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.setViewName("jsonView");
+		
+		//로그인 권한정보 불러오기
+    	LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
+    	String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
+
+    	if(userId.equals("")) {
+    		
+    		modelAndView.addObject("result", "loginFail");
+    		modelAndView.addObject("message", "로그인이 필요합니다.");
+    		return modelAndView;
+    		
+    	}
+    	
+    	try {
+    		
+    		mjonCandidateTWVO.setMberId(userId);
+    		
+    		//수신목록 테이블에 있는 회원의 데이터를 모두 취소 처리해준다.
+    		int resultCnt = mjonCandidateService.updateCandidateTWCallToDataCancel(userId);
+    		
+    		if(resultCnt > 0) {
+    			
+    			modelAndView.addObject("result", "success");
+    			
+    		}else {
+    			
+    			modelAndView.addObject("result", "fail");
+        		modelAndView.addObject("message", "받는사람 초기화 중 오류가 발생하였습니다. 잠시 후 다시 시도해 주세요.");
+    			
+    		}
+			
+		} catch (Exception e) {
+			System.out.println("updateMsgTWCallToListResetAjax Controller Error!!! " + e);
+			modelAndView.addObject("result", "fail");
+    		modelAndView.addObject("message", "받는사람 초기화 중 오류가 발생하였습니다. 잠시 후 다시 시도해 주세요.");
+    		return modelAndView;
+		}
+		
+		return modelAndView;
+	}
+	
+	/*
+	 * 받는사람 목록 선택 삭제 데이터 취소 처리
+	 * 
+	 * */
+	@RequestMapping(value="/web/mjon/msgcampain/updateMsgTWCallToListChkDelAjax.do")
+	public ModelAndView updateMsgTWCallToListChkDelAjax(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.setViewName("jsonView");
+		
+		//로그인 권한정보 불러오기
+    	LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
+    	String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
+
+    	if(userId.equals("")) {
+    		
+    		modelAndView.addObject("result", "loginFail");
+    		modelAndView.addObject("message", "로그인이 필요합니다.");
+    		return modelAndView;
+    		
+    	}
+    	
+    	try {
+    		
+    		mjonCandidateTWVO.setMberId(userId);
+    		
+    		int resultCnt = mjonCandidateService.updateMsgTWCallToListChkDel(mjonCandidateTWVO);
+    		
+    		if(resultCnt > 0) {
+    			
+    			modelAndView.addObject("result", "success");
+    			
+    		}else {
+    			
+    			modelAndView.addObject("result", "fail");
+        		modelAndView.addObject("message", "받는사람 삭제 중 오류가 발생하였습니다. 잠시 후 다시 시도해 주세요.");
+    			
+    		}
+			
+		} catch (Exception e) {
+			System.out.println("updateMsgTWCallToListResetAjax Controller Error!!! " + e);
+			modelAndView.addObject("result", "fail");
+    		modelAndView.addObject("message", "받는사람 초기화 중 오류가 발생하였습니다. 잠시 후 다시 시도해 주세요.");
+    		return modelAndView;
+		}
+		
+		return modelAndView;
+	}
+	
+	@RequestMapping(value="/web/mjon/msgcampain/insertMsgTWCallToOneNumberAddAjax.do")
+	public ModelAndView insertMsgTWCallToOneNumberAdd(MjonCandidateTWVO mjonCandidateTWVO) throws Exception{
+		
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.setViewName("jsonView");
+		
+		//로그인 권한정보 불러오기
+    	LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
+    	String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
+
+    	if(userId.equals("")) {
+    		
+    		modelAndView.addObject("result", "loginFail");
+    		modelAndView.addObject("message", "로그인이 필요합니다.");
+    		return modelAndView;
+    		
+    	}
+    	
+    	try {
+			
+    		
+    		System.out.println("================ callSeq ::: "+mjonCandidateTWVO.getCallSeq());
+    		String callToNum = "";
+    		for(String callTo : mjonCandidateTWVO.getCallToArr()) {
+    			
+    			System.out.println("++++++++++++++++ callToArr ::: "+callTo);
+    			callToNum = callTo;
+    			
+    		}
+    		
+    		int callSeq = mjonCandidateTWVO.getCallSeq();
+    		
+    		//처음 등록되는 연락처 번호이면 기존 회원 CallSeq 마지막 번호 다음으로 신규 추가
+    		if(callSeq == 0) {
+    			
+    			int maxCallSeq = mjonCandidateService.selectCandidateTWMaxCallSeq(userId);
+    			maxCallSeq += 1;//마지막 순번에 1을 더해서 다음 순번을 지정해준다.
+    			
+    			mjonCandidateTWVO.setCallSeq(maxCallSeq);
+    			
+    		}
+    		
+    		//연락처 추가 관련 입력정보 셋팅해주기
+    		mjonCandidateTWVO.setMberId(userId);
+			mjonCandidateTWVO.setCallTo(callToNum.replaceAll("-", ""));
+			mjonCandidateTWVO.setFrstRegisterId(userId);
+			mjonCandidateTWVO.setLastUpdusrId(userId);
+			
+			//중복 연락처 체크 해주기
+			int dupCallNum = mjonCandidateService.selectCandidateTWCallToDupleCnt(mjonCandidateTWVO);
+			
+			if(dupCallNum > 0) {
+				modelAndView.addObject("result", "fail");
+        		modelAndView.addObject("message", "이미 등록된 연락처 입니다. 연락처를 다시 확인해 주세요.");
+				return modelAndView;
+			}
+			
+			int resultCnt = mjonCandidateService.insertCandidateTWCallToDataOnlyAdd(mjonCandidateTWVO);
+    		
+			if(resultCnt > 0) {
+				modelAndView.addObject("result", "success");
+				modelAndView.addObject("callSeq", mjonCandidateTWVO.getCallSeq());
+			}else {
+				modelAndView.addObject("result", "fail");
+        		modelAndView.addObject("message", "연락처 추가 중 오류가 발생하였습니다. 잠시 후 다시 시도해 주세요.");
+			}
+    		
+    		
+		} catch (Exception e) {
+			System.out.println("insertMsgTWCallToOneNumberAdd Controller Error!!! " + e);
+			modelAndView.addObject("result", "fail");
+    		modelAndView.addObject("message", "연락처 추가 중 오류가 발생하였습니다. 잠시 후 다시 시도해 주세요.");
+    		return modelAndView;
+		}
+    	
+    	return modelAndView;
+		
+	}
+	
+	/**
+	 * 선거문자 20건씩 문자 발송 - 엑셀파일 불러오기
+	 * @param body
+	 * @param uploadFile
+	 * @param search
+	 * @param result
+	 * @param model
+	 * @param request
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "/web/mjon/msgcampain/insertExelFileTWCallToAjax.do")
+	@ResponseBody
+	public Object insertExelFileTWCallToAjax(final MultipartHttpServletRequest multiRequest) throws Exception {
+		
+		JsonResult jr = new JsonResult();
+		jr.setSuccess(false);
+		jr.setMessage("엑셀 파일만 업로드할 수 있습니다.");
+		
+		//로그인 권한정보 불러오기
+    	LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
+    	String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
+    	String author = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getAuthority());
+    	
+    	if(userId.equals("") || author.equals("")) {
+    		
+    		jr.setMessage("엑셀파일 업로드는 로그인이 필요합니다.");
+    		return jr;
+    		
+    	}
+		
+		try {
+			
+			//final Map<String, MultipartFile> files = multiRequest.getFileMap();
+			List<MultipartFile> files = (List<MultipartFile>) multiRequest.getFiles("file0");
+			
+			// 파일명에 .이 있을경우 오류 => Ex) 테스트6.20.xlsx 
+			int fileNameSplitCnt = 0;
+			List<HashMap<String, String>> json = new ArrayList<HashMap<String, String>>();
+			
+			//전체 엑셀 데이터 갯수 체크 변수
+			int totRowDataCnt = 0;
+			
+			//수신자 목록을 디비화 하기 위한 변수 셋팅
+			List<MjonCandidateTWVO> mjonCandidateTwVO = new ArrayList<MjonCandidateTWVO>();
+			List<String> callToList = new ArrayList<String>();
+			
+			if(!files.isEmpty()) {
+				fileNameSplitCnt = files.get(0).getOriginalFilename().split("[.]").length;
+				
+				if (files.get(0).getSize() > 0 
+						&& (files.get(0).getContentType().indexOf("spreadsheetml") > -1) 
+						|| files.get(0).getContentType().indexOf("ms-excel") > -1 
+						|| files.get(0).getOriginalFilename().split("[.]")[fileNameSplitCnt-1].indexOf("xlsx") > -1 
+						|| files.get(0).getOriginalFilename().split("[.]")[fileNameSplitCnt-1].indexOf("xls") > -1) {
+					
+					// 엑셀 파일 용량 3MB이상 시 10만건 이상으로 서버가 다운되는 증상 발생
+					long fileSize = multiRequest.getFile("file0").getSize();
+					
+					if(fileSize > 3374653) {
+						jr.setMessage("엑셀 파일은 3MB를 넘을수 없습니다.");
+						return jr;
+					}
+					
+					String Ext = files.get(0).getOriginalFilename().split("[.]")[1];
+					String errMessage = "";
+			        String cellValue  = "";
+			        
+					String phoneRegExp = "^(050[234567]{1}|01[016789]{1})-?[0-9]{3,4}-?[0-9]{4}$";
+					
+		            int errPhoneCnt = 0;
+		            String errPhoneLine = "";
+		            String errEtcLine = "";
+			        
+		            //엑셀 확장자에 따른 처리 로직 분리
+					if(Ext.equals("xls")) {
+						
+						HSSFWorkbook workbook = new HSSFWorkbook(files.get(0).getInputStream());
+					    HSSFSheet sheet = workbook.getSheetAt(0);
+					    
+					    if(sheet.getLastRowNum() > 20000) { //
+			            	errMessage = "20000건 이상의 업로드는 데이터 부하로 업로드 할수 없습니다.";
+			            	jr.setSuccess(false);
+			            	jr.setMessage(errMessage);
+			            	return jr;
+			            }
+			            
+			            //List<HashMap<String, String>> json = new ArrayList<HashMap<String, String>>();
+			            PhoneVO pVO = new PhoneVO();
+			            for(int i=2; i< sheet.getLastRowNum() + 2; i++){ //먼저 밸리데이션 체크(1줄은 생략)
+			            	HSSFRow row = sheet.getRow(i); //열읽기
+			            	if(null == row) { 
+			                    continue;
+			                }
+			            	
+			            	//전체 엑셀의 Row 갯수 카운트 해주기
+			            	totRowDataCnt++;
+			            	
+			            	//HashMap<String, String> jm = new HashMap<>();
+			            	// 행의 두번째 열(이름부터 받아오기) 
+			                HSSFCell cell = null;
+			                boolean errSts = true;
+			                for(int j = 0 ; j < 1; j++){ //행읽기
+			                	cellValue = "";
+			                	cell = row.getCell(j); //핸드폰
+			                	if(null == cell || "".equals(cell.toString().trim())) { //셀에 값이 없으면 
+			                    	//System.out.println("Cell 데이터가 없습니다.");
+			                		if(j == 0) {
+				                		if (sheet.getLastRowNum() == i) {
+				                			continue;
+				                		}
+				                		
+				                		//errPhoneCnt++;
+				                		//errSts = false;
+				    	            	break;
+			                		}
+			                    	
+			                    }
+			                	if(null != cell){
+			                		switch(cell.getCellType()){ //숫자타임을 문자로 변환
+			                			case  Cell.CELL_TYPE_NUMERIC:
+			                			cell.setCellType(Cell.CELL_TYPE_STRING);
+			                		}
+			                		cellValue =  StringUtil.getString(cell.getStringCellValue().trim()) ;
+			                    }
+			                	
+			                	if(j == 0) {
+			                		//전화번호
+			                		if(cellValue.matches(phoneRegExp) && errSts) {
+			                			//수신자목록을 디비화 하기 위하여 리스트에 저장해줌
+			                			callToList.add(cellValue);
+			                		}else {
+				    	            	errPhoneCnt++;
+				    	            	errPhoneLine += (i+1) + "행 ";
+				    	            	errSts = false;
+				    	            	break;
+			                		}
+			                	}
+			                	
+			                }
+			                
+			            }
+			            
+			            int resultErrCnt = errPhoneCnt;
+			            
+						if(resultErrCnt > 0) {
+							if (errPhoneCnt <= 10) {
+								if (StringUtils.isNotEmpty(errPhoneLine.trim())) {
+									errPhoneLine = "[" + errPhoneLine.trim() + "]";
+								}
+							}
+							else {
+								errPhoneLine = "";
+							}
+							jr.setMessage("유효하지 않은 형식의 전화번호  "+ errPhoneCnt +"건" + errPhoneLine.trim() + " 있습니다.\n해당 건을 제외하고 수신목록에 추가됩니다.");
+						}else {
+							jr.setMessage("");
+						}
+						
+					}else {	//확장자가 xlsx
+						
+						OPCPackage opcPackage = OPCPackage.open(files.get(0).getInputStream());
+						XSSFWorkbook workbook = new XSSFWorkbook(opcPackage);
+			            XSSFSheet sheet = workbook.getSheetAt(0); // 첫번째 시트 불러오기
+			            opcPackage.close();
+			            
+			            for(int r=2; r<sheet.getPhysicalNumberOfRows(); r++) {
+			            	
+			            	XSSFRow tmpRow = sheet.getRow(r);
+			            	//System.out.println("=================r:"+r);
+			            	XSSFCell cell = null;
+			            	if(tmpRow.getCell(0) != null) {
+			            		
+			            		cell = tmpRow.getCell(0); //핸드폰 번호만 받아오기
+				            	if(cell != null && !cell.toString().trim().equals("")) {
+				            		//System.out.println("value-" + r + ":" +cell.getStringCellValue()); 
+				            		totRowDataCnt++;
+				            		//System.out.println("tmpRowCnt:"+totRowDataCnt);
+				            	}
+			            		
+			            	}
+			            	
+			            }
+			            
+			            //if(sheet.getLastRowNum() > 20000) { //
+			            if(totRowDataCnt > 20000) { //
+			            	errMessage = "20000건 이상의 업로드는 데이터 부하로 업로드 할수 없습니다.";
+			            	jr.setSuccess(false);
+			            	jr.setMessage(errMessage);
+			            	return jr;
+			            }
+			            
+			            //List<HashMap<String, String>> json = new ArrayList<HashMap<String, String>>();
+			            PhoneVO pVO = new PhoneVO();
+			            for(int i=2; i< sheet.getLastRowNum() + 2; i++){ //먼저 밸리데이션 체크(1줄은 생략)
+			            	XSSFRow row = sheet.getRow(i); //열읽기
+			            	if(null == row) { 
+			                    continue;
+			                }
+			            	
+			            	//HashMap<String, String> jm = new HashMap<>();
+			            	// 행의 두번째 열(이름부터 받아오기) 
+			                XSSFCell cell = null;
+			                boolean errSts = true;
+			                
+			                for(int j = 0 ; j < 1; j++){ //행읽기
+			                	cellValue = "";
+			                	cell = row.getCell(j); //이름/핸드폰/변환1/변환2/변환3/변환4/변환5
+			                	if(null == cell || "".equals(cell.toString().trim())) { //셀에 값이 없으면 
+			                    	//System.out.println("Cell 데이터가 없습니다.");
+			                		if(j == 0) {
+				                		if (sheet.getLastRowNum() == i) {
+				                			continue;
+				                		}
+				                		
+				                		//errPhoneCnt++;
+				                		//errSts = false;
+				    	            	break;
+				                		
+			                		}
+			                    }
+			                	if(null != cell){
+			                		switch(cell.getCellType()){ //숫자타임을 문자로 변환
+			                			case  Cell.CELL_TYPE_NUMERIC:
+			                			cell.setCellType(Cell.CELL_TYPE_STRING);
+			                		}
+			                		cellValue =  StringUtil.getString(cell.getStringCellValue().trim()) ;
+			                    }
+			                	
+			                	if(j == 0) {
+			                		//전화번호
+			                		if(cellValue.matches(phoneRegExp) && errSts) {
+			                			//수신자목록을 디비화 하기 위하여 리스트에 저장해줌
+			                			callToList.add(cellValue);
+			                			
+			                		}else {
+				    	            	errPhoneCnt++;
+				    	            	errPhoneLine += (i+1) + "행 ";
+				    	            	errSts = false;
+				    	            	break;
+			                		}
+			                	}
+			                	
+			                }
+			                
+			            }
+			            
+			            int resultErrCnt = errPhoneCnt;
+			            
+						if(resultErrCnt > 0) {
+							if (errPhoneCnt <= 10) {
+								if (StringUtils.isNotEmpty(errPhoneLine.trim())) {
+									errPhoneLine = "[" + errPhoneLine.trim() + "]";
+								}
+							}
+							else {
+								errPhoneLine = "";
+							}
+							jr.setMessage("유효하지 않은 형식의 전화번호  "+ errPhoneCnt +"건" + errPhoneLine.trim() + " 있습니다.\n해당 건을 제외하고 수신목록에 추가됩니다.");
+						}else {
+							jr.setMessage("");
+						}
+					}	//xlsx 처리 끝
+					
+				}
+				
+				//수신자 목록 중복 체크 및 디비화 처리
+				List<String> dupCallToList = MJUtil.getDuplicateList(callToList);
+				
+				String dupCallCnt = Integer.toString(totRowDataCnt - dupCallToList.size());
+				
+				//입력되어있는 데이터의 마지막 순번(call_seq)을 조회해 온다.
+				int maxCallSeq = mjonCandidateService.selectCandidateTWMaxCallSeq(userId);
+				maxCallSeq += 1;//마지막 순번에 1을 더해서 다음 순번을 지정해준다.
+				HashMap<String, String> callHm = new HashMap<>();
+				for(String callTo : dupCallToList) {
+					
+					MjonCandidateTWVO tmpCandidateTwVO = new MjonCandidateTWVO();
+					
+					tmpCandidateTwVO.setMberId(userId);
+					tmpCandidateTwVO.setCallTo(callTo.replaceAll("-", ""));
+					tmpCandidateTwVO.setFrstRegisterId(userId);
+					tmpCandidateTwVO.setLastUpdusrId(userId);
+					tmpCandidateTwVO.setCallSeq(maxCallSeq);
+					
+					mjonCandidateTwVO.add(tmpCandidateTwVO);
+					
+				}
+				
+				int resultCnt = mjonCandidateService.insertCandidateTWCallToData(mjonCandidateTwVO);
+				
+				if(resultCnt > 0) {
+					
+					callHm.put("callSeq", Integer.toString(maxCallSeq));
+					json.add(callHm);
+
+					jr.setData(json);
+					jr.setSuccess(true);
+					
+				}else {
+					
+					jr.setSuccess(false);
+					jr.setMessage("엑셀 데이터 처리에 오류가 발생하였습니다. 잠시후 다시 시도해 주세요.");
+					
+				}
+				
+			}
+			
+			return jr;
+			
+		} catch (Exception e) {
+			// TODO: handle exception
+			System.out.println("+++++++++++++++++ insertExelFileTWCallToAjax Controller Error !!! "+e);
+			jr.setSuccess(false);
+			jr.setMessage("엑셀 데이터에 오류가 있습니다. 엑셀 데이터를 확인해 주세요.");
+			return jr;
+		}
+		
+	}
+	
+	
+	/**
+	 * 선거문자 20건씩 문자 발송 - TXT파일 불러오기
+	 * @param body
+	 * @param uploadFile
+	 * @param search
+	 * @param result
+	 * @param model
+	 * @param request
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "/web/mjon/msgcampain/insertTxtFileTWCallToAjax.do")
+	@ResponseBody
+	public Object insertTxtFileTWCallToAjax(final MultipartHttpServletRequest multiRequest) throws Exception {
+		
+		JsonResult jr = new JsonResult();
+		jr.setSuccess(false);
+		jr.setMessage("TXT 파일만 업로드할 수 있습니다.");
+		
+		//로그인 권한정보 불러오기
+    	LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
+    	String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
+    	String author = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getAuthority());
+    	
+    	if(userId.equals("") || author.equals("")) {
+    		
+    		jr.setMessage("TXT 파일 업로드는 로그인이 필요합니다.");
+    		return jr;
+    		
+    	}
+		
+		try {
+			
+			List<MultipartFile> files = (List<MultipartFile>) multiRequest.getFiles("file0");
+			List<MjonCandidateTWVO> mjonCandidateTwVO = new ArrayList<MjonCandidateTWVO>();
+			List<String> callToList = new ArrayList<String>();
+			List<HashMap<String, String>> json = new ArrayList<HashMap<String, String>>();
+			//전체 엑셀 데이터 갯수 체크 변수
+			int totRowDataCnt = 0;
+			
+			if(!files.isEmpty()) {
+				
+				if (files.get(0).getSize() > 0 
+						|| files.get(0).getOriginalFilename().split("[.]")[1].indexOf("txt") > -1) {
+					
+					// txt 파일 용량 3MB이상 시 10만건 이상으로 서버가 다운되는 증상 발생
+					long fileSize = multiRequest.getFile("file0").getSize();
+					
+					if(fileSize > 3374653) {
+						jr.setMessage("txt 파일은 3MB를 넘을수 없습니다.");
+						return jr;
+					}
+					
+					BufferedReader reader = new BufferedReader(new InputStreamReader(multiRequest.getFile("file0").getInputStream()));
+					
+					String line = null;
+					String[] splitedStr = null;
+					String[] tempStr = null;
+					int errPhoneCnt = 0;
+					
+					//String phoneRegExp = "^01(?:0|1|[6-9])[.-]?(\\d{3}|\\d{4})[.-]?(\\d{4})$";
+					String phoneRegExp = "^(050[234567]{1}|01[016789]{1})-?[0-9]{3,4}-?[0-9]{4}$";				
+					
+					//파일 읽어서 탭으로 구분해주기
+					while ((line = reader.readLine()) != null) {
+
+						HashMap<String, String> jm = new HashMap<>();
+						splitedStr = null;
+						tempStr = null;
+						
+						//txt 파일의 데이터가 탭 혹은 콤마로 구분되어 있는지 구분처리
+						tempStr = line.split("\t");
+						if(tempStr.length > 0) {
+							
+							splitedStr = tempStr;
+							
+						}else {
+							
+							splitedStr = line.split(",");
+							
+						}
+
+						for (int i = 0; i < splitedStr.length; i++) {
+
+							splitedStr[i] = splitedStr[i].trim();
+							
+							if(i == 0) {
+								
+								if(splitedStr[i].matches(phoneRegExp)) {
+									//휴대폰 번호
+									//jm.put("phone", splitedStr[i]);
+									callToList.add(splitedStr[i]);
+									totRowDataCnt++;
+						
+								}else {
+			    	            	errPhoneCnt++;
+		                		}
+								
+							}
+							
+						}
+						
+						/*if(jm.get("phone") != null) {
+							
+							json.add(jm);
+							
+						}*/
+
+					} // end while
+					//jr.setData(json);
+					//jr.setSuccess(true);
+					if(errPhoneCnt > 0) {
+						
+						jr.setMessage("올바르지 않은 휴대폰 번호가 "+ errPhoneCnt +" 건 있습니다.");
+						
+					}else {
+						
+						jr.setMessage("");
+						
+					}
+				}
+				
+				
+				//수신자 목록 중복 체크 및 디비화 처리
+				List<String> dupCallToList = MJUtil.getDuplicateList(callToList);
+				
+				String dupCallCnt = Integer.toString(totRowDataCnt - dupCallToList.size());
+				
+				//입력되어있는 데이터의 마지막 순번(call_seq)을 조회해 온다.
+				int maxCallSeq = mjonCandidateService.selectCandidateTWMaxCallSeq(userId);
+				maxCallSeq += 1;//마지막 순번에 1을 더해서 다음 순번을 지정해준다.
+				HashMap<String, String> callHm = new HashMap<>();
+				for(String callTo : dupCallToList) {
+					
+					MjonCandidateTWVO tmpCandidateTwVO = new MjonCandidateTWVO();
+					
+					tmpCandidateTwVO.setMberId(userId);
+					tmpCandidateTwVO.setCallTo(callTo.replaceAll("-", ""));
+					tmpCandidateTwVO.setFrstRegisterId(userId);
+					tmpCandidateTwVO.setLastUpdusrId(userId);
+					tmpCandidateTwVO.setCallSeq(maxCallSeq);
+					
+					mjonCandidateTwVO.add(tmpCandidateTwVO);
+					
+				}
+				
+				int resultCnt = mjonCandidateService.insertCandidateTWCallToData(mjonCandidateTwVO);
+				
+				if(resultCnt > 0) {
+					
+					callHm.put("callSeq", Integer.toString(maxCallSeq));
+					json.add(callHm);
+
+					jr.setData(json);
+					jr.setSuccess(true);
+					
+				}else {
+					
+					jr.setSuccess(false);
+					jr.setMessage("엑셀 데이터 처리에 오류가 발생하였습니다. 잠시후 다시 시도해 주세요.");
+					
+				}
+				
+				
+			}
+			
+			return jr;
+			
+		} catch (Exception e) {
+			// TODO: handle exception
+			System.out.println("+++++++++++++++++ insertTxtFileTWCallToAjax Controller Error !!! "+e);
+			jr.setSuccess(false);
+			jr.setMessage("TXT 데이터에 오류가 있습니다. TXT 데이터를 확인해 주세요.");
+			return jr;
+		}
+		
+	}
+	
+}
src/main/resources/egovframework/sqlmap/let/msg/MjonMsgCampainData_SQL_mysql.xml
--- src/main/resources/egovframework/sqlmap/let/msg/MjonMsgCampainData_SQL_mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/msg/MjonMsgCampainData_SQL_mysql.xml
@@ -6,7 +6,7 @@
 <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
 <sqlMap namespace="Msg">
 	<typeAlias  alias="mjonCandidateVO" type="itn.let.mjo.msgcampain.service.MjonCandidateVO"/>
-	
+	<typeAlias  alias="mjonCandidateTWVO" type="itn.let.mjo.msgcampain.service.MjonCandidateTWVO"/>
 	
 	<select id="mjonCandidateDAO.selectCandidateDataInfo" parameterClass="String" resultClass="mjonCandidateVO">
 		
@@ -100,6 +100,155 @@
 	
 	</update>
 	
+	<insert id="mjonCandidateDAO.insertCandidateTWCallToData" parameterClass="java.util.List">
+		
+		INSERT
+		INTO   MJ_CAMPAIN_TMP_CALLTO
+		       (
+		              MBER_ID,
+		              CALL_TO,
+		              SEND_FLAG,
+		              CALL_SEQ,
+		              FRST_REGISTER_ID,
+		              FRST_REGIST_PNTTM,
+		              LAST_UPDUSR_ID,
+		              LAST_UPDT_PNTTM
+		       )
+		       VALUES
+		       <iterate conjunction=",">
+			       (
+			          #[].mberId#,
+			          #[].callTo#,
+			          'N',
+			          #[].callSeq#,
+			          #[].frstRegisterId#,
+			          NOW(),
+			          #[].lastUpdusrId#,
+			          NOW()
+			       )
+		       </iterate>
+	
+	</insert>
+	
+	<update id="mjonCandidateDAO.updateCandidateTWCallToDataCancel" parameterClass="String">
+		
+		UPDATE MJ_CAMPAIN_TMP_CALLTO SET 
+			SEND_FLAG = 'C',
+			LAST_UPDUSR_ID = #mberId#,
+			LAST_UPDT_PNTTM = NOW()
+		WHERE MBER_ID = #mberId#
+	
+	</update>
+	
+	<select id="mjonCandidateDAO.selectCandidateTWMaxCallSeq" parameterClass="String" resultClass="Integer">
+	
+		SELECT IFNULL(MAX(CALL_SEQ), 0)
+		FROM   MJ_CAMPAIN_TMP_CALLTO
+		WHERE  MBER_ID = #mberId#
+	
+	</select>
+	
+	<select id="mjonCandidateDAO.selectCampainTWCalltoList" parameterClass="mjonCandidateTWVO" resultClass="egovMap">
+	
+		SELECT COUNT(CAMPAIN_TMP_ID) OVER() AS totCnt, 
+			   CAMPAIN_TMP_ID AS campainTmpId,
+		       MBER_ID        AS mberId,
+		       CALL_TO        AS callTo,
+		       SEND_FLAG      AS sendFlag,
+		       CALL_SEQ       AS callSeq
+		FROM   MJ_CAMPAIN_TMP_CALLTO
+		WHERE  MBER_ID   = #mberId#
+		AND    CALL_SEQ  = #callSeq#
+		AND    SEND_FLAG = 'N'
+		ORDER BY CAMPAIN_TMP_ID
+        LIMIT #recordCountPerPage# OFFSET #firstIndex#
+	
+	</select>
+	
+	<update id="mjonCandidateDAO.updateMsgTWCallToListResetByMberId" parameterClass="mjonCandidateTWVO">
+		
+		UPDATE MJ_CAMPAIN_TMP_CALLTO SET 
+			SEND_FLAG = 'C',
+			LAST_UPDUSR_ID = #mberId#,
+			LAST_UPDT_PNTTM = NOW()
+		WHERE MBER_ID = #mberId#
+		AND CALL_SEQ = #callSeq#
+	
+	</update>
+	
+	<update id="mjonCandidateDAO.updateMsgTWCallToListChkDel" parameterClass="mjonCandidateTWVO">
+		
+		UPDATE MJ_CAMPAIN_TMP_CALLTO SET 
+			SEND_FLAG = 'C',
+			LAST_UPDUSR_ID = #mberId#,
+			LAST_UPDT_PNTTM = NOW()
+		WHERE MBER_ID = #mberId#
+		    <iterate prepend="AND CAMPAIN_TMP_ID IN " open="(" close=")" conjunction="," property="campainTmpIdList">
+				#campainTmpIdList[]#
+			</iterate>
+	
+	</update>
+	
+	<select id="mjonCandidateDAO.selectMsgTWCallToTotCount" parameterClass="mjonCandidateTWVO" resultClass="mjonCandidateTWVO">
+	
+		SELECT IFNULL(SUM(IF(SEND_FLAG = 'Y', 1, 0)), 0) AS sendComplete,
+		       IFNULL(SUM(IF(SEND_FLAG = 'N', 1, 0)), 0) AS sendReady,
+		       IFNULL(COUNT(CAMPAIN_TMP_ID), 0)          AS totCallToCnt
+		FROM   MJ_CAMPAIN_TMP_CALLTO
+		WHERE  MBER_ID  = #mberId#
+		AND    CALL_SEQ = #callSeq#
+		AND    SEND_FLAG IN ('Y','N')
+	
+	</select>
+	
+	<insert id="mjonCandidateDAO.insertCandidateTWCallToDataOnlyAdd" parameterClass="mjonCandidateTWVO">
+		
+		INSERT
+		INTO   MJ_CAMPAIN_TMP_CALLTO
+		       (
+		              MBER_ID,
+		              CALL_TO,
+		              SEND_FLAG,
+		              CALL_SEQ,
+		              FRST_REGISTER_ID,
+		              FRST_REGIST_PNTTM,
+		              LAST_UPDUSR_ID,
+		              LAST_UPDT_PNTTM
+		       )
+		 VALUES
+		       (
+		          #mberId#,
+		          #callTo#,
+		          'N',
+		          #callSeq#,
+		          #frstRegisterId#,
+		          NOW(),
+		          #lastUpdusrId#,
+		          NOW()
+		       )
+	
+	</insert>
+	
+	<select id="mjonCandidateDAO.selectCandidateTWCallToDupleCnt" parameterClass="mjonCandidateTWVO" resultClass="Integer">
+		
+		SELECT COUNT(CAMPAIN_TMP_ID)
+		FROM   MJ_CAMPAIN_TMP_CALLTO
+		WHERE  MBER_ID  = #mberId#
+		AND    CALL_SEQ = #callSeq#
+		AND    CALL_TO  = #callTo#
+		AND	   SEND_FLAG IN ('Y','N')
+	
+	</select>
+	
+	<select id="mjonCandidateDAO.selectMsgCallToSeqNum" parameterClass="String" resultClass="Integer">
+		
+		SELECT IFNULL(MAX(CALL_SEQ), 0) AS callSeq
+		FROM   MJ_CAMPAIN_TMP_CALLTO
+		WHERE  MBER_ID = #mberId#
+		AND    SEND_FLAG IN ('Y',
+		                     'N')
+	</select>
+	
 </sqlMap>  
 
 
 
src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataCallToListView.jsp (added)
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataCallToListView.jsp
@@ -0,0 +1,80 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
+
+<script type="text/javascript">
+
+	var totCallToCnt = '${resultTotCallToInfo.totCallToCnt}';
+	var sendComplete = '${resultTotCallToInfo.sendComplete}';
+	var sendReady = '${resultTotCallToInfo.sendReady}';
+	
+	$("#totCallToCnt").text(totCallToCnt);
+	$("#sendComplete").text(sendComplete);
+	$("#sendReady").text(sendReady);
+	
+	
+</script>
+<div class="listType list">
+	<ul class="thead_ul table_ul">
+		<li></li>
+		<li>
+			번호
+			<!-- <button type="button" class="btn_sort_up"><img src="/publish/images/sortUp.png"></button>
+			<button type="button" class="btn_sort_down"><img src="/publish/images/sortDown.png"></button> -->
+		</li>
+		<li></li>
+		<li>
+			번호
+			<!-- <button type="button" class="btn_sort_up"><img src="/publish/images/sortUp.png"></button>
+			<button type="button" class="btn_sort_down"><img src="/publish/images/sortDown.png"></button> -->
+		</li>
+	</ul>
+	<ul class="tbody_ul table_ul">
+		<c:choose>
+			<c:when test="${not empty resultCallToList}">
+				<c:forEach var="callToList" items="${resultCallToList}" varStatus="status">
+					<li class="ui-widget-content">
+						<div class="input_wrap"><input type="checkbox" id="chkCallTo_<c:out value='${callToList.campainTmpId}'/>" name="chkCallTo" value="<c:out value='${callToList.campainTmpId}'/>" onchange="fnChkCallToChange();"></div>
+						<label for="chkCallTo_<c:out value='${callToList.campainTmpId}'/>" id="spanCallTo"><c:out value="${callToList.callTo}"/></label>
+					</li>
+				</c:forEach>
+			</c:when>
+			<c:otherwise>
+				<%-- <li class="liCallTo">
+					<a href="#">
+						<div>
+							등록된 수신자 정보가 없습니다.
+						</div>
+					</a>
+				</li> --%>
+			</c:otherwise>
+		</c:choose>
+	</ul>
+</div>
+<div class="list_bottom clearfix">
+	<ul class="pagination">
+		<ui:pagination paginationInfo = "${paginationInfo}"  type="imageWeb" jsFunction="fnCallToListPaging" />
+	</ul>
+	<div class="list_bottom_right">
+		<button type="button" class="btnType btn_gray fill" onclick="fnCallToListReset();">초기화</button>
+		<div class="btn_popup_wrap">
+			<button type="button" class="btnType btn_yellow fill btn_check_one">1명씩 선택<i class="qmMark"></i></button>
+			<div class="error_hover_cont send_hover_cont">
+				<p style="line-height:1.3;">마우스를 누르고 있으면 받는사람을 연속적으로 20명까지 선택할 수 있습니다.</p>
+			</div>
+		</div>
+	</div>
+	<%-- <div class="btn_popup_wrap">
+		<button type="button" class="btnType btnType8" onclick="fnCallToListReset();">수신목록 초기화</button>
+	</div>
+	<div class="remove_btnWrap">
+		<button type="button" class="btnType15 all_del"><i class="remove_img"></i>전체삭제</button>
+		<button type="button" class="btnType15 select_del"><i class="remove_img"></i>선택삭제</button>
+		<button type="button" class="btnType15 select_one"><i class="remove_img"></i>1명씩선택</button>
+	</div>
+	<div class="list_bottom_right">
+		<p>총 <span class="c_e40000" id="rowTotCnt">0</span>건 / 중복 <span class="c_002c9a" id="rowDupCnt">0</span>건</p>
+		<button type="button" class="address_reg2 addressregi_btn">주소록에 등록</button>
+	</div> --%>
+</div>(No newline at end of file)
 
src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataSMLView.jsp (added)
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataSMLView.jsp
@@ -0,0 +1,4594 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+
+
+<script type="text/javascript" src="<c:url value='/publish/js/content.js'/>"></script>
+<script type="text/javascript" src="<c:url value='/js/txtSpecialReplace.js?date=202304250001'/>"></script>
+
+<!--  -->
+<script type="text/javascript" src="<c:url value='/publish/js/publish.js'/>"></script>
+
+<% pageContext.setAttribute("newLineChar", "\r\n"); %>
+<script type="text/javascript">
+var tableErrorData = [];
+var totRows = 0; // 좌측 받는사람 총 갯수
+
+/* 파일등록 */
+var _fileIdx = 0;
+var _fileForm2 = new Array();
+var fileExt = ""; // 첨부파일 확장자
+var excelAddr = []; //엑셀 불러오기에서 내용 저장하는 배열 변수
+
+//전체 데이터 갯수 구하는 함수
+function updateTotCnt(data){
+	
+	var rowTotCnt = data;
+	$("#rowTotCnt").text(rowTotCnt);
+
+}
+
+//주소록 불러오기에서 수신자 리스트 tabulator에 데이터 추가해주기
+function addPhoneInfo(data){
+	
+	if(data == null){
+		
+		alert("연락처 정보가 없습니다.");
+		return;
+		
+	}else{
+		
+		var idx = 0;
+		var newData = data;//중복 연락처는 하나만 남기고 모두 제거
+		
+		var recTableData = tableL.getRows();		 // 받는사람 리스트의 전체 목록을 저장
+		var tableData = [];
+		
+		//기존 받는사람 리스트를 배열에 미리 담아둔다.
+		if(recTableData.length > 0){
+			
+			for(var j=0; j < recTableData.length; j++){
+				
+				tableData.push({phone: removeDash(recTableData[j].getData().phone) , name: recTableData[j].getData().name, rep1: recTableData[j].getData().rep1, rep2: recTableData[j].getData().rep2, rep3: recTableData[j].getData().rep3, rep4: recTableData[j].getData().rep4});
+			
+			}
+		
+		}
+		
+		//받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다.
+		for(var i=0; i < newData.length; i++){
+			
+			tableData.push({phone: removeDash(newData[i].phone) , name: newData[i].name, rep1: newData[i].rep1, rep2: newData[i].rep2, rep3: newData[i].rep3, rep4: newData[i].rep4});
+			
+		}
+		
+		var temp = tableData.length;
+		
+		//기존 수신 리스트를 지워준 후 신규 전체 리스트를 추가해준다.
+		tableL.clearData(); //기존 받는사람 목록을 삭제.
+		tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기
+		_fileForm2 = []; //form file data 초기화
+		_fileIdx = 0;	//form file idx 초기화
+		
+		totRows = tableL.getRows().length; 
+		updateTotCnt(totRows); //전체 데이터 갯수 구하기
+		
+		var smsTxtArea = $('#smsTxtArea').val();
+		//일괄변환 문구 결제금액 처리
+		if(smsTxtArea.indexOf("[*이름*]")  > -1 
+				|| smsTxtArea.indexOf("[*1*]") > -1
+				|| smsTxtArea.indexOf("[*2*]") > -1
+				|| smsTxtArea.indexOf("[*3*]") > -1
+				|| smsTxtArea.indexOf("[*4*]") > -1){
+			
+			fnReplCell();
+			
+		}else{
+			
+			//결제 금액 구하기
+		    totalPriceSum(totRows);
+			
+		}
+		
+	}
+	
+}
+
+/* 파일사이즈 가져오기 */
+function getStrFileSize(filesize){
+	var sizeStr="";
+	var sizeKB = filesize/1024;
+	if(parseInt(sizeKB) > 1024){
+	    var sizeMB = sizeKB/1024;
+	    sizeStr = sizeMB.toFixed(2)+" MB";
+	}else{
+	    sizeStr = sizeKB.toFixed(2)+" KB";
+	}
+	return sizeStr;
+}
+
+// 엑셀 파일 불러오기
+function excelExport(event){
+	
+	var fileValue = $("#excelFile").val().split("\\");
+	var fileName = fileValue[fileValue.length-1];
+	
+	var fileExt = fileName.split('.').pop().toLowerCase();
+
+	if(fileExt.length > 0){
+		if($.inArray(fileExt, ['txt','xls','xlsx']) == -1) {
+
+			alert('txt, xls, xlsx 파일만 업로드 할수 있습니다.');
+			return false;
+
+	   	}
+		
+		//$("#excelFile").val("");
+		//선택 파일명 화면에 표시해주기
+	    $("#excelNm").val(fileName);
+		
+	}
+	
+}
+
+//엑셀파일 자료 데이터베이스에 입력해주기
+function fnInsertAttchFileData(){
+	
+	var data = new FormData(document.excelForm);
+	data.append("file0", $('#excelFile').prop('files')[0]);
+	
+	var fileValue = $("#excelFile").val().split("\\");
+	var fileName = fileValue[fileValue.length-1];
+	
+	var fileExt = fileName.split('.').pop().toLowerCase();
+	
+	var url = "";
+	
+	if(fileExt == "xls" || fileExt == "xlsx"){
+		
+		url = "/web/mjon/msgcampain/insertExelFileTWCallToAjax.do";
+		
+	}else if(fileExt = "txt"){
+		
+		url = "/web/mjon/msgcampain/insertTxtFileTWCallToAjax.do";
+		
+	}else{
+		
+		alert('txt, xls, xlsx 파일만 업로드 할수 있습니다.');
+		return;
+		
+	}
+	
+	//엑셀 데이터 변수에 자료가 있으면 지워준다.
+   	if(excelAddr.length > 0){
+    	
+    	excelAddr = [];
+    	
+    }
+	
+	$.ajax({
+        type: "POST",
+        enctype: 'multipart/form-data',
+        url: url,
+        data: data,
+        dataType:'json',
+        async: true,
+        processData: false,
+        contentType: false,
+        cache: false,
+        //timeout: 600000,
+        success: function (returnData, status) {
+			if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+				
+				if(returnData.success){
+					
+					var data = returnData.data;
+					var message = returnData.message;
+					
+					if(message != '' ){
+						alert(returnData.message);
+					}
+					
+					
+					if(data != null){
+						
+						$.each(data, function(i, item){
+							
+							//form 데이터 callSeq에 순번 입력해주기
+							$("#callSeq").val(item.callSeq);
+							
+						});
+
+					}
+					
+					//입력된 데이터베이스에서 받는사람 20건 불러와서 화면에 표시해주기
+					var callSeq = $("#callSeq").val();
+					if(callSeq > 0){
+						
+						//첨부파일로 불러온 데이터를 받는사람 목록에 추가해 준다.
+						addTWCallToInfo();
+						
+						 //첨부파일 초기화 시켜주기
+					    $("#excelFile").val("");
+					    $("#excelNm").val("");
+						
+					}else{
+						
+						alert("추가 엑셀 데이터가 없습니다.");
+						return false;
+						
+					}
+					
+				}else{
+					alert(returnData.message);
+					excelAddr = []; //엑셀 데이터 저장 변수 초기화
+	        		$("#excelFile").val(""); //첨부파일 input 초기화
+	        	    $("#excelNm").val("");  // 첨부파일 명 초기화
+	        	    fileName = "";
+					return;
+					
+				}
+			} else if(status== 'fail'){
+				alert("첨부파일 불러오는 중 오류가 발생하였습니다.");
+				console.log("status : fail ~");
+			}
+		},
+		error: function (e) { 
+        	alert("첨부파일 불러오는 중 오류가 발생하였습니다."); 
+        	console.log("ERROR : ", e); 
+        },
+		beforeSend : function(xmlHttpRequest) {
+        	//로딩창 show
+        	$('.loading_layer').addClass('active');				
+		},	        	        
+        complete : function(xhr, textStatus) {
+        	//로딩창 hide
+        	$('.loading_layer').removeClass('active');
+		}
+    });
+	
+}
+
+//엑셀 불러오기 팝업의 추가 버튼 처리
+$("#excelAdd").click(function(){
+	
+	var callSeq = $("#callSeq").val();
+	
+	if(!confirm("기존 받는사람을 모두 초기화하고 새로운 받는사람을 불러옵니다. 진행하시겠습니까?")){
+		return false;
+	}
+	
+	//엑셀파일 자료 데이터베이스에 입력해주기
+	fnInsertAttchFileData();
+	
+});
+
+//받는 사람 20명 정보 리스트로 불러오기 
+function addTWCallToInfo(){
+	
+	var callSeq = $("#callSeq").val();
+	
+	var sendData =  $(document.callToForm).serializeArray();
+	
+	$("#twCallToList").load("/web/mjon/msgcampain/selectMsgTWCallToListAjax.do", sendData ,function(response, status, xhr){
+		
+		$(document).ready(function () {
+			$(".receipt_number_table_wrap .tbody_ul").selectable({
+				selecting: function (event, ui) {
+					$(ui.selecting).find("input[type='checkbox']").attr("checked", "checked");
+				},
+				selected: function (event, ui) {
+					if ($(ui.selected).find("input[type='checkbox']").attr("checked") == true) {
+						$(ui.selected).find("input[type='checkbox']").removeAttr("checked");
+					} else {
+						$(ui.selected).find("input[type='checkbox']").attr("checked", "checked");
+					}
+					
+					publishCommon.clickCheckPrice();
+				},
+				unselecting: function (event, ui) {
+					$(ui.unselecting).find("input[type='checkbox']").removeAttr("checked");
+				},
+				unselected: function (event, ui) {
+					$(ui.unselected).find("input[type='checkbox']").removeAttr("checked");
+					publishCommon.clickCheckPrice();
+				},
+				filter: "li"
+			});
+
+			onlongclick(".btn_check_one", 1000, function () {
+				var checkbox = $('[name=chkCallTo]');
+				publishCommon.longMousePressCheck(checkbox, 30);
+				publishCommon.clickCheckPrice();
+			});
+
+			$(".btn_check_one").click(function(){
+				var checkbox = $('[name=chkCallTo]');
+				publishCommon.clickCheck(checkbox);
+				publishCommon.clickCheckPrice();
+			});
+
+		});
+		//수신자 목록 추가된 건수 및 발송 금액 변경해주기
+		fnChkCallToChange();
+		
+	});
+	
+}
+
+
+//받는사람 하단 페이징 처리
+function fnCallToListPaging(pageIndex){
+	
+	document.callToForm.pageIndex.value = pageIndex;
+	addTWCallToInfo();
+	
+}
+
+function fnCallToListReset(){
+	
+	var callSeq = $("#callSeq").val();
+	if(callSeq == 0){
+		
+		alert("받는사람 목록이 없습니다.");
+		return false;
+		
+	}else{
+		
+		if(!confirm("기존 받는사람을 모두 초기화하고 새로운 받는사람을 불러옵니다. 진행하시겠습니까?")){
+			return false;
+		}
+
+		var data = new FormData(document.callToForm);
+		
+		$.ajax({
+	        type: "POST",
+	        url: "/web/mjon/msgcampain/updateMsgTWCallToListResetAjax.do",
+	        data: data,
+	        dataType:'json',
+	        async: true,
+	        processData: false,
+	        contentType: false,
+	        cache: false,
+	        //timeout: 600000,
+	        success: function (returnData, status) {
+				if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+					
+					var result = returnData.result;
+					var message = returnData.message;
+					
+					if(result == "loginFail"){
+						
+						alert(message);
+						return false;
+						
+					}else if(result == "fail"){
+						
+						alert(message);
+						return false;
+						
+					}else if(result == "success"){
+						
+						alert("수신목록의 초기화가 완료되었습니다.");
+						
+						//데이터 초기화 후 call_seq 번호를 초기화 해준다.
+						$("#callSeq").val("0");
+						addTWCallToInfo();
+						
+					}else{
+						alert(message);
+						return;
+						
+					}
+				} else if(status== 'fail'){
+					alert("수신목록 초기화 중 오류가 발생하였습니다.");
+					console.log("status : fail ~");
+				}
+			},
+			error: function (e) { 
+	        	alert("수신목록 초기화 중 오류가 발생하였습니다."); 
+	        	console.log("ERROR : ", e); 
+	        },
+			beforeSend : function(xmlHttpRequest) {
+	        	//로딩창 show
+	        	$('.loading_layer').addClass('active');				
+			},	        	        
+	        complete : function(xhr, textStatus) {
+	        	//로딩창 hide
+	        	$('.loading_layer').removeClass('active');
+			}
+	    });
+		
+	}
+	
+}
+
+//선택 수신목록 리스트 삭제 처리하기
+function fnCallToListDel(callToCnt){
+	
+	var callToCnt = callToCnt;
+	
+	if(callToCnt == 0){
+		alert("삭제 하려는 받는사람 목록이 없습니다.");
+		return false;
+	}
+	
+	var form = document.callToForm;
+	
+	var data = new FormData(form);
+	
+	$.ajax({
+        type: "POST",
+        url: "/web/mjon/msgcampain/updateMsgTWCallToListChkDelAjax.do",
+        data: data,
+        dataType:'json',
+        async: true,
+        processData: false,
+        contentType: false,
+        cache: false,
+        //timeout: 600000,
+        success: function (returnData, status) {
+			if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+				
+				var result = returnData.result;
+				var message = returnData.message;
+				
+				if(result == "loginFail"){
+					
+					alert(message);
+					return false;
+					
+				}else if(result == "fail"){
+					
+					alert(message);
+					return false;
+					
+				}else if(result == "success"){
+					
+					alert("수신목록 삭제가 완료되었습니다.");
+					
+					//선택 수신목록 삭제 후 리스트 다시 불러오기
+					addTWCallToInfo();
+					
+				}else{
+					alert(message);
+					return;
+					
+				}
+			} else if(status== 'fail'){
+				alert("수신목록 삭제 중 오류가 발생하였습니다.");
+				console.log("status : fail ~");
+			}
+		},
+		error: function (e) { 
+        	alert("수신목록 삭제 중 오류가 발생하였습니다."); 
+        	console.log("ERROR : ", e); 
+        },
+		beforeSend : function(xmlHttpRequest) {
+        	//로딩창 show
+        	$('.loading_layer').addClass('active');				
+		},	        	        
+        complete : function(xhr, textStatus) {
+        	//로딩창 hide
+        	$('.loading_layer').removeClass('active');
+		}
+    });
+	
+	//수신목록 삭제에 상요된 변수 초기화 처리
+	form.callToArr.value = "";
+	callToArr = [];
+	
+}
+
+function txtExport(event){
+    var input = event.target; 
+    var reader = new FileReader();
+    var file = input.files[0];
+    var txtAddr = [];
+	var fileNm = input.files[0].name;
+    var fileExt = fileNm.split('.').pop().toLowerCase();
+    
+    if(fileExt != "txt"){
+    	
+    	alert("TXT 파일만 등록 할 수 있습니다.");
+    	return false;
+    	
+    }
+    
+    if (!file) {
+    	
+    	alert("첨부파일이 없습니다.");
+        return;
+    }
+    
+    //txt 파일 읽어 오기
+    var arrSplitData = [];
+    reader.onload = function(e) {
+        fileData = e.target.result;
+        arrSplitData = fileData.split("\n");
+        
+        for(var i=0; i < arrSplitData.length; i++){
+        	
+        	var arrTemp = arrSplitData[i].split("\t");
+        	txtAddr.push({phone: arrTemp[1].trim(), name: arrTemp[0].trim()});
+        	
+        }
+        
+      	//Tabulator에 데이터 입력해주기
+        addPhoneInfo(txtAddr);
+    };
+    reader.readAsText(file, 'UTF-8');
+    
+    //첨부파일 초기화 시켜주기
+    $("#txtFile").val("");
+} 
+
+//발송금액 단가표시
+function SetPriceWrapOpen() {
+	var loginVO = '${LoginVO}';
+	//로그인 체크
+	if(loginVO == "" || loginVO == null){
+	}else {
+		// 발송금액 가격안내
+		$("#myPriceWrap").show();		
+	}
+}
+
+//등급제 시행 ON/OFF 체크
+function getMberSettingDetail() {
+	$.ajax({
+        type: "POST",
+        url: "/web/grd/mberSettDetailAjax.do",
+        data: {},
+        dataType:'json',
+        async: false,
+        success: function (data) {
+			if (data.isSuccess) {
+				// 발송금액 가격안내
+				$("#myPriceWrap").show();
+			} 
+			else {
+				//alert("Msg : " + data.msg);
+			}
+		},
+        error: function (e) { 
+        	//alert("ERROR : " + JSON.stringify(e)); 
+        }
+    });				
+}	
+
+$(document).ready(function (){
+	// 발송금액 단가표시
+	SetPriceWrapOpen();	
+	
+	//미리보기 이미지 영역 숨김 처리
+	$('.preiew_img').hide();
+	$('.prePhoto').hide();
+	
+	//최초 화면 문자열 길이 체크해주기
+	var strCon = $('#smsTxtArea').val();
+	fnByteString(strCon);
+	
+	//선거문자 텍스트 내용 추가해주기
+	//advMsgInsert();
+		
+	
+	//문자 내용 입력시 바이트수 계산하기
+	$('#smsTxtArea').keyup(function(e){
+		
+		var contents = $(this).val();
+		 
+		fnByteString(contents);
+		
+	});//문자 바이트수 계산하기 끝
+
+	//받는사람 내역 있으면 불러와주기
+	//디비에 미발송 내역이 있는 경우에만 불러와짐
+	var loginId = '${LoginVO.id}';
+	//로그인 체크
+	if(loginId != "" && loginId != null){
+		addTWCallToInfo();
+	}	
+	
+	
+	//스프레드 시트 Tabulator 초기 셋팅
+	/* var tabledata = [
+	 ]; */
+	
+	//var selectRow;
+	
+	//받는사람 연락처 내용 처리
+	//Tabulator AJAX Data Loading
+	/* tableL = new Tabulator(".callList_box", {
+		height:"255px",
+	    layout:"fitColumns",
+	    //data:tabledata,
+	    //autoColumns:true,
+	    headerHozAlign:"center",
+	    validationMode:"highlight",
+	    //clipboard:false,
+	    //clipboardCopySelector:"table",
+	    //clipboardPasteAction:"insert", // insert, update, replace
+	    placeholder:"복사(Ctrl+C)한 내용을 여기에 붙여넣기(Ctrl+V) 해주세요.", //fit columns to width of table (optional)
+	    resizableColumns:false,
+	 	columns:[ //Define Table Columns
+	 		{formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, hozAlign:"center", headerSort:false, cellClick:function(e, cell){
+	 	        cell.getRow().toggleSelect();
+		 		}
+		 	}, 
+		 	{title:"이름", hozAlign:"center", field:"name", editor:"input", validator:["maxLength:12"], cellEdited:function(cell){
+		 	    //cell - cell component
+		 	    fnReplCell();
+		    }},
+		 	{title:"휴대폰", hozAlign:"center", field:"phone", editor:"input", width:100, validator:["required","minLength:10", "maxLength:12"], cellEdited:function(cell){
+		 	    //cell - cell component
+		 	    fnDuplPhone();
+		    }},
+		 	{title:"[*1*]", hozAlign:"center", field:"rep1", editor:"input", validator:["maxLength:40"], cellEdited:function(cell){
+		 	    //cell - cell component
+		 	    fnReplCell();
+		    }},
+		 	{title:"[*2*]", hozAlign:"center", field:"rep2", editor:"input", validator:["maxLength:40"], cellEdited:function(cell){
+		 	    //cell - cell component
+		 	    fnReplCell();
+		    }},
+		 	{title:"[*3*]", hozAlign:"center", field:"rep3", editor:"input", validator:["maxLength:40"], cellEdited:function(cell){
+		 	    //cell - cell component
+		 	    fnReplCell();
+		    }},
+		 	{title:"[*4*]", hozAlign:"center", field:"rep4", editor:"input", validator:["maxLength:40"], cellEdited:function(cell){
+		 	    //cell - cell component
+		 	    fnReplCell();
+		    }},
+		 	
+	 	],
+	 	validationFailed:function(cell, value, parameters){ // 유효성 체크 함수 - 아직 잘 모르겠음 
+	        //take action on validation fail
+	 		var valid = cell.isValid();
+	 		var fieldNm = cell.getField();
+	 		var cellVal = cell.getValue();
+	 		var returnVal = "";
+	 		if(!valid){
+	 			
+	 			if(fieldNm == "name"){
+	 				alert("받는사람 이름은 최대 12글자까지만 입력 가능합니다.");
+	 				cell.setValue(strMaxLengthSubstring(cellVal, 11)); //스크립트 함수가 0부터 시작이므로 원하는 글자수 -1을 해줘야한다.
+	 				cell.clearValidation();
+	 			}else if(fieldNm == "phone"){
+	 				alert("휴대폰번호는 하이픈(-)을 제외한 숫자만 정확히 입력해 주세요.");
+	 			}else{
+		 			alert("치환문자를 정확히 입력해 주세요. 40글자 이내로 입력 가능합니다.");
+		 			cell.setValue(strMaxLengthSubstring(cellVal, 39));
+		 			cell.clearValidation();
+	 			}
+	 			
+	 			//해당 셀 데이터 삭제
+	 			//cell.setValue("");
+	 			
+	 		}
+	 		return value % parameters.phone;
+	    },
+
+	}); */
+	
+	
+	//주소록 불러오기 팝업 내용
+	//Tabulator AJAX Data Loading
+	tableAddr = new Tabulator(".callAddr_box", {
+		height:"255px",
+	    layout:"fitColumns",
+	    headerHozAlign:"center",
+	    validationMode:"highlight",
+	    placeholder:"주소록 그룹을 선택해 주세요.", //fit columns to width of table (optional)
+	    resizableColumns:false,
+	 	columns:[ //Define Table Columns
+	 		{formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, hozAlign:"center", headerSort:false, cellClick:function(e, cell){
+	 	        cell.getRow().toggleSelect();
+		 		}
+		 	}, 
+		 	{title:"그룹명", hozAlign:"center", field:"addrGroupNm", editor:"input", width:100, validator:["required","minLength:2", "maxLength:40"]},
+		 	{title:"이름", hozAlign:"center", field:"addrName", editor:"input",  width:100, validator:["maxLength:12"]},
+		 	{title:"휴대폰번호", hozAlign:"center", field:"addrPhone", editor:"input", width:100, validator:["required","minLength:10", "maxLength:11"]},
+		 	{title:"[*1*]", hozAlign:"center", field:"addrRep1", editor:"input", width:84, validator:["maxLength:40"]},
+		 	{title:"[*2*]", hozAlign:"center", field:"addrRep2", editor:"input", width:84, validator:["maxLength:40"]},
+		 	{title:"[*3*]", hozAlign:"center", field:"addrRep3", editor:"input", width:84, validator:["maxLength:40"]},
+		 	{title:"[*4*]", hozAlign:"center", field:"addrRep4", editor:"input", width:84, validator:["maxLength:40"]},
+		 	
+	 	],
+	 	validationFailed:function(cell, value, parameters){ // 유효성 체크 함수 - 아직 잘 모르겠음 
+	 		var valid = cell.isValid();
+	 		var fieldNm = cell.getField();
+	 		if(!valid){
+	 			if(fieldNm == "addrName"){
+	 				alert("받는사람 이름은 최대 12글자까지만 입력 가능합니다.");
+	 			}else if(fieldNm == "addrPhone"){
+	 				alert("휴대폰번호는 하이픈(-)을 제외한 숫자만 정확히 입력해 주세요.");
+	 			}else if(fieldNm == "addrGroupNm"){
+	 				alert("그룹명을 정확히 입력해 주세요. 2 ~ 40글자 이내로 입력 가능합니다.");
+	 			}else{
+		 			alert("치환문자를 정확히 입력해 주세요. 40글자 이내로 입력 가능합니다.");
+	 			}
+	 			
+	 			//해당 셀 데이터 삭제
+	 			cell.setValue("");
+	 		}
+	 		return value % parameters.addrPhone;
+	    },
+
+	});
+	
+	//핸드폰 번호 Tabulator에서 수정시 중복 체크
+	function fnDuplPhone(){
+		
+		var recTableData = tableL.getRows();		 // 받는사람 리스트의 전체 목록을 저장
+		var tableData = [];
+		
+		//기존 받는사람 리스트를 배열에 미리 담아둔다.
+		if(recTableData.length > 0){
+			
+			for(var j=0; j < recTableData.length; j++){
+				
+				tableData.push({phone: removeDash(recTableData[j].getData().phone.trim()) , name: recTableData[j].getData().name, rep1: recTableData[j].getData().rep1, rep2: recTableData[j].getData().rep2, rep3: recTableData[j].getData().rep3, rep4: recTableData[j].getData().rep4});
+			
+			}
+		
+		}
+		
+		//수신목록에서 중복 휴대폰문자가 있는지 체크해주기
+		var dupCnt = dupliPhoneDataChk(tableData);
+		
+		if(dupCnt > 0){
+			
+			if(confirm("동일한 휴대폰 번호가 받는사람 목록에 등록되어 있습니다. 중복 번호를 삭제하시겠습니까?")){
+				
+				//수신목록에서 중복 휴대폰 번호 삭제해주기
+				tableL.clearData(); //기존 받는사람 목록을 삭제.
+				tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기
+				_fileForm2 = []; //form file data 초기화
+				_fileIdx = 0;	//form file idx 초기화
+				
+				totRows = tableL.getRows().length; 
+				updateTotCnt(totRows); //전체 데이터 갯수 구하기
+				
+			}
+			
+		}
+		
+	}
+	
+	//받는사람 목록에 복사/붙여넣기 기능 처리
+	/* $('.callList_box').on('paste', function (e) {
+		
+		var element = e.originalEvent.clipboardData.getData('text'); // 클립보드에 복사한 데이터 가져오기
+		
+		var elmSplit= [];
+		  
+		elmSplit = element.split("\n");
+		
+		var elmLen = elmSplit.length;
+		
+		  
+		if(elmLen < 0){
+			  
+			alert("붙여넣을 연락처를 복사해주세요.");
+			return false;
+			  
+		}else{
+			tableErrorData.length = 0;	// 오류 번호 배열 초기화
+			
+			var splitData = [];
+			var realPhone = [];
+			for(var i=0; i < elmLen; i++){
+				  
+				var splitStr = elmSplit[i]; 
+				var tabData = [];
+				var comData = [];
+				
+				if(splitStr.indexOf('\t') != -1){
+					splitData = splitStr.split('\t'); //탭 구분으로 데이터 분할
+				}else if(splitStr.indexOf(',') != -1){
+					splitData = splitStr.split(','); //콤마 구분으로 데이터 분할
+				}else{
+					splitData = splitStr.split(' ');
+				}
+				
+				
+				if(splitData.length == 0){// 데이터가 없는경우
+					
+					alert("탭으로 구분하여 데이터를 복사해 주세요.");
+				  	return false;
+				  
+				}else if(splitData.length == 1){// 데이터가 탭으로 구분이 없는 경우
+					
+					for(var j=0; j < splitData.length; j++){
+						if(checkHpNum(splitData[j].trim())){//핸드폰 양식이 맞는지 확인
+							//배열 끝에 데이터 추가해 주기
+							realPhone.push({phone: removeDash(splitData[j].trim()), name: ""});
+						}
+						else {
+							if (splitData[j].trim() != '' && splitData[j].trim() != null && splitData[j].trim() != undefined) {
+								tableErrorData.push(splitData[j].trim());
+							}
+						}
+					}
+				
+				}else{//데이터가 탭으로 구분되어 이름, 연락처로 구분된 경우
+					
+					var phone = "";	//핸드폰번호
+					var name = "";	//이름
+					var rep1 = "";	//치환문자1
+					var rep2 = "";	//치환문자2
+					var rep3 = "";	//치환문자3
+					var rep4 = "";	//치환문자4
+					var isPhoneValid = false;
+					for(var j=0; j < splitData.length; j++){
+
+						if(j == 0){
+							
+							name = splitData[j].trim();
+							
+						}
+						
+						if(j == 1){
+							
+							if(checkHpNum(splitData[j].trim())){//핸드폰 양식이 맞는지 확인
+								phone = removeDash(splitData[j].trim());
+								isPhoneValid = true;
+							}else{
+								if (splitData[j].trim() != '' && splitData[j].trim() != null && splitData[j].trim() != undefined) {
+									tableErrorData.push(splitData[j].trim());
+								}
+							}
+							
+						}
+						
+						if(j == 2){	//치환문자1
+							
+							rep1 = splitData[j].trim();
+							
+						}
+						
+						if(j == 3){	//치환문자2
+							
+							rep2 = splitData[j].trim();
+							
+						}
+						
+						if(j == 4){	//치환문자3
+							
+							rep3 = splitData[j].trim();
+							
+						}
+						
+						if(j == 5){	//치환문자4
+							
+							rep4 = splitData[j].trim();
+							
+						}
+						
+					}
+					
+					if (isPhoneValid == true) {
+						//배열 끝에 데이터 추가해 주기
+						realPhone.push({phone: phone, name: name, rep1 : rep1, rep2 : rep2, rep3 : rep3, rep4 : rep4 });
+					}
+					
+				}//else end
+				  
+			}
+			
+			var recTableData = tableL.getRows();		 // 받는사람 리스트의 전체 목록을 저장
+			var tableData = [];
+			
+			//기존 받는사람 리스트를 배열에 미리 담아둔다.
+			if(recTableData.length > 0){
+				
+				for(var j=0; j < recTableData.length; j++){
+					
+					tableData.push({phone: removeDash(recTableData[j].getData().phone.trim()) , name: recTableData[j].getData().name, rep1: recTableData[j].getData().rep1, rep2: recTableData[j].getData().rep2, rep3: recTableData[j].getData().rep3, rep4: recTableData[j].getData().rep4,  });
+				
+				}
+			
+			}
+			
+			if(realPhone.length > 0){
+				
+				for(var j=0; j < realPhone.length; j++){
+					
+					tableData.push({phone: removeDash(realPhone[j].phone.trim()) , name: realPhone[j].name, rep1: realPhone[j].rep1, rep2: realPhone[j].rep2, rep3: realPhone[j].rep3, rep4: realPhone[j].rep4});
+				
+				}
+			
+			}
+			
+			//tableData.push(realPhone);
+				
+			//중복 연락처 1개만 남기고 삭제하기
+			var removeDuplPhone = dupliPhoneData(tableData);
+			  
+			//수신자 리스트에 전화번호 추가해주기
+			//tableL.addData(removeDuplPhone);
+			tableL.setData(removeDuplPhone);
+			
+			totRows = tableL.getRows().length; 
+			updateTotCnt(totRows); //전체 데이터 갯수 구하기
+			
+			var smsTxtArea = $('#smsTxtArea').val();
+			
+			//일괄변환 문구 결제금액 처리
+			if(smsTxtArea.indexOf("[*이름*]") > -1
+					|| smsTxtArea.indexOf("[*1*]") > -1
+					|| smsTxtArea.indexOf("[*2*]") > -1
+					|| smsTxtArea.indexOf("[*3*]") > -1
+					|| smsTxtArea.indexOf("[*4*]") > -1){
+				
+				fnReplCell();
+			}else{
+				//결제 금액 구하기
+			    totalPriceSum(totRows);
+			}
+
+			if (tableErrorData.length > 0) {
+				alert("올바르지 않은 휴대폰 번호가 "+ tableErrorData.length +" 건 있습니다.");
+			}			
+			
+		}
+		  
+	}); */
+	
+	//받는사람 번호 버튼 클릭시 Tabulator에 데이터 넣어주기
+	$('.addCallToF').click(function(){ 
+		
+		var callToNum = $('#callTo').val();
+		if(callToNum == null || callToNum == ""){
+			
+			alert("받는사람 번호를 입력해 주세요.");
+			return false;
+			
+		}else if(!checkHpNum(callToNum)){	
+			
+			alert("올바른 전화번호를 입력해 주세요.");
+			$('#callTo').val("");
+			return false;
+		}
+		
+		//핸드폰 번호에 '-' 문자 제거하기
+		callToNum = removeDash(callToNum);
+		
+		var form = document.callToForm;
+		var callToArr = [];
+		
+		callToArr.push(callToNum);
+		form.callToArr.value = callToArr;
+		
+		var data = new FormData(form);
+		
+		var url = "/web/mjon/msgcampain/insertMsgTWCallToOneNumberAddAjax.do";
+		
+		$.ajax({
+	        type: "POST",
+	        url: url,
+	        data: data,
+	        dataType:'json',
+	        async: true,
+	        processData: false,
+	        contentType: false,
+	        cache: false,
+	        success: function (returnData, status) {
+				if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+					
+					var result = returnData.result;
+					var message = returnData.message;
+					
+					if(result == "success"){
+						
+						var callSeq = returnData.callSeq;
+						
+						if(callSeq != null){
+							$("#callSeq").val(callSeq);
+						}
+						
+						//입력된 데이터베이스에서 받는사람 20건 불러와서 화면에 표시해주기
+						var callSeq = $("#callSeq").val();
+						if(callSeq > 0){
+							
+							//첨부파일로 불러온 데이터를 받는사람 목록에 추가해 준다.
+							addTWCallToInfo();
+							
+							$('#callTo').val("");
+							
+						}else{
+							
+							alert("추가할 연락처가 없습니다.");
+							return false;
+							
+						}
+						
+					}else{
+						alert(message);
+						$('#callTo').val("");
+						return;
+						
+					}
+				} else if(status== 'fail'){
+					alert("연락처를 추가하는 중 오류가 발생하였습니다.");
+					console.log("status : fail ~");
+				}
+			},
+			error: function (e) { 
+	        	alert("연락처를 추가하는 중 오류가 발생하였습니다."); 
+	        	console.log("ERROR : ", e); 
+	        },
+			beforeSend : function(xmlHttpRequest) {
+	        	//로딩창 show
+	        	$('.loading_layer').addClass('active');				
+			},	        	        
+	        complete : function(xhr, textStatus) {
+	        	//로딩창 hide
+	        	$('.loading_layer').removeClass('active');
+			}
+	    });
+	    
+	});
+	
+	
+	//받는사람 전체삭제 버튼 처리
+	$('.all_del').click(function(){
+		
+		var data = $('.liCallTo').length;
+	
+		if(data == 0){
+			
+			alert("받는사람을 추가해 주세요.");
+			return false;
+		
+		}else{
+			
+			if(confirm("받는사람 목록을 모두 삭제하시겠습니까?")){
+				
+				var callToArr = [];
+				
+				//받는사람 목록의 리스트 전체 데이터 불러와서 배열에 저장
+				//화면에 불러와져있는 최대 20개의 리스트만 삭제
+				$("input[name=chkCallTo]").each(function(){
+					
+					var cmpTmpId = $(this).val();
+					callToArr.push(cmpTmpId);
+					
+				});
+				
+				var form = document.callToForm;
+				form.callToArr.value = callToArr;
+				
+				//수신목록 삭제 요청 한다.
+				fnCallToListDel(callToArr.length);
+				
+			}
+	
+		}
+		
+	});
+	
+	
+	// 받는사람 선택삭제 버튼 처리해주기
+	$('.select_del').click(function(){
+		
+		var data = $('.liCallTo').length;
+		
+		if(data == 0){
+			
+			alert("받는사람을 추가해 주세요.");
+			return false;
+		
+		}
+		
+		var chkSts = $('input:checkbox[name="chkCallTo"]').is(':checked');
+		
+		if(!chkSts){
+			alert("삭제할 연락처를 선택해 주세요.");
+			return false;
+		}else{ // 선택한 Row 데이터 삭제하기
+			
+			if(confirm("선택하신 받는 사람을 삭제하시겠습니까?")){
+				
+				var callToArr = [];
+				
+				//받는사람 목록의 리스트 체크선택된 값만 가져온다.
+				//화면에 체크된 수신목록만 삭제한다.
+				$("input:checkbox[name='chkCallTo']:checked").each(function(){
+					
+					var cmpTmpId = $(this).val();
+					callToArr.push(cmpTmpId);
+					
+				});
+				
+				var form = document.callToForm;
+				form.callToArr.value = callToArr;
+				
+				//선택된 수신목록 삭제 요청 한다.
+				fnCallToListDel(callToArr.length);
+				
+			}
+
+		}
+		
+	});
+	
+	
+	//주소록 불러오기 버튼 클릭시
+	$('.popupAddr').click(function(){
+		
+		var login = '${LoginVO.id}';
+		
+		if(login == null || login == ''){
+			
+			alert("로그인 후 이용이 가능합니다.");
+			return false;
+			
+		}
+		
+		$("#addrGroupLoad").load("/web/mjon/msgcampain/selectAddrGroupListAjax.do", "" ,function(response, status, xhr){
+			//리스트 스크롤 처리해주기
+			$(".adr_pop_list").mCustomScrollbar({
+				axis: 'y',
+				scrollbarPosition: "outside",
+				theme: "dark",
+				autoHideScrollbar: false
+			});
+		});
+		
+	});
+	
+	//엑섹불러오기 버튼 클릭시 파일 첨부 실행
+	$('.c3').click(function(){ // 엑셀파일 불러오기 선택 시
+		
+		$("#excelFile").click();
+		
+	});
+	
+	//최근전송내역 팝업 선택추가 버튼 처리(체크내역 받는사람 리스트로 추가해주기)
+	$(document).on('click', '#latestAddPhone', function (){
+		var addPhoneList = []; //신규로 추가할 전화번호 저장변수
+		$("input:checkbox[name='latAddrChk']:checked").each(function(index){
+			var chkPhone = $(this).val();
+			if(!checkHpNum(chkPhone)){
+				alert("올바른 전화번호가 아닙니다.");
+				return false;
+			}else{
+				addPhoneList.push({phone: removeDash(chkPhone.trim())});
+			}
+		});
+		
+		if(addPhoneList.length > 0){
+			//연락처 추가해 주기
+			addPhoneInfo(addPhoneList);
+			$("#btnLatestAddPhoneClose").trigger("click");
+		}
+		else {
+			alert("연락처를 선택해주세요.");
+			return false;
+		}		
+	});
+	
+	//최근전송내역 팝업 전체추가 버튼 처리
+	$(document).on('click', '#latestAddPhoneAll', function (){
+		var addPhoneList = []; //신규로 추가할 전화번호 저장변수
+		$("input:checkbox[name='latAddrChk']").each(function(index){
+			var chkPhone = $(this).val();
+			if(!checkHpNum(chkPhone)){
+				alert("올바른 전화번호가 아닙니다.");
+				return false;
+			}else{
+				addPhoneList.push({phone: removeDash(chkPhone.trim())});
+			}
+		});
+		
+		if(addPhoneList.length > 0){
+			//연락처 추가해 주기
+			addPhoneInfo(addPhoneList);
+			$("#btnLatestAddPhoneClose").trigger("click");
+		}
+		else {
+			alert("연락처가 없습니다.");
+			return false;
+		}		
+	});
+	
+	//최근전송내역 팝업 선택 취소 버튼 처리
+	$(document).on('click', '#latestCancelPhone', function (){
+		
+		$("input[name=latAddrChk]").prop("checked", false);
+		
+	});
+	
+	//최근전송내역 팝업 삭제 버튼 처리
+	$(document).on('click', '#latestAddrDel', function (){
+		
+		$(this).parent("#latestLi").remove();
+		
+	});
+	
+	//자주보내는 번호 팝업 선택추가 버튼 처리(체크내역 받는사람 리스트로 추가해주기)
+	$(document).on('click', '#bookMarkAddPhone', function (){
+		var addPhoneList = []; //신규로 추가할 전화번호 저장변수
+		$("input:checkbox[name='bookAddrChk']:checked").each(function(index){
+			var chkPhone = $(this).val();
+			if(!checkHpNum(chkPhone)){
+				alert("올바른 전화번호가 아닙니다.");
+				return false;
+			}else{
+				addPhoneList.push({phone: removeDash(chkPhone.trim())});
+			}
+		});
+		
+		if(addPhoneList.length > 0){
+			//연락처 추가해 주기
+			addPhoneInfo(addPhoneList);
+			$("#btnLatestAddPhoneClose").trigger("click");
+		}
+		else {
+			alert("연락처를 선택해주세요.");
+			return false;
+		}		
+	});
+	
+	//자주보내는 번호 팝업 선택추가 버튼 처리(체크내역 받는사람 리스트로 추가해주기)
+	$(document).on('click', '#bookMarkAddPhoneAll', function (){
+		var addPhoneList = []; //신규로 추가할 전화번호 저장변수
+		$("input:checkbox[name='bookAddrChk']").each(function(index){
+			var chkPhone = $(this).val();
+			if(!checkHpNum(chkPhone)){
+				alert("올바른 전화번호가 아닙니다.");
+				return false;
+			}else{
+				addPhoneList.push({phone: removeDash(chkPhone.trim())});
+			}
+		});
+		
+		if(addPhoneList.length > 0){
+			//연락처 추가해 주기
+			addPhoneInfo(addPhoneList);
+			$("#btnLatestAddPhoneClose").trigger("click");
+		}
+		else {
+			alert("연락처가 없습니다.");
+			return false;
+		}		
+	});
+	
+	//자주보내는 번호 팝업 선택 취소 버튼 처리
+	$(document).on('click', '#bookMarkCancelPhone', function (){
+		
+		$("input[name=bookAddrChk]").prop("checked", false);
+		
+	});
+	
+	//자주보내는 번호 팝업 삭제 버튼 처리
+	$(document).on('click', '#bookMarkAddrDel', function (){
+		
+		$(this).parent("#bookMarkLi").remove();
+		
+	});
+	
+	
+	//오류 검사 버튼 처리
+	$('.check_validity').click(function(){
+		
+		var data = $('.liCallTo').length;
+		
+		if(data == 0){
+			
+			alert("받는사람을 추가해 주세요.");
+			return false;
+		
+		}else{
+				
+			var callToArr = [];
+			//받는사람 목록의 리스트 전체 데이터 불러와서 배열에 저장
+			//화면에 불러와져있는 최대 20개의 리스트만 삭제
+			$(".liCallTo a div span").each(function(){
+				
+				var callTo = $(this).text();
+				
+				//전화번호 유효성 체크 해주기
+				var callSts = checkHpNum(callTo);
+				
+				if(!callSts){
+					
+					callToArr.push(callTo);
+					
+				}
+				
+			});
+			
+			if(callToArr.length > 0){
+				
+				alert("받는사람 목록 중 ["+ callToArr + "] 번호에 오류가 있습니다.");
+				return false;
+				
+			}else{
+				
+				alert("받는사람 번호에는 오류가 없습니다.");
+				return false;
+				
+			}
+			
+		}
+		
+	});
+	
+	//문자입력창의 첨부된 이미지 순서를 바꿀 때
+	$(document).on('mouseup', '.thumb_wrap img', function (){
+		//미리보기 창의 이미지 순서를 변경한다
+		setTimeout(function() { 
+			var previewHtml = "";
+			var imgCnt = $("#imgCnt").val();
+			//이미지 갯수만큼 for문 돌림
+
+			for(var i=0; i<imgCnt; i++) {
+				var imgTag = $(".thumb_wrap li:eq("+i+") div").html(); // 썸네일에 있는 이미지 태그 가져오기
+				previewHtml += '<div class="img_box preBoxF on_scroll_img" id="preBoxF'+(i+1)+'">'
+				previewHtml += imgTag;
+				previewHtml += '</div>'
+			}
+			$('.preViewShort div').remove(); //미리보기 영역에 있던 이미지 다 지우고
+			$('.preViewShort').append(previewHtml);  //새로 sorting된 이미지 그려주기
+		}, 100);
+		
+	});
+	
+	//문자 샘플 탭, 그림문자 샘플 탭 선택시 옵션 초기화
+	$('.tab').click(function(){
+
+		var index = $(this).index();
+		var form = document.letterForm;
+		
+		if($(this).hasClass("active") === true){
+			
+			if(index == 0){
+				
+				form.pageIndex.value = 1;
+				form.letterType.value = "S";
+				form.categoryCode.value = "";
+				form.hashTag.value = "";
+			
+			}else if(index == 1){
+				
+				form.pageIndex.value = 1;
+				form.letterType.value = "P";
+				form.categoryCode.value = "";
+				form.hashTag.value = "";
+				
+			}else if(index == 2){
+				
+				setTimeout(function(){ 
+			    	map.relayout();
+			    	map.setCenter(testcoords);
+			    }, 0);
+				
+			}
+		
+		}
+		
+	});
+	
+	
+	//이미지 선택시 그림문자 처리
+	$(document).on('click', '.photoOnImg', function(){ 
+		
+		// 클릭 시 조회수 증가 로직
+		var letterId = $(this).attr('id');
+		
+		var url = "/web/mjon/msgdata/updateSmsTemplateCntAjax.do";
+		
+		$.ajax({
+			type: "POST",
+			url: url,
+			data: {'letterId':letterId},
+			dataType:'json',
+			async: false,
+			cache: false,
+			success: function (returnData, status) {
+				console.log("status : ", status);
+			},
+			error: function (e) {console.log("ERROR : ", e); }
+		});
+		// 클릭 시 조회수 증가 로직 끝
+		
+		var imgId = $(this).parent().find("input").val();
+		imageControl($(this), "edit_n", "Template", imgId);
+		
+		var contents = $('#smsTxtArea').val();
+		//(contents);
+		
+		
+		//결제금액 표시해주기
+		fnChkCallToChange();
+
+		var sendOfT=$('.send_top').offset().top;
+		$('html,body').stop().animate({'scrollTop':sendOfT-60},250);
+		
+	});
+	
+	
+	//그림문자 이미지 삭제 처리 - 동적으로 추가한 객체는 on 함수로 불러올 수 있다.
+	$(document).on('click', '.file_close', function(){ 
+		var delImgPath = ""; //삭제하려는 이미지 경로 받아오기 
+		var index = $(this).parent().index(); // 현재 선택 된 객체 인덱스 번호 받아오기
+		var imgCnt = $("#imgCnt").val(); // 현재 첨부된 이미지의 갯수
+		var contents = $('#smsTxtArea').val();
+		
+		//선택한 태그의 부모 이미지 li 객체 삭제
+		$(this).parent(".delLi").remove();
+		
+		//미리보기 화면에서의 이미지 객체 삭제
+		//삭제하려는 이미지 경로 받아오기
+		delImgPath = $('.preBoxF').eq(index).find("img").attr("src");
+		
+		$('.preBoxF').eq(index).remove();
+		
+		// 삭제한 이미지 경로 배열에서 삭제해 주기
+		for(var i=0; i < imgFilePath.length; i++){
+			
+			if(imgFilePath[i] == delImgPath){
+				
+				imgFilePath.splice(i, 1); //이미지 경로 삭제
+				imgFileId.splice(i, 1);   //이미지 아이디 삭제 - 내 문자 보관함 저장용으로 사용
+				i--;
+			}
+			
+		}
+		
+		//imgCnt--;
+		$("#imgCnt").val(Number(imgCnt) - 1);
+		
+		//미리보기 포토 1,2,3 번 번호 표시 변경
+		$('.photo_num_02').hide();
+		$('.photo_num_03').hide();
+		if(imgCnt > 2){
+			
+			$('.photo_num_01').show();
+			$('.photo_num_02').show();
+			
+			
+		}else if(imgCnt > 1){
+			$('.photo_num_01').show();
+			
+		}else{
+			
+			//그림을 모두 삭제 했을때 단문으로 변경
+			$('.preShort').show();
+			$('.prePhoto').hide();
+			
+			$('.msg_com').removeClass("msg_photo");
+			$('.msg_com').addClass("msg_short");
+			$('.put_left').removeClass("photo");
+			$('#msgType').val("4"); // 메세지 타입 설정
+			
+			fnByteString(contents);
+			
+		}
+		
+		//수신목록 전체 데이터 갯수 구하기
+		fnChkCallToChange();
+		
+		var scrollHei = $(".mCustomScrollBox").height();
+		if(scrollHei > 488) {
+			$(".img_box").removeClass("on_scroll_img");
+		}
+		
+	}); 
+	
+	// 초기화 버튼 처리
+	$('.btnReset').click(function(){
+		
+		//일반문자 라이오 선택해 주기
+		$("#send_adYnN").prop("checked", true);
+		
+		$('.delLi').each(function(){
+			
+			$(this).remove();
+			
+		});
+		
+		$('.preBoxF').each(function(){
+			
+			$(this).remove();
+			
+		});
+		
+		//그림 카운트 초기화
+		$('#imgCnt').val(0);
+		
+		//그림을 모두 삭제 했을때 단문으로 변경
+		$('.preShort').show();
+		$('.prePhoto').hide();
+		
+		$('.msg_com').removeClass("msg_photo");
+		$('.msg_com').addClass("msg_short");
+		$('#msgType').val("4"); // 메세지 타입 설정
+		
+		//메세지 내용 초기화
+		$('#smsTxtArea').val("");
+		fnByteString("");
+		
+	});
+	
+	// 동적으로 추가해주기 때문에 on 사용
+	$(document).on('click', '.letterMsg', function(){ //문자 템플릿 선택시 상단 문자 내용에 입력해주기 
+	
+		// 클릭 시 조회수 증가 로직
+		var letterId = $(this).attr('id');
+		
+		var url = "/web/mjon/msgdata/updateSmsTemplateCntAjax.do";
+		
+		$.ajax({
+			type: "POST",
+			url: url,
+			data: {'letterId':letterId},
+			dataType:'json',
+			async: false,
+			cache: false,
+			success: function (returnData, status) {
+				console.log("status : ", status);
+			},
+			error: function (e) {console.log("ERROR : ", e); }
+		});
+		// 클릭 시 조회수 증가 로직 끝
+		
+		
+		/* var smsTxtArea = $(this).find('.msg_text').text(); */
+		var smsTxtArea = $(this).find('.msg_text').html();
+				
+		smsTxtArea = smsTxtArea.replace(/(<br>|<br\/>|<br \/>)/g, '\n');
+		$('#smsTxtArea').val("");
+		$('#smsTxtArea').val(smsTxtArea);
+		fnByteString(smsTxtArea);
+
+		var sendOfT=$('.send_top').offset().top;
+		$('html,body').stop().animate({'scrollTop':sendOfT-60},250);
+		
+	});
+	
+	// 동적으로 추가해주기 때문에 on 사용
+	$(document).on('click', '.btnSearchF', function(){ // 검색 기능 실행 
+		
+		var formL = document.letterForm;
+		var formM = document.myMsgForm;
+		formL.categoryCode.value = ""; //해시태그 검색 시 카테고리 제거
+		formL.upperCateNo.value = ""; //해시태그 검색 시 카테고리 제거
+		/* if(form.searchKeyword.value == ""){
+			
+			alert("검색어를 입력해 주세요.");
+			return false;
+			
+		} */
+		
+		var tabIndex = $(".selectedTab").children(".active").index();
+
+		//문자 리스트 불러오기 
+		if(tabIndex == 0) {
+			formL.letterType.value="S";
+			fnLetterListAjax();
+		}
+		//그림 문자 리스트 불러오기
+		if(tabIndex == 1) {
+			formL.letterType.value="P";
+			fnPhotoListAjax();
+		}
+		//내문자함 리스트 불러오기
+		if(tabIndex == 3) {
+			formM.searchKeyword.value = formL.searchKeyword.value; //letterForm의 검색어를 문자함 검색어 부분에 입력해줌
+			fnMyMsgListAjax();
+		}
+		$('.bottom_content.current .area_total_count').show();
+		return false;
+	});
+	
+	//탭 선택시에 검색자 초기화하여 검색하기
+	$(document).on('click', '.selectedTab', function(){ 
+		var formL = document.letterForm;
+		var formM = document.myMsgForm;
+		formL.categoryCode.value = ""; //탭 선택시 카테고리 제거
+		formL.upperCateNo.value = ""; //탭 선택시 카테고리 제거
+		
+		var tabIndex = $(".selectedTab").children(".active").index();
+		
+		//2줄보기, 4줄보기 초기화
+		$("#LPageUnit option:eq(0)").prop("selected", true);
+		$("#PhPageUnit option:eq(0)").prop("selected", true);
+		$("#msgPageUnit option:eq(0)").prop("selected", true);
+
+		$('.bottom_content .area_total_count').hide();
+		 
+		//문자 리스트 불러오기 
+		if(tabIndex == 0) {
+			formL.letterType.value="S";
+			formL.pageUnit.value = "10";
+			formL.searchKeyword.value="";
+			fnLetterListAjax(1);
+		}
+		//그림 문자 리스트 불러오기
+		if(tabIndex == 1) {
+			formL.letterType.value="P";
+			formL.pageUnit.value = "10";
+			formL.searchKeyword.value="";
+			fnPhotoListAjax(1);
+		}
+		//내문자함 리스트 불러오기
+		if(tabIndex == 3) {
+			formL.pageUnit.value = "10";
+			formM.searchKeyword.value = "";
+			fnMyMsgListAjax(1);
+		}
+		
+	});
+	
+	/*
+	
+		단문 / 장문 탭 옵션 선택시 실행 
+	
+	**/
+	
+	$('.tDep1_mType').click(function(){ // 전체,기업, 개인 선택 옵션 처리
+		
+		var mType = $(this).find('.on').text();
+		var form = document.letterForm;
+		
+		if(mType == "전체"){
+			
+			form.memberType.value = "";
+			
+		}else if(mType == "기업"){
+			
+			form.memberType.value = "B";
+			
+		}else{
+			
+			form.memberType.value = "P";
+			
+		}
+		
+		//문자 리스트 불러오기
+		//form.letterType.value = "S";
+		form.categoryCode.value = "";
+		form.hashTag.value = "";
+		form.pageIndex.value = 1;
+		
+		//문자 리스트 불러오기
+		fnLetterListAjax(1);
+		
+	});
+	
+	$('.tDep1_letType').click(function(){ // 단문, 장문 선택 시 옵션처리
+		
+		var letterType = $(this).find('.on').attr("value");
+		var form = document.letterForm;
+		
+		form.letterType.value = letterType;
+		
+		//문자 리스트 불러오기
+		fnLetterListAjax(1);
+		
+	});
+	
+	$('.tDep1_cateCode').click(function(){ // 카테고리 선택 시 옵션 처리
+		
+		var cateCode = $(this).find('.on').attr("value");
+		var form = document.letterForm;
+		
+		if(cateCode == "all"){ //전체 선택시
+			
+			cateCode = "";	
+		
+		} else {
+			//카테고리 코드 클릭 시 해쉬태그 초기화 후 전체 선택
+			form.hashTag.value="";
+			$('.tDep1_hashTag').find('.on').removeClass('on');
+			$('.tDep1_hashTag').find('.hashAll').addClass('on');
+		}
+		form.upperCateNo.value = "";
+		form.categoryCode.value = cateCode;
+		form.pageIndex.value = 1;
+		//카테고리 클릭 시 검색자 초기화
+		form.searchKeyword.value = "";
+		
+		//문자 리스트 불러오기
+		fnLetterListAjax(1);
+		
+	});
+	
+	$('.tDep1_threeCateCode').click(function(){ // 하위 카테고리 선택 시 문자샘플 조회
+		var cateCode = $(this).find('.on').attr("value");
+		var form = document.letterForm;
+		var upperCateNo = $(this).siblings('div').find('.on').attr('value');
+		form.upperCateNo.value = upperCateNo;
+		form.categoryCode.value=cateCode;
+		//해쉬태그 검색자 초기화
+		form.searchKeyword.value = "";
+		form.pageIndex.value = 1;
+		
+		//문자 리스트 불러오기
+		fnLetterListAjax(1);
+		
+	});
+	
+	$('.tDep1_hashTag').click(function(){ // 해시 태그 선택 시 옵션 처리
+		var hashTag = $(this).find('.on').attr("value");
+		var form = document.letterForm;
+		
+		//해쉬태그 클릭 시 카테고리코드 초기화 후 전체 선택
+		form.categoryCode.value="";
+		$('.tDep1_cateCode').find('.on').removeClass('on');
+		$('.tDep1_cateCode').find('.cateAll').addClass('on');
+		//해쉬태그 클릭 시 검색자 초기화
+		form.searchKeyword.value = "";
+		
+		form.hashTag.value = hashTag;
+		form.pageIndex.value = 1;
+		
+		//문자 리스트 불러오기
+		fnLetterListAjax(1);
+		
+	});
+	
+	
+	/*
+		
+		그림문자 탭 옵션 선택시 사용
+	
+	*/
+	
+	$('.tDep2_mType').click(function(){ // 전체,기업, 개인 선택 옵션 처리
+		
+		var mType = $(this).find('.on').text();
+		var form = document.letterForm;
+		
+		if(mType == "전체"){
+			
+			form.memberType.value = "";
+			
+		}else if(mType == "기업"){
+			
+			form.memberType.value = "B";
+			
+		}else{
+			
+			form.memberType.value = "P";
+			
+		}
+		
+		//문자 리스트 불러오기
+		form.letterType.value = "P";
+		form.categoryCode.value = "";
+		form.hashTag.value = "";
+		form.pageIndex.value = 1;
+		
+		fnPhotoListAjax();
+		
+	});
+	
+	$('.tDep2_letType').click(function(){ // 그림문자 선택 
+		
+		var letterType = $(this).find('.on').attr("value");
+		var form = document.letterForm;
+		form.letterType.value = 'P';
+		
+		//문자 리스트 불러오기
+		fnPhotoListAjax(1);
+		
+	});
+	
+	$('.tDep2_cateCode').click(function(){ // 그림 문자 카테고리 선택 시 옵션 처리
+		
+		var cateCode = $(this).find('.on').attr("value");
+		var form = document.letterForm;
+		
+		if(cateCode == "all"){ //전체 선택시
+			
+			cateCode = "";	
+		
+		} else {
+			//카테고리 코드 클릭 시 해쉬태그 초기화 후 전체 선택
+			form.hashTag.value="";
+			$('.tDep2_hashTag').find('.on').removeClass('on');
+			$('.tDep2_hashTag').find('.hashAll').addClass('on');
+		}
+		form.upperCateNo.value = "";
+		form.categoryCode.value = cateCode;
+		form.pageIndex.value = 1;
+		//카테고리 클릭 시 검색자 초기화
+		form.searchKeyword.value = "";
+		//문자 리스트 불러오기
+		fnPhotoListAjax(1);
+		
+	});
+	
+	$('.tDep2_threeCateCode').click(function(){ // 하위 카테고리 선택 시 문자샘플 조회
+		var cateCode = $(this).find('.on').attr("value");
+		var form = document.letterForm;
+		var upperCateNo = $(this).siblings('div').find('.on').attr('value');
+		form.upperCateNo.value = upperCateNo;
+		form.categoryCode.value=cateCode;
+		//해쉬태그 검색자 초기화
+		form.searchKeyword.value = "";
+		form.pageIndex.value = 1;
+		
+		//그림문자 리스트 불러오기
+		fnPhotoListAjax(1);		
+	});
+	
+	$('.tDep2_hashTag').click(function(){ // 그림문자 해시 태그 선택 시 옵션 처리
+		var hashTag = $(this).find('.on').attr("value");
+		var form = document.letterForm;
+		
+		//해쉬태그 클릭 시 카테고리코드 초기화 후 전체 선택
+		form.categoryCode.value="";
+		$('.tDep2_cateCode').find('.on').removeClass('on');
+		$('.tDep2_cateCode').find('.cateAll').addClass('on');
+		//해쉬태그 클릭 시 검색자 초기화
+		form.searchKeyword.value = "";
+		
+		form.hashTag.value = hashTag;
+		form.pageIndex.value = 1;
+		
+		//문자 리스트 불러오기
+		fnPhotoListAjax(1);
+	});
+	
+	
+	$(".fontPlus").click(function () {
+		var currentSize = $(".preview_auto").css("fontSize");
+		var size = parseInt(currentSize, 10) * 1.2;
+		var unit = currentSize.slice(-2);
+		if(size > 65){
+			return false;
+		}
+		$(".preview_auto").css("fontSize", size+unit);
+	});
+	
+	$(".fontMinus").click(function () {
+		var currentSize = $(".preview_auto").css("fontSize");
+		var size = parseInt(currentSize, 10) / 1.2;
+		var unit = currentSize.slice(-2);
+		if(size < 10){
+			return false;
+		}
+		$(".preview_auto").css("fontSize", size+unit);
+	});
+	
+	//즉시, 예약 선택시 날짜 영역 초기 표시
+	var reYn = $("input[name=reserYn]:checked").val();
+	
+	if(reYn == "N"){
+		$('.rev_selected').hide();
+	}else{
+		$('.rev_selected').show();
+	}
+	
+	//즉시 발송 라디오 버튼 선택시 숨김처리
+	$("#reserYnN").on('click', function(){
+		$('.rev_selected').hide();
+		$('.send_rev .send_content').css('padding-bottom','108px');
+		$('.send_btn .btnType:first-child').html('발송하기');
+	});
+	
+	//예약 발송 라디오 버튼 선택시 숨김 해제처리
+	$("#reserYnY").on('click', function(){
+		$('.rev_selected').show();
+		$('.send_rev .send_content').css('padding-bottom','0');
+		$('.send_btn .btnType:first-child').html('예약하기');
+	});
+});
+
+//선거 후보자 등록 알림 메세지 처리
+function fn_candidateChk(){
+	alert("선거 후보자를 등록이 되어야 문자 발송이 가능합니다. 후보자 등록을 해주세요.");
+	return false;
+	
+}
+	
+//문자 바이트수 계산하기 함수
+function fnByteString(contents){
+	
+	var totalByte = 0; 
+	//var content = contents;
+	var adverYn = $("input[name='send_adYn']").val();
+	var adTxtLeng = conByteLeng($('.ad_txt').text());
+	var denyTxtLeng = 0;
+	var denyTxt = $('.deny_txt').html();
+	
+	//선거문자 하단 문구 줄바꿈 처리하기
+	if(typeof denyTxt !='undefined' && denyTxt != null){
+		
+		denyTxt = denyTxt.replaceAll("<br>","\n");
+		denyTxt = denyTxt.replaceAll("<br/>","\n");
+		denyTxtLeng = conByteLeng(denyTxt);
+		
+	}
+	
+	
+	$('#msgLeng').html("");
+	$('#limitLeng').html("");
+	var conLeng = conByteLeng(contents); // 내용 문자 입력 바이트 수 계산하기
+	
+	//일반문자, 광고문자에 따른 문자 길이 변경해주기
+	if(adverYn == "N"){
+		
+		$('#msgLeng').text(conLeng);
+		
+		//문자 길이 변수에 저장해주기
+		$('#smsLen').val(conLeng);
+		
+	}else{
+		
+		conLeng = adTxtLeng + conLeng + denyTxtLeng +2; // 상단 광고 텍스트 , 하단 080 문자내용 길이 더해주기 , +2는 엔터 적용
+		$('#msgLeng').text(conLeng);
+		
+		//문자 길이 변수에 저장해주기
+		$('#smsLen').val(conLeng);
+		
+	}
+	
+	var photoSts = $('.delLi').length;
+	if(photoSts > 0){
+		
+		$('#msgLeng').html(conLeng + " / ");
+		$('#limitLeng').html("2000");
+		$('.msg_com').html("그림");
+		$('#msgType').val("6"); // 메세지 타입 설정
+		
+		$('.msg_com').removeClass("msg_short"); //단문 클래스 삭제하고
+		$('.put_left').removeClass("short"); //내용 입력 박스 클래스 삭제
+		$('.msg_com').removeClass("msg_long"); //장문 클래스 삭제하고
+		$('.put_left').removeClass("long"); //내용 입력 박스 클래스 삭제
+		$('.msg_com').addClass("msg_photo"); // 그림 클래스 삽입
+		$('.put_left').addClass("photo");  // 내용 입력 박스에 클래스 삽입
+		$('.put_left').css("display","block");  // 내용 입력 박스에 클래스 삽입
+		$('.msg_title').addClass('active');
+		
+		//document.getElementById("mmsSubject").disabled = false;
+		
+	}else{
+		
+		if(conLeng > 90){
+			
+			$('#msgLeng').html(conLeng + " / ");
+			$('#limitLeng').html("2000");
+			$('.msg_com').html("장문");
+			$('#msgType').val("6"); // 메세지 타입 설정
+			
+			$('.msg_com').removeClass("msg_short"); //단문 클래스 삭제하고
+			$('.put_left').removeClass("short"); //내용 입력 박스 클래스 삭제
+			$('.msg_com').addClass("msg_long"); // 장문 클래스 삽입
+			$('.put_left').addClass("long");  // 내용 입력 박스에 클래스 삽입
+			$('.msg_title').addClass('active');
+			
+			//document.getElementById("mmsSubject").disabled = false;
+			
+		}else{
+			
+			$('#msgLeng').html(conLeng + " / ");
+			$('#limitLeng').html("90");
+			$('.msg_com').html("단문");
+			$('#msgType').val("4"); // 메세지 타입 설정
+			$('.msg_com').removeClass("msg_long"); //단문 클래스 삭제하고
+			$('.put_left').removeClass("long"); //내용 입력 박스 클래스 삭제
+			$('.msg_com').addClass("msg_short"); // 장문 클래스 삽입
+			$('.put_left').addClass("short");  // 내용 입력 박스에 클래스 삽입
+			$('.msg_title, .title_wrap .textbox').removeClass('active');
+			$('#mmsSubject').val("");
+			$('#title_y').prop('checked',false);
+			$('#title_n').prop('checked',true);
+			
+			//제목 비활성화로 내용 지워주기
+			/* $('#mmsSubject').val("");
+			document.getElementById("mmsSubject").disabled = true; */
+			
+		}
+		
+	}
+	
+	
+	// 미리보기 데이터 입력해 주기 , 줄바꿈 문자 변환해주기
+	//var repContent = "";
+	//repContent = content.replace(/(?:\r\n|\r|\n)/g, '<br/>');
+	
+	
+	if(conLeng > 0){
+		
+		$('.none_txt').text("");
+		
+	}else{
+		
+		$('.none_txt').text("내용을 입력해주세요.");
+		
+	}
+	
+	//미리보기에 내용 입력해 주기
+	$('.realtime').text(contents);
+
+	// 2000byte 초과시 메세지 알림
+	if(conLeng > 2000){
+		
+		//2000바이트 초과시 문자열 잘라서 보여주기
+		var subUnderStr = strUnderLineSubstring(contents, 2000);
+		$('#smsTxtArea').val(subUnderStr);
+		
+		//문자 바이트수 수정해주기
+		$('#msgLeng').text(conByteLeng(subUnderStr));
+		
+		//문자 길이 변수에 저장해주기
+		$('#smsLen').val(conByteLeng(subUnderStr));
+		
+ 		alert("문자 내용은 2000byte를 넘을 수 없습니다.");
+		return false;
+	}
+	
+	//수신목록 전체 데이터 갯수 및 발송 금액 처리하기
+	fnChkCallToChange();
+	
+}
+	
+function openPhotoEditor() {
+	var imgCnt = $("#imgCnt").val();
+	
+	if(imgCnt >= 3) {
+		alert("메시지에 첨부할 수 있는 이미지는 최대 3장입니다.");
+		return;		
+	}
+	
+    //만들려는 팝업의 크기
+    var popup_wid = '1100';
+    var popup_ht = '851';
+
+    //중앙 정렬을 위해 윈도우 스크린의 width,height 구하는 변수 만듦
+    var popup_left = (window.screen.width / 2) - (popup_wid / 2);
+    var popup_top =(window.screen.height / 2) - (popup_ht / 2);
+
+    window.open('<c:url value='/web/mjon/msgcampain/openImageEditorPopup.do'/>', 'a', 'width=' + popup_wid +', height='+ popup_ht +', left=' + popup_left + ', top='+ popup_top + ', scrollbar=no' );
+
+}
+
+//그림샘플 이미지 선택시 문자 내용에 입력 처리
+function imageControl(obj, editYn, imageName, imgId) {
+	
+	var imgCnt = $("#imgCnt").val(); // 현재 페이지에 첨부된 이미지 갯수
+	var imgSrc = obj.attr("src");
+	
+	if(imgCnt >= 3){
+		alert("이미지는 3장만 선택할 수 있습니다.");
+		return false;
+	}
+
+	$('.preShort').hide();
+	$('.prePhoto').show();
+	
+	if($('.msg_com').hasClass("msg_short") === true){
+		
+		$('.msg_com').removeClass("msg_short"); //단문 클래스 삭제하고
+		$('.msg_com').addClass("msg_photo"); // 그림문자용 클래스 삽입
+		$('.put_left').removeClass("short");
+		$('.put_left').addClass("photo");
+		$('.msg_com').html("그림");
+		$('#msgType').val("6"); // 메세지 타입 설정
+		
+		//제목 입력 항목 활성화
+		//document.getElementById("mmsSubject").disabled = false;
+		
+	}else{
+		
+		$('.msg_com').removeClass("msg_long"); //장문 클래스 삭제하고
+		$('.msg_com').addClass("msg_photo"); // 그림문자용 클래스 삽입
+		$('.put_left').removeClass("long");
+		$('.put_left').addClass("photo");
+		$('.msg_com').html("그림");
+		$('#msgType').val("6"); // 메세지 타입 설정
+		
+		//제목 입력 항목 활성화
+		//document.getElementById("mmsSubject").disabled = false;
+		
+	}
+	
+	//이미지 카운트 증가시키기
+	//imgCnt ++;
+	$("#imgCnt").val(Number(imgCnt)+1);
+	
+	
+	//문자 내용 상단에 이미지 이름 영역 객체 추가해주기
+	var imgPath = '<img src="' + imgSrc + '" class="thumb_img '+ editYn +'" alt="thumb1"/>';
+	var liPath = '<li class="delLi '+imageName+'" id="delLi'+ imgCnt +'">'
+				+ '<div>'+ imgPath+ '</div>'
+				+ '<button type="button" class="file_close"><img src="/publish/images/content/thumb_del.png" alt="첨부파일 삭제"></button>'
+				+ '<button type="button" class="file_close_on"><img src="/publish/images/content/thumb_del_on.png" alt="첨부파일 삭제"></button>'
+				+ '</li>';
+				
+				
+		/* "<li class=\"delLi\"><p>" + imgPath + "</p><button type=\"button\" class=\"file_close\"><img class=\"delImg\" src=\"/publish/images/content/file_close.png\" alt=\"첨부파일 삭제\"></button></li>" */
+	$('.liOnImg').append(liPath);	
+		
+	//미리보기 보여주기
+	$('.preiew_img').show();
+	
+	var imgHtml = "";
+	var imgPath = "<div class=\"img_box preBoxF\" id=preBoxF"+ imgCnt +"><img src=\"" + imgSrc + "\" /></div>";
+
+	if($("#imgCnt").val() == 1){
+		$('.preViewShort').append(imgPath);
+		$('.photo_num_01').show();
+		$('.photo_num_02').hide();
+		$('.photo_num_03').hide();
+		//$(".thumb_wrap li:eq(0)").addClass("on");
+		
+	}else if($("#imgCnt").val() == 2){
+		$('.preViewShort').append(imgPath);
+		$('.photo_num_02').show();
+		$(".thumb_wrap li").removeClass("on");
+		//$(".thumb_wrap li:eq(1)").addClass("on");
+		
+	}else if($("#imgCnt").val() == 3){
+		$('.preViewShort').append(imgPath);
+		$('.photo_num_03').show();
+		$(".thumb_wrap li").removeClass("on");
+		//$(".thumb_wrap li:eq(2)").addClass("on");
+		
+	}
+	
+	// 배열에 선택한 이미지 경로 저장해주기
+	imgFilePath.push(imgSrc);
+	
+	// 배열에 선택한 이미지 아이디 저장해주기 - 내 문자 보관함 저장용으로 사용
+	if(typeof(imgId) != 'undefined' && imgId != null && editYn != 'edit_y'){
+		imgFileId.push(imgId);
+	}
+	//문자 길이 및 타입 변경해주기
+	var contents = $('#smsTxtArea').val();
+	fnByteString(contents);
+	
+	var scrollHei = $(".mCustomScrollBox").height();
+	if(scrollHei > 488) {
+		$(".img_box").addClass("on_scroll_img");
+	}
+	
+}
+
+//그림샘플 이미지 선택시 문자 내용에 입력 처리
+function myMsgImageControl(imgSrc, editYn, imageName, imgId) {
+	
+	var imgCnt = $("#imgCnt").val(); // 현재 페이지에 첨부된 이미지 갯수
+	var imgSrc = imgSrc;
+	if(imgCnt >= 3){
+		alert("이미지는 3장만 선택할 수 있습니다.");
+		return false;
+	}
+
+	$('.preShort').hide();
+	$('.prePhoto').show();
+	
+	if($('.msg_com').hasClass("msg_short") === true){
+		
+		$('.msg_com').removeClass("msg_short"); //단문 클래스 삭제하고
+		$('.msg_com').addClass("msg_photo"); // 그림문자용 클래스 삽입
+		$('.put_left').removeClass("short");
+		$('.put_left').addClass("photo");
+		$('.msg_com').html("그림");
+		$('#msgType').val("6"); // 메세지 타입 설정
+		
+		//제목 입력 항목 활성화
+		//document.getElementById("mmsSubject").disabled = false;
+		
+	}else{
+		
+		$('.msg_com').removeClass("msg_long"); //장문 클래스 삭제하고
+		$('.msg_com').addClass("msg_photo"); // 그림문자용 클래스 삽입
+		$('.put_left').removeClass("long");
+		$('.put_left').addClass("photo");
+		$('.msg_com').html("그림");
+		$('#msgType').val("6"); // 메세지 타입 설정
+		
+		//제목 입력 항목 활성화
+		//document.getElementById("mmsSubject").disabled = false;
+		
+	}
+	
+	//이미지 카운트 증가시키기
+	//imgCnt ++;
+	$("#imgCnt").val(Number(imgCnt)+1);
+	
+	//문자 내용 상단에 이미지 이름 영역 객체 추가해주기
+	var imgPath = '<img src="' + imgSrc + '" class="thumb_img '+ editYn +'" alt="thumb1"/>';
+	var liPath = '<li class="delLi '+imageName+'" id="delLi'+ imgCnt +'">'
+				+ '<div>'+ imgPath+ '</div>'
+				+ '<button type="button" class="file_close"><img src="/publish/images/content/thumb_del.png" alt="첨부파일 삭제"></button>'
+				+ '<button type="button" class="file_close_on"><img src="/publish/images/content/thumb_del_on.png" alt="첨부파일 삭제"></button>'
+				+ '</li>';
+				
+				
+		/* "<li class=\"delLi\"><p>" + imgPath + "</p><button type=\"button\" class=\"file_close\"><img class=\"delImg\" src=\"/publish/images/content/file_close.png\" alt=\"첨부파일 삭제\"></button></li>" */
+	$('.liOnImg').append(liPath);	
+		
+	//미리보기 보여주기
+	$('.preiew_img').show();
+	
+	var imgHtml = "";
+	var imgPath = "<div class=\"img_box preBoxF\" id=preBoxF"+ imgCnt +"><img src=\"" + imgSrc + "\" /></div>";
+
+	if($("#imgCnt").val() == 1){
+		$('.preViewShort').append(imgPath);
+		$('.photo_num_01').show();
+		$('.photo_num_02').hide();
+		$('.photo_num_03').hide();
+		//$(".thumb_wrap li:eq(0)").addClass("on");
+		
+	}else if($("#imgCnt").val() == 2){
+		$('.preViewShort').append(imgPath);
+		$('.photo_num_02').show();
+		$(".thumb_wrap li").removeClass("on");
+		//$(".thumb_wrap li:eq(1)").addClass("on");
+		
+	}else if($("#imgCnt").val() == 3){
+		$('.preViewShort').append(imgPath);
+		$('.photo_num_03').show();
+		$(".thumb_wrap li").removeClass("on");
+		//$(".thumb_wrap li:eq(2)").addClass("on");
+		
+	}
+	
+	// 배열에 선택한 이미지 경로 저장해주기
+	imgFilePath.push(imgSrc);
+	// 배열에 선택한 이미지 아이디 저장해주기 - 내 문자 보관함 저장용으로 사용
+	if(typeof(imgId) != 'undefined' && imgId != null){
+		imgFileId.push(imgId);
+	}
+	//문자 길이 및 타입 변경해주기
+	var contents = $('#smsTxtArea').val();
+	fnByteString(contents);
+	
+	var scrollHei = $(".mCustomScrollBox").height();
+	if(scrollHei > 488) {
+		$(".img_box").addClass("on_scroll_img");
+	}
+	
+}
+
+
+$(document).on('click', '.symbolButton, .changeWord', function (){
+	//var smsTxtArea = $('#smsTxtArea').val();
+	//$('#smsTxtArea').val(smsTxtArea + $(this).attr("value"));
+	
+	// 커서 위치에 삽입
+	setCursorInsertText("smsTxtArea", $(this).attr("value"));
+	
+	fnByteString($('#smsTxtArea').val());
+});
+
+$(document).on('click', '#recommBtn', function(){
+	
+	var recommId = $('#recommId').val();
+	
+	if(recommId == ''){
+		
+		alert("추천인 ID를 입력해 주세요.");
+		return false;
+		
+	}
+	
+	var data = new FormData(document.msgForm);
+	var url = "/web/mjon/msgcampain/selectRecommIdCheckAjax.do";
+	
+	$.ajax({
+        type: "POST",
+        enctype: 'multipart/form-data',
+        url: url,
+        data: data,
+        dataType:'json',
+        async: false,
+        processData: false,
+        contentType: false,
+        cache: false,
+        //timeout: 600000,
+        success: function (returnData, status) {
+			if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+				
+				if(returnData.status == "success"){
+					
+					alert("추천인 아이디가 확인 되었습니다.");
+					return false;
+					
+				}else{
+					
+					alert("존재하지 않는 추천인 아이디 입니다.");
+					return false;
+					
+				}
+				
+			} else if(status== 'fail'){
+				alert("추천인 확인에 실패하였습니다. !!");
+			}
+		},
+        error: function (e) { alert("추천인 확인에 실패하였습니다."); console.log("ERROR : ", e); }
+    });
+	
+});
+
+//문자발송 받는사람 목록 주소록에 등록하기 기능 처리
+$('.registAddr').click(function(){
+	
+	var tableData = tableL.getRows();
+	var dataLen = tableL.getRows().length;
+	
+	var nameList = [];		//치환문자 이름
+	var phoneNum = [];		//받는사람
+	var rep1List = [];		//치환문자1
+	var rep2List = [];		//치환문자2
+	var rep3List = [];		//치환문자3
+	var rep4List = [];		//치환문자4
+	
+	if(dataLen > 0){
+		
+		for(var i=0; i < dataLen; i++){
+			
+			var name = tableData[i].getData().name;
+			var phone = removeDash(tableData[i].getData().phone);
+			var rep1 = tableData[i].getData().rep1;
+			var rep2 = tableData[i].getData().rep2;
+			var rep3 = tableData[i].getData().rep3;
+			var rep4 = tableData[i].getData().rep4;
+			
+			if(phone == "" || phone == null){
+				
+				alert("수신 목록에 핸드폰 번호가 없는 항목이 있습니다.");
+				return false;
+				
+			}else if(!checkHpNum(phone)){
+				
+				alert("수신 목록에 잘 못된 핸드폰 번호가 있습니다. 핸드폰 번호 : " + phone + " 입니다.");
+				return false;
+				
+			}
+			
+			nameList[i] = name;
+			phoneNum[i] = phone;
+			
+			if(rep1 == "" || rep1 == null){
+				rep1List[i] = "-";
+			}else{
+				rep1List[i] = rep1;
+			}
+			
+			if(rep2 == "" || rep2 == null){
+				rep2List[i] = "-";
+			}else{
+				rep2List[i] = rep2;
+			}
+			
+			if(rep3 == "" || rep3 == null){
+				rep3List[i] = "-";
+			}else{
+				rep3List[i] = rep3;
+			}
+			
+			if(rep4 == "" || rep4 == null){
+				rep4List[i] = "-";
+			}else{
+				rep4List[i] = rep4;
+			}
+			
+			/* if(name == "" || name == null){
+				
+				alert("수신 목록에 이름이 없는 항목이 있습니다. 이름을 입력해 주세요");
+				return false;
+				
+			}else{
+				
+				nameList[i] = name;
+				phoneNum[i] = phone;
+				
+				if(rep1 == "" || rep1 == null){
+					rep1List[i] = "-";
+				}else{
+					rep1List[i] = rep1;
+				}
+				
+				if(rep2 == "" || rep2 == null){
+					rep2List[i] = "-";
+				}else{
+					rep2List[i] = rep2;
+				}
+				
+				if(rep3 == "" || rep3 == null){
+					rep3List[i] = "-";
+				}else{
+					rep3List[i] = rep3;
+				}
+				
+				if(rep4 == "" || rep4 == null){
+					rep4List[i] = "-";
+				}else{
+					rep4List[i] = rep4;
+				}
+				
+			} */
+			
+		}
+		
+		//주소록 정보를 Form에 넣어준다.
+		
+		var form = document.msgForm;
+		form.callToList.value = phoneNum;
+		form.nameList.value = nameList;
+		form.rep1List.value = rep1List;
+		form.rep2List.value = rep2List;
+		form.rep3List.value = rep3List;
+		form.rep4List.value = rep4List;
+		form.addrGrpId.value = $("#addrGrpIdInfo").val();
+		form.addrGrpNm.value = $("#addrGrpNm").val();
+		
+		if ($("#addrGrpIdInfo option:selected").val() == "NEW" && ($("#addrGrpNm").val() == "" || $("#addrGrpNm").val() == null || $("#addrGrpNm").val() == undefined)) {
+			alert("저장할 그룹을 선택하거나 새 그룹명을 입력해주세요.");
+			return false;		
+		}else if ($("#addrGrpIdInfo option:selected").val() == "NEW" && $("#addrGrpNm").val() != "") {
+			//주소록 중복체크
+			if (getAddrGroupDuplCheckAjax() == false) {
+				alert("중복된 그룹명입니다. 새 그룹명을 입력해주세요.");
+				return false;			
+			}
+		}
+		if(confirm("연락처 정보를 주소록에 등록 하시겠습니까?")){
+			
+			var data = new FormData(form);
+			var url = "/web/mjon/msgdata/insertMsgAddrListAjax.do";
+			
+			$.ajax({
+		        type: "POST",
+		        enctype: 'multipart/form-data',
+		        url: url,
+		        data: data,
+		        dataType:'json',
+		        async: true,
+		        processData: false,
+		        contentType: false,
+		        cache: false,
+		        //timeout: 600000,
+		        success: function (returnData, status) {
+					if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+						
+						if(returnData.result == "success"){
+							var alertMsg = "총 " + returnData.resultCnt + "건의 " +returnData.message;
+							
+							if(returnData.dupliCnt > 0) {
+								alertMsg += "\n"+numberWithCommas(returnData.dupliCnt) + "건은 이미 등록되어있는 번호입니다.";
+							}
+
+							alert(alertMsg);
+							$("#addrGrpNm").val("");
+							$('.addressregi_layer').attr('style','');
+							$('.mask').removeClass('on');
+							return false;
+							
+						}else if(returnData.result == "allDupl") {
+							alert("요청하신 "+returnData.dupliCnt+"건의 번호가 주소록에 이미 등록되어있습니다.");
+							$("#addrGrpNm").val("");
+							$('.addressregi_layer').attr('style','');
+							$('.mask').removeClass('on');
+							return false;
+						}else{
+							alert(returnData.message);
+							$("#addrGrpNm").val("");
+							$('.addressregi_layer').attr('style','');
+							$('.mask').removeClass('on');
+							return false;
+							
+						}
+						
+					} else if(status== 'fail'){
+						alert("주소록 등록에 실패하였습니다. !!");
+					}
+				},
+		        error: function (e) { 
+		        	alert("주소록 등록에 실패하였습니다."); 
+		        	console.log("ERROR : ", e); 
+		        },
+				beforeSend : function(xmlHttpRequest) {
+		        	//로딩창 show
+		        	$('.loading_layer').addClass('active');				
+				},	        	        
+		        complete : function(xhr, textStatus) {
+		        	//로딩창 hide
+		        	$('.loading_layer').removeClass('active');
+				}
+		    });
+			
+		}
+		
+	}else{
+		
+		alert("연락처 정보를 등록해 주세요.");
+		return false;
+		
+	}
+	
+	
+});
+
+//주소록 불러오기 그룹명 검색 기능처리
+function fnAddrGrpSearch(){
+	
+	var form = document.searchAddrGrpForm;
+	form.searchKeyword.value = form.searchGrpKeyword.value;
+	form.searchCondition.value = "";
+	
+	var sendData = $(document.searchAddrGrpForm).serializeArray();
+	
+	$("#addrGroupLoad").load("/web/mjon/msgcampain/selectAddrGroupListAjax.do", sendData ,function(response, status, xhr){
+		//리스트 스크롤 처리해주기
+		$(".adr_pop_list").mCustomScrollbar({
+			axis: 'y',
+			scrollbarPosition: "outside",
+			theme: "dark",
+			autoHideScrollbar: false
+		});
+	});
+	
+}
+
+//주소록 불러오기 팝업의 그룹 선택시 우측에 주소록 불러오기
+function fnSelectAddrList(type,addrGrpId,item){
+	
+	// 주소록 그룹 열림, 닫힘 폴더이미지 초기화
+	$(".adr_pop_list div p").each(function (index, item) {
+		$(item).find("img").attr("src", "/publish/images/content/close_folder2.png");
+		$(item).find("img").attr("alt", "폴더 닫힘");
+	});
+	
+	var form = document.searchAddrGrpForm;
+	form.type.value = type;
+	form.searchAddrGrpId.value = addrGrpId;
+	form.searchKeyword.value = "";
+	form.searchCondition.value = form.searchAddrCondition.value;
+	
+	//왼쪽 그룹리스트의 그룸명을 선택시 검색어를 초기화해준다.
+	form.searchAddrKeyword.value="";
+	
+	/*
+	$(item).toggleClass("open");
+	if ($(item).hasClass("open") === true) {
+		$(item).find("img").attr("src", "/publish/images/content/open_folder2.png");
+		$(item).find("img").attr("alt", "폴더 열림");
+	}
+	else {
+		$(item).find("img").attr("src", "/publish/images/content/close_folder2.png");
+		$(item).find("img").attr("alt", "폴더 닫힘");
+	}
+	*/
+	   
+	$(item).find("img").attr("src", "/publish/images/content/open_folder2.png");
+	$(item).find("img").attr("alt", "폴더 열림");
+	
+	loadAddrList();
+	
+}
+
+function fnAddrSearch(){
+	
+	var form = document.searchAddrGrpForm;
+	form.searchKeyword.value = form.searchAddrKeyword.value;
+	form.searchCondition.value = form.searchAddrCondition.value;
+	
+	loadAddrList();
+	
+}
+
+function loadAddrList(){
+
+	/*
+		serialize 를 사용할때는 processData, contentType 옵션 제가할것
+	*/
+	var data = $("#searchAddrGrpForm").serialize();
+	
+	var url = "/web/mjon/msgcampain/selectMsgAddrListAjax.do";
+	
+	$.ajax({
+        type: "POST",
+        url: url,
+        data: data,
+        dataType:'json',
+        async: false,
+        cache: false,
+        success: function (returnData, status) {
+			if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+				
+				if(returnData.result == "success"){
+					
+					var addrList = returnData.resultAddrList;
+					var tableData = [];
+					
+					if(addrList.length == 0){
+						
+						alert("주소록 정보가 없습니다.");
+						tableAddr.setData(tableData);
+						return false;
+					}
+					
+					//받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다.
+					for(var i=0; i < addrList.length; i++){
+						
+						tableData.push({addrGroupNm: addrList[i].addrGrpNm, addrPhone: removeDash(addrList[i].addrPhoneNo) , addrName: addrList[i].addrNm, addrRep1: addrList[i].addrInfo1, addrRep2: addrList[i].addrInfo2, addrRep3: addrList[i].addrInfo3, addrRep4: addrList[i].addrInfo4});
+						
+					}
+					
+					//우측 주소록 리스트 Tabulator에 입력해주기
+					tableAddr.setData(tableData);
+					
+				}else{
+					
+					alert(returnData.message);
+					return false;
+					
+				}
+				
+			} else if(status== 'fail'){
+				alert("주소록 불러오기에 실패하였습니다. !!");
+			}
+		},
+        error: function (e) { alert("주소록 불러오기에 실패하였습니다."); console.log("ERROR : ", e); }
+    });
+	
+}
+
+//주소록 불러오기에서 수신자 리스트 추가해 주기
+function addrToList(){
+	
+	var selectedData = tableAddr.getSelectedRows();
+	//var tableData = [];
+	var callToArr = [];
+	var form = document.callToForm;
+	
+	if(selectedData == "" || selectedData == null){
+		
+		alert("주소록을 선택해 주세요.");
+		return false;
+	
+	}else{ // 선택한 Row 데이터 저장해주기
+		
+		for(var i=0; i < selectedData.length; i++){
+			
+			//좌측 받는사람 리스트를 담아둔 배열에 데이터를 추가해 준다.
+			callToArr[i] = selectedData[i].getData().addrPhone;
+		
+		}
+	
+		//기존 받는사람 목록에 데이터가 있으면 알림 메세지 표시해주기
+		var callToLiCnt = $('.ui-widget-content').length;
+		if(callToLiCnt > 0){
+			
+			if(!confirm("기존 받는사람을 모두 초기화하고 새로운 받는사람을 불러옵니다. 진행하시겠습니까?")){
+				return false;
+			}
+
+		}
+		
+		//선택한 데이터 받는사람 리스트에 추가해 주기
+		//addPhoneInfo(tableData);
+		form.callToArr.value = callToArr;
+		var data = new FormData(form);
+		var url = "/web/mjon/msgcampain/insertMyAddrTWCallToAjax.do";
+		$.ajax({
+			type: "POST",
+	        url: url,
+	        data: data,
+	        dataType:'json',
+	        async: true,
+	        processData: false,
+	        contentType: false,
+	        cache: false,
+	        success: function (returnData, status) {
+				if(status == "success"){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+					
+					var result = returnData.result;
+					var message = returnData.message;
+					var dupCallCnt = returnData.dupCallCnt;
+					var callSeq = returnData.maxCallSeq;
+					
+					if(result == "loginFail"){
+						
+						alert(message);
+						return false;
+						
+					}else if(result == "fail"){
+						
+						alert(message);
+						return false;
+						
+					}else if(result == "success"){
+						
+						if(Number(dupCallCnt) > 0){
+							alert("추가 주소록 리스트 중 중복 연락처 " + dupCallCnt + "건은 제외되었습니다.");
+						}
+						
+						
+						if(Number(callSeq) > 0){
+							$("#callSeq").val(callSeq);
+							
+							//추가된 수신목록 20건 불러오기
+							addTWCallToInfo();
+						}
+						
+					}else{
+						alert(message);
+						return;
+						
+					}
+						
+				} else if(status== 'fail'){
+					alert("주소록을 불러오는 중 오류가 발생하였습니다.");
+					console.log("status : fail ~");
+				}
+			},
+			error: function (e) { 
+	        	alert("주소록을 불러오는 중 오류가 발생하였습니다."); 
+	        	console.log("ERROR : ", e); 
+	        },
+			beforeSend : function(xmlHttpRequest) {
+	        	//로딩창 show
+	        	$('.loading_layer').addClass('active');				
+			},	        	        
+	        complete : function(xhr, textStatus) {
+	        	//로딩창 hide
+	        	$('.loading_layer').removeClass('active');
+			}	
+	    });
+		
+		$(".closeAddr").trigger("click");
+		//주소록 레이어 팝업의 Tabulator 데이터 지워주기
+		tableAddr.clearData();
+
+	}
+	
+}
+
+//주소록 팝업 닫기 기능
+function addrClose(){
+	
+	$(".closeAddr").trigger("click");
+	
+	//주소록 레이어 팝업의 Tabulator 데이터 지워주기
+	tableAddr.clearData();
+	
+}
+
+//내문자함 선택시 저장된 내용 문자 입력영역에 처리해주기
+function fnMyMsgAdd(msgId){
+	
+	var form = document.addMyMsgForm;
+	form.msgId.value = msgId;
+	form.pageType.value = "myMsg";
+	
+	var url = "/web/mjon/msgcampain/selectMsgAddInfoAjax.do";
+	var data = new FormData(document.addMyMsgForm);
+	
+	$.ajax({
+        type: "POST",
+        url: url,
+        data: data,
+        dataType:'json',
+        async: false,
+        processData: false,
+        contentType: false,
+        cache: false,
+        success: function (returnData, status) {
+			if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+				
+				if(returnData.result == "success"){
+					
+					var msgData = returnData.resultMsgInfo;
+					var fileData = returnData.resultMsgAddPhotoInfo;
+					
+					var smsTxt = msgData.smsTxt;
+					var subject = msgData.subject;
+					var fileId = "";
+					var filePath = "";
+					var len = fileData.length;
+					
+					//기존 내용 지워주기
+					//$(".btnReset").trigger("click");
+					$('.delLi').each(function(){
+						$(this).remove();
+					});
+					
+					$('.preBoxF').each(function(){
+						$(this).remove();
+					});
+
+					$('#imgCnt').val(0);
+					
+					//기존 imgFileId, imgFilePath 배열에 있는 내용 초기화 해주기
+					imgFilePath = [];
+					imgFileId = [];
+					
+					//내문자함 텍스트 내용 입력해주기
+					$('#smsTxtArea').val(smsTxt);
+					
+					//첨부 이미지가 있는경우 이미지 처리해주기
+					if(len > 0){
+						
+						for(var i=0; i < len; i++){
+							
+							var num = i + 1;
+							var imgId = fileData[i].atchFileId;
+							var imgSn = fileData[i].fileSn;
+							var fileStreCours = fileData[i].fileStreCours;
+							var streFileNm = fileData[i].streFileNm;
+							var fileExtsn = fileData[i].fileExtsn;
+							
+							/* var imgSrc = fileStreCours + "/" + streFileNm + "." + fileExtsn; */
+							var imgSrc = '/cmm/fms/getImage2.do?atchFileId=' + imgId + '&fileSn=' + imgSn;
+							myMsgImageControl(imgSrc, "edit_n", "Template", imgId);
+							
+						}
+						
+						fnByteString(smsTxt);
+						
+					}else{
+						
+						fnByteString(smsTxt);
+						
+					}
+					
+					//내 문자함 가져오기에서 글자길이 계산을 다시한다.
+					$("#smsTxtArea").trigger("keyup");
+					
+					// 문자전송 상단으로 이동
+					var sendOfT=$('.send_top').offset().top;
+					$('html,body').stop().animate({'scrollTop':sendOfT-60},250);					
+				}else{
+					
+					alert("내문자함 내용을 불러오지 못하였습니다.");
+					return false;
+					
+				}
+				
+			} else if(status== 'fail'){
+				alert("내문자함 내용 입력에 실패하였습니다. !!");
+			}
+		},
+        error: function (e) { alert("내문자함 내용 입력에 실패하였습니다."); console.log("ERROR : ", e); }
+    });
+	
+}
+
+function emailChange(email){
+	var emailTxt =  $("input[name=emailDomain]");
+	
+	if(email.value == '1'){
+		$("input[name=emailDomain]").attr('readonly', false);
+		emailTxt.val('');
+	}else{
+		emailTxt.val(email.value);
+		$("input[name=emailDomain]").attr('readonly', true);
+	}
+	
+}
+
+function fnCandidateUpt(dataType){
+	
+	var form = document.candiForm;
+	form.dataType.value = dataType;
+	
+	if(form.candidateNm.value == ""){
+		
+		alert("후보자 이름을 입력해 주세요.");
+		return false;
+		
+	}
+	
+	if(form.regidentNo1.value == ""){
+		
+		alert("후보자 주민등록번호 앞자리를 입력해 주세요.");
+		return false;
+		
+	}else if(!Number(form.regidentNo1.value)){
+		
+		alert("후보자 주민등록번호 앞자리를 정확히 입력해 주세요.");
+		return false;
+		
+	}
+	
+	if(form.regidentNo2.value == ""){
+		
+		alert("후보자 주민등록번호 뒷자리를 입력해 주세요.");
+		return false;
+		
+	}else if(!Number(form.regidentNo2.value)){
+		
+		alert("후보자 주민등록번호 뒷자리를 정확히 입력해 주세요.");
+		return false;
+		
+	}
+	
+	if(form.candidateAddr.value == ""){
+	
+		alert("후보자 주소를 입력해 주세요.");
+		return false;
+		
+	}
+	
+	if(form.managerNm.value == ""){
+		
+		alert("담당자 이름을 입력해 주세요.");
+		return false;
+		
+	}
+	
+	if(form.phoneNo.value == ""){
+		
+		alert("담당자 휴대폰 번호를 입력해 주세요.");
+		return false;
+		
+	}else if(!checkHpNum(removeDash(form.phoneNo.value))){
+		
+		alert("정확한 휴대폰 번호를 입력해 주세요.");
+		return false;
+		
+	}
+	
+	var emailChk = form.email.value + "@" + form.emailDomain.value;
+	
+	if(emailChk == ""){
+		
+		alert("이메일을 입력해 주세요.");
+		return false;
+		
+	}else if(!checkEmail(emailChk)){
+		
+		alert("정확한 이메일을 입력해 주세요.");
+		return false;
+		
+	}
+	
+	var msg = "";
+	
+	if(dataType == 'Upt'){
+		
+		msg="후보자 정보를 수정하시겠습니까?";
+		
+	}else{
+		
+		msg="후보자를 등록 하시겠습니까?";
+		
+	}
+	
+	if(confirm(msg)){
+		
+		//XSS 취약점 제거
+		form.candidateNm.value = XSSCheck(form.candidateNm.value);
+		form.regidentNo1.value = XSSCheck(form.regidentNo1.value);
+		form.regidentNo2.value = XSSCheck(form.regidentNo2.value);
+		form.candidateAddr.value = XSSCheck(form.candidateAddr.value);
+		form.managerNm.value = XSSCheck(form.managerNm.value);
+		form.phoneNo.value = XSSCheck(form.phoneNo.value);
+		form.email.value = XSSCheck(form.email.value);
+		form.emailDomain.value = XSSCheck(form.emailDomain.value);
+		
+		var url = "/web/mjon/msgcampain/insertCandidateDataInfoAjax.do";
+		var data = new FormData(document.candiForm);
+		
+		$.ajax({
+	        type: "POST",
+	        url: url,
+	        data: data,
+	        dataType:'json',
+	        async: false,
+	        processData: false,
+	        contentType: false,
+	        cache: false,
+	        success: function (returnData, status) {
+				if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+					
+					if(returnData.result == "loginFail"){
+						
+						alert(returnData.message);
+						return false;
+						
+						
+					}else if(returnData.result == "success"){
+						
+						alert(returnData.message);
+						location.reload();
+// 						return false;
+						
+					}else{
+						
+						alert(returnData.message);
+						return false;
+						
+					}
+					
+				} else if(status== 'fail'){
+					alert("후보자 등록에 실패하였습니다. !!");
+				}
+			},
+	        error: function (e) { alert("후보자 등록에 실패하였습니다."); console.log("ERROR : ", e); }
+	    });
+		
+	}
+	
+}
+
+function fnCandidateDel(){
+	
+	var form = document.candiForm;
+	
+	
+	if(confirm("후보자를 삭제 하시겠습니까?")){
+		
+		//XSS 취약점 제거
+		form.candidateNm.value = XSSCheck(form.candidateNm.value);
+		form.regidentNo1.value = XSSCheck(form.regidentNo1.value);
+		form.regidentNo2.value = XSSCheck(form.regidentNo2.value);
+		form.candidateAddr.value = XSSCheck(form.candidateAddr.value);
+		form.managerNm.value = XSSCheck(form.managerNm.value);
+		form.phoneNo.value = XSSCheck(form.phoneNo.value);
+		form.email.value = XSSCheck(form.email.value);
+		form.emailDomain.value = XSSCheck(form.emailDomain.value);
+		
+		var url = "/web/mjon/msgcampain/deleteCandidateDataInfoAjax.do";
+		var data = new FormData(document.candiForm);
+		
+		$.ajax({
+	        type: "POST",
+	        url: url,
+	        data: data,
+	        dataType:'json',
+	        async: false,
+	        processData: false,
+	        contentType: false,
+	        cache: false,
+	        success: function (returnData, status) {
+				if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+					
+					if(returnData.result == "loginFail"){
+						
+						alert(returnData.message);
+						return false;
+						
+						
+					}else if(returnData.result == "success"){
+						
+						alert(returnData.message);
+						location.reload();
+// 						return false;
+						
+					}else{
+						
+						alert(returnData.message);
+						return false;
+						
+					}
+					
+				} else if(status== 'fail'){
+					alert("후보자 삭제에 실패하였습니다. !!");
+				}
+			},
+	        error: function (e) { alert("후보자 삭제에 실패하였습니다."); console.log("ERROR : ", e); }
+	    });
+		 debugger;
+	}
+}
+
+function fn_candidateLoginChk(){
+	
+	alert("후보자 등록은 로그인 후 이용 가능합니다.");
+	return false;
+	
+}
+
+function fn_mberDeptChk(){
+	
+	alert("선거문자는 개인 회원만 이용 가능합니다.");
+	return false;
+	
+}
+
+
+function goToCustom(){
+	var form = document.goToCustomForm;
+	form.submit();
+}
+//최초 문자샘플 탭 리스트 데이터 불러오기
+//fnLetterListAjax();
+
+/* 윈도우팝업 열기 */
+function infoPop(pageUrl){
+	document.popForm.pageType.value = pageUrl;
+	document.popForm.action = "/web/pop/infoPop.do";
+	document.popForm.method = "post"; 
+	window.open("about:blank", 'infoPop', 'width=790, height=1500, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=yes');
+	document.popForm.target = "infoPop";
+	document.popForm.submit();
+}
+
+$(document).on('click', '.addressregi_btn', function() {
+	var tableData = tableL.getRows();
+	var dataLen = tableL.getRows().length;
+	if(dataLen == 0){
+		alert("연락처 정보를 등록해 주세요.");
+		return false;
+	}else{
+		$('.addressregi_layer').css({'width':'680px','display':'block','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
+		setTimeout(function(){
+			$('.addressregi_layer').css({'opacity':'1'});
+		},150);
+		$('.mask').addClass('on');
+		getAddrGroupList();
+	}
+});
+
+$(document).on('click', '.addressregi_layer .tooltip-close', function() {
+	$('.addressregi_layer').attr('style','');
+	$("#addrGrpNm").val("");
+});
+
+$(document).on('change', '#addrGrpIdInfo', function() {
+	if ($("#addrGrpIdInfo option:selected").val() != "NEW") {
+		$("#addrGrpNm").val(""); //	새그룹명 Clear;
+	}
+});
+
+//주소록 그룹정보 불러오기
+function getAddrGroupList() {
+ $.ajax({
+     type : "POST",
+     async : false,
+     url : "/web/mjon/addr/addrGroupListAjax.do",
+     data : {},
+     dataType:'json',
+     success : function(data) {
+		//alert(JSON.stringify(data.addrGroupList));
+
+		// Show Html
+		getAddrGroupListShow(data.addrGroupList);
+     },
+     error : function(xhr, status, error) {
+         alert(error);
+         return false;
+     }
+ });	    	
+}
+
+//Show Html
+function getAddrGroupListShow(jsonList) {
+	var sHtml = "";
+	sHtml += "<option value='NEW'>그룹추가</option>";
+	sHtml += "<option value='0'>그룹미지정</option>";
+	sHtml += "<option value='bookmark'>자주보내는 번호</option>";
+	for (var j = 0; j < jsonList.length; j++) {
+		sHtml += "	<option value='" + $.trim(jsonList[j].addrGrpId) + "' />" + $.trim(jsonList[j].addrGrpNm) + "</option>";
+	}
+	    	
+	$("#addrGrpIdInfo").html(sHtml);
+}
+
+//주소록 그룹 중복체크
+function getAddrGroupDuplCheckAjax() {
+	var isReturn = true;
+	
+	$.ajax({
+		url : "<c:url value='/web/addr/getAddrGroupDuplCheckAjax.do' />", 
+		type : 'POST', 
+		data : {"addrGrpNm" : $("#addrGrpNm").val()},
+		dataType:'json',
+		async: false,			// 동기
+		success : function(data, status){
+			if(data.isSuccess == true) {
+				if(data.isDupl == true) {
+					//alert("중복된 그룹명입니다.");
+					isReturn = false;
+				}
+			} 
+			else {
+				//alert("Message : " + msg);
+			}			
+		},
+		error: function (e) {
+			//alert("주소록 중복체크에 실패했습니다.");
+		}
+	});
+	
+	return isReturn;	
+}
+
+/* 테스트발송 열기 */
+function fnTestSend(){
+	
+	if(!checkConf()){	//문자온 conf-check
+		alert("현재 문자 발송하기 기능 점검 중입니다.\n\n1분 후 다시 시도해주세요.");
+		return false;
+	}
+	
+	var msgForm = document.msgForm;
+	var form = document.testSendForm;
+	var loginVO = '${LoginVO}';
+	var spamStatus = false;
+	var callFrom = $("#callFromList option:selected").val();
+	
+	//로그인 체크
+	if(loginVO == "" || loginVO == null){
+		alert("문자발송 서비스는 로그인 후 이용 가능합니다.");
+		return false;
+	}
+	
+	//MJ_MSG_GROUP_DATA 누락데이터 체크
+	//if (getMsgGroupDataErrorCheck() == false) {
+	//	alert("고객님께서 발송한 최근문자가 발송결과에 표시되지않아, 문자발송이 임시로 차단되었습니다.\n문자온 고객센터에 문의해주세요.");
+	//	return false;	 	
+	//}
+	
+	//문자내용에 이모지가 있는지 체크
+	var strCont = msgForm.smsTxtArea.value;
+	if(!emojiCheck(strCont)) return false;
+	
+	// 발신번호 체크
+	if(callFrom == ""){
+		alert("발신번호를 입력해 주세요.");
+		return false;
+	}
+
+	//그림문자가 아닌데 본문 비어있는지 확인
+	if(imgFilePath.length == 0) {
+		if(msgForm.smsTxtArea.value == "") {
+			alert("문자 내용을 입력해 주세요.");
+			return false;
+		}
+	}else{//문자내용에 스팸 단어 포함여부 체크
+		var spmData = new FormData(msgForm);
+		url = "/web/mjon/msgdata/selectSpamTxtChkAjax.do";
+		
+		$.ajax({
+	        type: "POST",
+	        url: url,
+	        data: spmData,
+	        dataType:'json',
+	        async: false,
+	        processData: false,
+	        contentType: false,
+	        cache: false,
+	        success: function (returnData, status) {
+				if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+					
+					if("fail" == returnData.result){
+						
+						alert(returnData.message);
+						return false;
+						
+					}else if("loginFail" == returnData.result){
+						
+						alert(returnData.message);
+						return false;
+							
+					}else if("spams" == returnData.result){
+						
+// 						var spmFilterTxt = returnData.spmFilterTxt;
+						spamStatus = true;
+						//alert("문자 내용에 \"" + spmFilterTxt + "\"의 스팸문자가 포함되어 있습니다.");
+						alert("전송 문자내용 중 스팸문구로 의심되는 단어가 포함되어 있어 문자발송이 불가합니다.\n자세한 사항은 문자온 고객센터를 통해 문의주시기 바랍니다.");
+						return false;
+						
+					}
+					
+				} else if(status== 'fail'){
+					alert(returnData.message);
+					return false;
+				}
+			},
+	        error: function (e) { alert("시스템 오류가 발생하였습니다."); console.log("ERROR : ", e); return false;}
+	    });
+		
+	}
+
+
+	//단문 장문 그림(몇장인지) 판별하기 - 발송금액 계산
+
+	if($('#nowMsgType').text() == "그림"){
+		
+		msgType = 'P';
+		
+		if(imgFilePath.length == 1) {
+		
+			form.eachPrice.value = '<c:out value="${picturePrice}" />';
+		
+		} else if(imgFilePath.length == 2) {
+		
+			form.eachPrice.value = '<c:out value="${picture2Price}" />';
+		
+		} else if(imgFilePath.length == 3) {
+		
+			form.eachPrice.value = '<c:out value="${picture3Price}" />';
+		
+		}
+		
+		//제목 사용한 경우
+		if($("input[name=title_status]:checked").val() == 'Y') {
+			form.mmsSubject.value = msgForm.mmsSubject.value;
+		} else {
+			form.mmsSubject.value = ""; //초기화
+		}
+
+	}else if($('#nowMsgType').text() == "장문"){
+		
+		msgType = 'L';
+		
+		form.eachPrice.value = '<c:out value="${longPrice}" />';
+		
+		//제목 사용한 경우
+		if($("input[name=title_status]:checked").val() == 'Y') {
+			form.mmsSubject.value = msgForm.mmsSubject.value;
+		} else {
+			form.mmsSubject.value = ""; //초기화
+		}
+		
+	}else{
+		
+		msgType = 'S';
+		
+		form.eachPrice.value = '<c:out value="${shortPrice}" />';
+		
+		form.mmsSubject.value = ""; // 장문/그림 제목 초기화
+	}
+	
+	form.msgType.value = msgType;
+	
+	/* 
+	var phoneIn = $(".send_right .phone").html();
+	//팝업으로 보내기 전에 realtime class 삭제 - 스크립트 제외
+	phoneIn = phoneIn.replace(' class="realtime"',"");
+	form.msgpreview.value = phoneIn;
+	 */
+	//발신번호 세팅
+	form.callFrom.value = callFrom;
+	
+	//이미지 path 보내기
+	form.imgFilePath.value = imgFilePath;
+	
+	form.action = "/web/pop/testSendPop.do";
+	form.method = "post"; 
+	window.open("about:blank", 'testSendPop', 'width=770, height=850, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=1');
+	form.target = "testSendPop";
+	form.submit();
+}
+
+/*
+ *선거문자 필수 문구 추가/삭제 기능 
+ *
+ */
+var advMsgSts = false;
+function advMsgInsert(){
+	var callFrom = $("#callFromList option:selected").val();
+	
+	var advStr = '<div class="ad_txt"><p>(선거운동정보)</p></div>';
+	var advDenyStr = '<div class="deny_txt">후보자전화번호 ' + callFrom + '<br/>불법수집정보 신고번호 118번<br/>무료거부 0808800858</div>';
+	
+	var preAdvStr = '<p class="ad_tit">(선거운동정보)</p>';
+	var preAdvDenyStr = '<p class="deny_receipt">후보자전화번호 ' + callFrom + '<br>불법수집정보 신고번호 118번<br>무료거부 0808800858</p>';
+	
+	//광고 및 무료수신거부 텍스트 추가
+	if (!advMsgSts){//선거문자 필수문구 추가해주기
+
+		//문자내용 광고문자 삭제하기
+		$(".ad_txt").remove();
+		$(".deny_txt").remove();
+		//미리보기 광고 문자 삭제하기
+		$('.ad_tit').remove();
+		$('.deny_receipt').remove();
+		
+		//문자 내용에 광고 문자 추가해주기
+		$(advStr).insertBefore('textarea[name=smsTxtArea]'); 
+		$(advDenyStr).insertBefore('div[name=afterDeny]');
+		
+		//미리보기에 광고 문자 추가해주기
+		$(preAdvStr).insertBefore('.none_txt');
+		$(preAdvDenyStr).insertAfter('.realtime');
+		
+		advMsgSts = true;
+		$("#send_adYn").val("Y");
+		
+	}else{ //선거문자 필수문구 삭제하기
+		
+		//문자내용 광고문자 삭제하기
+		$('.ad_txt').remove();
+		$('.deny_txt').remove();
+		
+		//미리보기 광고 문자 삭제하기
+		$('.ad_tit').remove();
+		$('.deny_receipt').remove();
+		
+		advMsgSts = false;
+		$("#send_adYn").val("N");
+		
+	}
+	
+	//문자 바이트수 계산하기
+	fnByteString($('#smsTxtArea').val());
+	
+}
+
+function setCandidatePhone() {
+	advMsgInsert();
+}
+
+//이벤트 잔액 로그인 체크
+$(".btn_event_cash").off().on("click", function(){
+	var loginVO = '${LoginVO}';
+	if(loginVO == "" || loginVO == null){
+		alert("로그인 후 이용이 가능합니다.");
+		return false;
+	}
+});	
+
+function checkNumber(event) {
+	var divideCnt = $('#divideCnt').val();
+	if(!(event.key >= 0 && event.key <= 9)) {
+		return false;
+	}
+	
+	var totCnt = divideCnt + "" + event.key;
+	if(Number(totCnt) > 5000){
+		
+		alert("분할전송 건수는 5,000건을 초과할 수 없습니다.");
+		$('#divideCnt').val("20");
+		return false;
+		
+	}
+  
+  return true;
+}
+
+//문자 발송목록
+function getMjMsgSentListAll(pageNo) {
+	document.sentListForm.pageIndex.value = pageNo;
+	document.sentListForm.msgSentType.value = "02";		// 01:문자전송, 02:선거문자
+	
+	var sendData= $(document.sentListForm).serializeArray();
+	$("#mjMsgSentListAllLoad").load("/web/mjon/msgdata/selectMjMsgSentListAjax.do", sendData ,function(response, status, xhr){
+
+	});
+}
+
+</script>
+
+	<div class="loading_layer">
+		<div class="loading_container">
+			<div class="bar"></div>
+			<div class="text">Loading</div>
+		</div>
+	</div>
+
+	<form id="sentListForm" name="sentListForm" method="post">
+		<input type="hidden" name="pageType"  value=""/>
+		<input type="hidden" name="pageIndex" value=""/>
+		<input type="hidden" name="msgSentType" value=""/>
+		<input type="hidden" name="searchSortCnd" value="" />
+		<input type="hidden" name="searchSortOrd" value="" />		
+	</form>
+	
+	<!-- 2023 10 16 재전송 : 상세내용 팝업 -->
+	<div class="tooltip-wrap" style="z-index:110;">
+		<div class="popup-com adr_layer rev_popup01" tabindex="0" data-tooltip-con="rev_popup01"
+			data-focus="rev_popup01" data-focus-prev="rev_popup01-close" style="width: 440px;">
+			<div class="popup_heading">
+				<p>문자내용</p>
+				<button type="button" class="tooltip-close" data-focus="rev_popup01-close"><img
+						src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in" id="msgSentDetailPopLoad" style="padding-bottom: 0px;">
+			</div>
+			<div class="popup_btn_wrap2" style="justify-content: center; margin-bottom: 30px;">
+				<button type="button" class="tooltip-close" data-focus="rev_popup01-close" data-focus-next="rev_popup01">닫기</button>
+			</div>
+		</div>
+	</div>
+	<!--// 2023 10 16  재전송 : 상세내용 팝업 -->	
+	
+	<!-- 2023 10 16  재전송 팝업 -->  
+	<div class="tooltip-wrap">
+		<div class="popup-com import_layer popup05" tabindex="0" data-tooltip-con="popup05" data-focus="popup05" data-focus-prev="popup05-close" style="width: 900px;">
+			<div class="popup_heading">
+				<p><span>전송내역</p>
+				<button type="button" class="tooltip-close" data-focus="popup05-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in" id="mjMsgSentListAllLoad" style="padding-bottom: 0px; min-height:428px;">
+			</div>
+			<div class="popup_btn_wrap2" style="margin-bottom: 30px;">
+				<button type="button" class="tooltip-close" data-focus="popup05-close"  data-focus-next="popup05">닫기</button>                      
+			</div>			
+		</div>
+	</div>
+	<!--// 2023 10 16  재전송 팝업 -->
+	
+	<!-- 후보자등록 팝업 data-tooltip:candidate_popup01 -->
+	<div class="tooltip-wrap">
+		<div class="popup-com candidate_layer candidate_popup01" tabindex="0" data-tooltip-con="candidate_popup01" data-focus="candidate_popup01" data-focus-prev="candidate_popup01-close" style="width: 620px;">
+			<div class="popup_heading">
+				<p>후보자 등록정보</p>
+				<button type="button" class="tooltip-close" data-focus="candidate_popup01-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			
+			<form id="candiForm" name="candiForm" method="post">
+				<input type="hidden" id="dataType" name="dataType" value="Reg"/>
+			
+				<div class="layer_in">
+	                <p class="adr_pop_title">선거문자는 반드시 <span class="c_002c9a">후보자 등록</span>을 하셔야만 이용 가능합니다. <br/>입력하신 내용은 세금계산서 발행을 위한 정보로만 사용됩니다.</p>
+					<div class="candidate_table">
+	                    <p>후보자</p>
+	                    <table>
+	                        <caption>후보자 등록을 위한 성명, 주민등록번호, 주소를 입력하는 표</caption>
+	                        <colgroup>
+	                            <col style="width: 125px;">
+	                            <col style="width: auto;">
+	                        </colgroup>
+	                        <tbody>
+	                            <tr>
+	                                <th scope="row">성명</th>
+	                                <td>
+	                                    <label for="candidateNm" class="label"></label>
+	                                    <input type="text" id="candidateNm" name="candidateNm" value="<c:out value='${mjonCandidateVO.candidateNm}'/>" placeholder="후보자 성명 입력" onfocus="this.placeholder=''" onblur="this.placeholder='후보자 성명 입력'" class="inputLight">
+	                                </td>
+	                            </tr>
+	                            <tr class="residentNum">
+	                                <th scope="row">주민등록번호</th>
+	                                <td>
+	                                    <label for="regidentNo1" class="label"></label>
+	                                    <input type="text" id="regidentNo1" name="regidentNo1" value="<c:out value='${mjonCandidateVO.regidentNo1}'/>" maxlength="6" placeholder="주민등록번호 앞 6자리" onfocus="this.placeholder=''" onblur="this.placeholder='주민등록번호 앞 6자리'" class="inputLight">
+	                                    <span>-</span>
+	                                    <label for="regidentNo2" class="label"></label>
+	                                    <input type="password" id="regidentNo2" name="regidentNo2" value="<c:out value='${mjonCandidateVO.regidentNo2}'/>" maxlength="7" placeholder="주민등록번호 뒤 7자리" onfocus="this.placeholder=''" onblur="this.placeholder='주민등록번호 뒤 7자리'" class="inputLight">
+	                                </td>
+	                            </tr>
+	                            <tr>
+	                                <th scope="row">주소</th>
+	                                <td>
+	                                    <label for="candidateAddr" class="label"></label>
+	                                    <input type="text" id="candidateAddr" name="candidateAddr" value="<c:out value='${mjonCandidateVO.candidateAddr}'/>">
+	                                </td>
+	                            </tr>
+	                        </tbody>
+	                    </table>
+	                </div>
+	                <div class="candidate_table" style="margin-top: 40px;">
+	                    <p>담당자</p>
+	                    <table>
+	                        <caption>후보자 등록을 위한 성명, 주민등록번호, 주소를 입력하는 표</caption>
+	                        <colgroup>
+	                            <col style="width: 125px;">
+	                            <col style="width: auto;">
+	                        </colgroup>
+	                        <tbody>
+	                            <tr>
+	                                <th scope="row">성명</th>
+	                                <td>
+	                                    <label for="managerNm" class="label"></label>
+	                                    <input type="text" id="managerNm" name="managerNm" value="<c:out value='${mjonCandidateVO.managerNm}'/>" placeholder="담당자 성명 입력" onfocus="this.placeholder=''" onblur="this.placeholder='담당자 성명 입력'" class="inputLight">
+	                                </td>
+	                            </tr>
+	                            <%-- <tr>
+	                                <th scope="row">직위</th>
+	                                <td>
+	                                    <label for="office" class="label"></label>
+	                                    <input type="text" id="office" name="office" value="<c:out value='${mjonCandidateVO.office}'/>" placeholder="직위 입력" onfocus="this.placeholder=''" onblur="this.placeholder='직위 입력'" class="inputLight">
+	                                </td>
+	                            </tr> --%>
+	                            <tr>
+	                                <th scope="row">휴대폰</th>
+	                                <td>
+	                                    <label for="phoneNo" class="label"></label>
+	                                    <input type="text" id="phoneNo" name="phoneNo" value="<c:out value='${mjonCandidateVO.phoneNo}'/>" placeholder="‘-’ 없이 숫자만 입력" onfocus="this.placeholder=''" onblur="this.placeholder='‘-’ 없이 숫자만 입력'" class="inputLight">
+	                                </td>
+	                            </tr>
+	                            <tr class="emailWrap3">
+	                                <th scope="row">이메일</th>
+	                                <td>
+	                                    <label for="email" class="label"></label>
+	                                    <input type="text" id="email" name="email" value="<c:out value='${mjonCandidateVO.email}'/>">
+	                                    <span>@</span>
+	                                    <label for="emailDomain" class="label"></label>
+	                                    <input type="text" id="emailDomain" name="emailDomain" value="<c:out value='${mjonCandidateVO.emailDomain}'/>">
+	                                    <label for="" class="label">이메일 선택</label>
+	                                    <select class="list_selType1" id="taxEmailSelect" onchange="emailChange(this)">
+	                                        <c:forEach var="result" items="${emailCode}" varStatus="status">
+												<c:if test="${status.index eq 0 }">
+													<option value="1">${result.codeNm}</option>
+												</c:if>
+												<c:if test="${status.index ne 0 }">
+													<option value="${result.codeDc}">${result.codeNm}</option>
+												</c:if>
+											</c:forEach>
+	                                    </select>
+	                                </td>
+	                            </tr>
+	                        </tbody>
+	                    </table>
+	                </div>
+	                <div class="popup_btn_wrap2">
+	                	<c:choose>
+	                		<c:when test="${not empty mjonCandidateVO.candidateNm}">
+			                    <button type="button" onclick="javascript:fnCandidateUpt('Upt'); return false;">수정</button>
+			                    <%-- <button type="button" onclick="javascript:fnCandidateDel(); return false;">삭제</button> --%>
+	                		</c:when>
+	                		<c:otherwise>
+	                			<button type="button" onclick="javascript:fnCandidateUpt('Reg'); return false;">등록</button>
+	                		</c:otherwise>
+	                	</c:choose>
+	                    <button type="button" class="tooltip-close" data-focus="candidate_popup01-close" data-focus-next="candidate_popup01">닫기</button>                      
+	                </div>
+				</div>
+				
+			 	<!-- Workaround to avoid corrupted XHR2 request body in IE10 / IE11 -->
+			 	<input type="hidden" name="_dontcare">				
+			</form>
+		</div>
+	</div><!--// 후보자등록 팝업 -->
+	
+	<div class="tooltip-wrap">
+		<div class="popup-com history_layer popup03" tabindex="0" data-tooltip-con="popup03" data-focus="popup03" data-focus-prev="popup03-close">
+			<div class="popup_heading">
+				<p><span>전송내역</p>
+				<button type="button" class="tooltip-close" data-focus="popup03-close" id="btnLatestAddPhoneClose"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in">
+				<!-- tab button -->
+				<ul class="tabType6"> 
+					<li class="tab active"><button type="button" onclick="TabType(this,'1');">최근 전송내역</button></li>
+					<li class="tab"><button type="button" onclick="TabType(this,'2');">자주보내는 번호</button></li>
+				</ul><!--// tab button -->
+				<!-- 최근 전송내역 -->
+				<div class="history_cont hascont current">
+					<div class="histroy_trans latestMsgArea" id="latestMsgArea">
+						<ul id="latestMsgUl">
+							<c:choose>
+								<c:when test="${not empty resultLatestMsgList}">
+									<c:forEach var="latestMsgList" items="${resultLatestMsgList}" varStatus="status">
+										<li id="latestLi">
+											<input type="checkbox" id="addrChk_${status.count}" name="latAddrChk" value="<c:out value='${latestMsgList.callTo}'/>">
+											<label for="addrChk_${status.count}" class="label">최근 전송내역</label>
+											<p><c:out value="${latestMsgList.callTo}"/></p>
+											<button type="button" id="latestAddrDel"><img src="/publish/images/popup/close3.png"  alt="전화번호 삭제"></button>
+										</li>
+									</c:forEach>
+								</c:when>
+								<c:otherwise>
+									<li>
+										<p>최근 발송 내역이 없습니다.</p>
+									</li>
+								</c:otherwise>
+							</c:choose>
+						</ul>
+					</div>
+					<div class="popup_btn_wrap2 hisroy_btn" style="width: 230px;">
+						<button type="button" id="latestAddPhoneAll">전체추가</button>
+						<button type="button" id="latestAddPhone">선택추가</button>
+						<button type="button" id="latestCancelPhone">선택취소</button>                      
+					</div>
+				</div><!--// 최근 전송내역 -->
+				<!-- 자주보내는 번호 -->
+				<div class="history_cont hascont">
+					<div class="histroy_trans" id="bookMarkMsgArea">
+						<ul id="bookMsgUl">
+							<c:choose>
+								<c:when test="${not empty resultBookMarkMsgList}">
+									<c:forEach var="bookMarkMsgList" items="${resultBookMarkMsgList}" varStatus="status">
+										<li id="bookMarkLi">
+											<input type="checkbox" id="bokAddrChk_${status.count}" name="bookAddrChk" value="<c:out value='${bookMarkMsgList.addrPhoneNo}'/>">
+											<label for="addrChk_${status.count}" class="label">최근 전송내역</label>
+											<p><c:out value="${bookMarkMsgList.addrPhoneNo}"/></p>
+											<button type="button" id="bookMarkAddrDel"><img src="/publish/images/popup/close3.png"  alt="전화번호 삭제"></button>
+										</li>
+									</c:forEach>
+								</c:when>
+								<c:otherwise>
+									<li>
+										<p>등록된 자주 보내는 번호 내역이 없습니다.</p>
+									</li>
+								</c:otherwise>
+							</c:choose>
+						</ul> 
+					</div>
+					<div class="popup_btn_wrap2 hisroy_btn" style="width: 230px;">
+						<button type="button" id="bookMarkAddPhoneAll">전체추가</button>
+						<button type="button" id="bookMarkAddPhone">선택추가</button>
+						<button type="button" id="bookMarkCancelPhone">선택취소</button>                      
+					</div>
+				</div><!--// 자주보내는 번호  -->         
+			</div>
+		</div>
+	</div><!--// 전송내역 팝업 -->
+	<!-- 엑셀 불러오기 -->
+	<form id="excelForm" name="excelForm" method="post">
+		<div class="tooltip-wrap">
+			<div class="popup-com import_layer popup02" tabindex="0" data-tooltip-con="popup02" data-focus="popup02" data-focus-prev="popup02-close">
+				<div class="popup_heading">
+					<p><span>엑셀</span> 불러오기</p>
+					<button type="button" class="tooltip-close" data-focus="popup02-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+				</div>
+				<div class="layer_in">
+					<!-- 엑셀파일 불러오기 -->
+					<div class="hascont">
+						<div class="titBox">
+							<p>- 최대 2만 건까지 등록할 수 있습니다.</p>
+							<p>- [엑셀 불러오기]시 문서의 A, B, C, D열을 불러옵니다.(지원하는 파일 형식 : xls, xlsx)</p>
+							<p>- 이름 : 20byte, [*1*]~[*4*] : 40byte까지 입력 가능합니다.</p>
+							<p>- 휴대폰 항목은 숫자, 하이픈(-)만 인식하며, 번호 앞에 0이 생략되어도 정상 등록됩니다.
+							</p>
+							<%-- <button type="button" class="excel_btn" onclick="location.href='/cmm/fms/FileDown.do?atchFileId=FILE_000000000011651&fileSn=1'"><i></i>샘플파일 다운로드</button> --%>
+							<button type="button" class="excel_btn" onclick="location.href='/download/msg/엑셀주소록_등록양식.xlsx'"><i class="downroad"></i>샘플파일 다운로드</button>
+						</div>
+						<div class="attachedFile">
+							<label for="" class="attachedFile_label">첨부파일</label>
+							<input type="text" id="excelNm" readonly>
+							<input type="file" id="excelFile" accept=".xls, .xlsx" onchange="excelExport(event); return false;" style="display:none"/>
+							<button type="button" class="btnType btnType6 c3">찾아보기</button>
+							<p><span class="vMiddle">*</span> 첨부된 파일은 <span class="c_e40000">[추가]버튼을 클릭</span>하셔야 받는 사람에 등록됩니다.</p>
+						</div>
+					</div><!--// 엑셀파일 불러오기 -->
+					<div class="popup_btn_wrap2">
+						<button type="button" class="tooltip-close" data-focus="popup02-close"  data-focus-next="popup02" id="excelAdd">추가</button>
+						<button type="button" class="tooltip-close" data-focus="popup02-close"  data-focus-next="popup02">닫기</button>                      
+					</div>
+				</div>
+			</div>
+		</div><!--// 엑셀 불러오기 -->
+	</form>
+	<!-- 주소록 불러오기 -->
+	<div class="tooltip-wrap">
+		<div class="popup-com import_layer popup06" tabindex="0" data-tooltip-con="popup06" data-focus="popup06" data-focus-prev="popup06-close" style="width: 1000px">
+			<div class="popup_heading">
+				<p><span>주소록 불러오기</p>
+				<button type="button" onClick="javascript:addrClose(); return false;">
+				<img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in">
+				<div class="titBox titBox_pad">
+					<p>- 주소록 수정 및 변경은 <span>[주소록 관리]</span>에서만 가능합니다.</p>
+					<button type="button" class="adr_admin" onClick="location.href='/web/mjon/addr/selectAddrList.do'">주소록 관리</button>
+				</div>
+				<div class="adr_wrap">
+					<form id="searchAddrGrpForm" name="searchAddrGrpForm" method="post" style="display: flex; justify-content: space-between;">
+						<input type="hidden" id="searchAddrGrpId" name="searchAddrGrpId" value=""/>
+						<input type="hidden" id="type" name="type" value="all"/>
+						<input type="hidden" id="searchKeyword" name="searchKeyword" value=""/>
+						<input type="hidden" name="searchCondition" id="searchCondition" value="0" />
+						<div class="adr_pop_left">
+							<div class="adr_left_search">
+								<label for="searchKeyword" class="label">그룹명 검색</label>
+								<input type="text" name="searchGrpKeyword" id="searchGrpKeyword"  placeholder="그룹명 검색" onfocus="this.placeholder=''" onblur="this.placeholder='그룹명 검색'" class="inputLight">
+								<button type="button" onClick="javascrit:fnAddrGrpSearch(); return false;"><img src="/publish/images/popup/search.png" alt="검색"></button>
+							</div>
+							<div class="adr_pop_box">
+								<div id="addrGroupLoad">
+								</div>
+							</div>
+							<!-- <div class="popup_btn">
+								<button type="button" class="btnType" onClick="javascript:fnSelectAddrGrpList(); return false;">선택 그룹 추가</button>
+							</div> -->
+						</div>
+						<div class="adr_pop_right">
+							<div class="clearfix">
+								<div class="btnWrap_last">
+									<label for="searchAddrCondition" class="label">카테고리 선택</label>
+									<select id="searchAddrCondition" name="searchAddrCondition" class="selType2">
+										<option value='0'>전체</option>
+										<option value='1'>그룹명</option>
+										<option value='2'>이름</option>
+										<option value='3'>핸드폰번호</option>
+									</select>
+									<label for="searchAddrKeyword" class="label">검색어 입력</label>
+									<input type="text" id="searchAddrKeyword" name="searchAddrKeyword" placeholder="검색어를 입력하세요"  onfocus="this.placeholder=''" onblur="this.placeholder='검색어를 입력하세요'" >
+									<button type="button" class="btnType btnType17"  onClick="javascrit:fnAddrSearch(); return false;">검색</button>
+								</div>
+								<!-- table -->
+								<div class="adr_excel adr_pop_list2 callAddr_box">
+								</div>
+								<!--// table -->
+							</div>
+							<div class="popup_btn_wrap2">
+								<button type="button" onClick="javascript:addrToList(); return false;">추가</button>
+								<button type="button" onClick="javascript:addrClose(); return false;">닫기</button>
+							</div>
+							<%-- 주소록 레이어 팝업 닫기 실행 코드 --%>
+							<input type="hidden" name="btnAddrClose" id="btnAddrClose" class="tooltip-close closeAddr" data-focus="popup06-close" />     
+						</div>
+					</form>
+				</div>
+			</div>
+		</div>
+	</div><!--// 주소록 불러오기 -->
+	<!-- 주소록에 등록 data-tooltip:duplication_layer -->
+	<div class="tooltip-wrap">
+		<div class="popup-com addressregi_layer" tabindex="0" data-tooltip-con="addressregi_layer" data-focus="addressregi_layer" data-focus-prev="addressregi_layer-close" style="width: 680px;">
+			<div class="popup_heading">
+				<p>주소록에 등록</p>
+				<button type="button" class="tooltip-close" data-focus="addressregi_layer-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in" style="padding: 30px 20px;">
+				<table class="layer_tType1">
+					<caption>주소록 그룹선택 표</caption>
+						<colgroup>
+							<col style="width: 95px">
+							<col style="width: auto">
+						</colgroup>
+					<tbody>
+						<tr>
+							<th>그룹 선택</th>
+							<td>
+								<label for="" class="label">그룹 선택</label>
+								<select id="addrGrpIdInfo" name="addrGrpIdInfo">
+								</select>
+								<label for="" class="label">그룹명 입력</label>
+								<input type="text" id="addrGrpNm" name="addrGrpNm" placeholder="새 그룹명을 입력해주세요." onfocus="this.placeholder=''" onblur="this.placeholder='새 그룹명을 입력해주세요.'"class="inputLight" style="width: 300px;">
+								<input type="file" id="excelFile" accept=".xls, .xlsx, .txt" onchange="excelExport(event); return false;" style="display:none"/>
+							</td>
+						</tr>
+					</tbody>
+				</table>
+				<div class="popup_btn_wrap2">
+					<button type="button" class="registAddr">등록</button>
+					<button type="button" class="tooltip-close" data-focus="addressregi_layer-close" data-focus-next="addressregi_layer">닫기</button>
+				</div>
+			</div>
+		</div>
+	</div>
+	<!--// 주소록에 등록 팝업 -->
+	
+	<!--선거문자 이용안내 팝업  -->
+	<div class="tooltip-wrap">
+		<div class="popup-com ad_layer candidate_popup03" tabindex="0" data-tooltip-con="candidate_popup03" data-focus="candidate_popup03" data-focus-prev="candidate_popup03-close" style="width: 795px">
+			<div class="popup_heading">
+				<p>선거문자 안내</p>
+				<button type="button" class="tooltip-close" data-focus="candidate_popup03-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in">
+				<img src="/publish/images/content/candidatePop_banner.png" alt="선거문자 이용안내 배너" class="candidate_banner">
+				<ul class="info_list">
+		    		<li>- 90byte 초과 시, 자동으로 장문으로 전환됩니다.  장문 문자는 최대 2,000byte까지만 작성할 수 있습니다.</li>
+		    		<li>- 그림문자 1건당 최대 3장까지 이미지 첨부 가능  [권장 사이즈 : <strong>640 x 960</strong>픽셀 / 최대용량 : <strong>10MB</strong> 이내]</li>
+		    		<li>- 광고성 메시지는 <span>반드시 아래 유의사항을 사전 확인</span> 후 발송해 주시기 바랍니다.</li>
+		    	</ul>
+				<!-- 이용방법/혜택 -->
+				<div class="cdpop_cont current" id="listTab2_1">
+					<div>
+						<p class="cdpop_title">
+							<i class="cdpop_title_icon1"></i>선거문자 이용방법
+							<span class="customReq">
+								<button type="button" onclick="goToCustom();"><i></i>선거문자 맞춤제작</button>
+							</span>
+						</p>
+						<ul class="cdpop_info">
+							<li>
+								<i class="info_step1"></i>
+								<div>
+									<p>회원가입</p>
+								</div>
+							</li>
+							<li>
+								<i class="info_step2"></i>
+								<div>
+									<p>후보자등록</p>
+								</div>
+							</li>
+							<li>
+								<i class="info_step3"></i>
+								<div>
+									<p>전용계좌</p>
+								</div>
+							</li>
+							<li>
+								<i class="info_step4"></i>
+								<div>
+									<p>발신번호 인증</p>
+								</div>
+							</li>
+							<li>
+								<i class="info_step5"></i>
+								<div>
+									<p>문자전송</p>
+								</div>
+							</li>
+							<li>
+								<i class="info_step6"></i>
+								<div>
+									<p>세금계산서</p>
+								</div>
+							</li>
+						</ul>
+					</div>
+					<div>
+						<p class="cdpop_title"><i class="cdpop_title_icon2"></i>문자온 선거문자만의 장점 및 혜택</p>
+						<ul class="cdpop_benefit">
+							<li>
+								<div>
+									<i class="benefit1"></i>
+									<p>한 번에 대량으로 보내야 한다면?<span>10만건까지 동시 전송 가능</span></p>
+								</div>
+								<p>문자온의 대량전송(엑셀·TXT) 모듈을 통해
+									10만건의 대량문자도 쉽고 빠르게 전송 가능합니다.</p>
+							</li>
+							<li>
+								<div>
+									<i class="benefit2"></i>
+									<p>수신거부 번호가 필요하세요?<span>080 수신거부 번호 무료제공</span></p>
+								</div>
+								<p>선거문자 발송규정 준수를 위해
+									080 수신거부 번호를 무료로 제공해 드립니다.</p>
+							</li>
+							<li>
+								<div>
+									<i class="benefit3"></i>
+									<p>주소록 등록이 번거로우신가요?<span>주소록 등록 무료대행</span></p>
+								</div>
+								<p>주소록 등록파일(엑셀·TXT)을 문자온에 제공해
+									주시면 무료로 빠르고 신속하게 등록해 드립니다.</p>
+							</li>
+							<li>
+								<div>
+									<i class="benefit4"></i>
+									<p>홍보효과를 높이고 싶다면?<span>후보자만의 그림문자 맞춤제작</span></p>
+								</div>
+								<p>선거공약, 인사말, 후보자 사진 등을 넣어 그림문자를
+									맞춤 제작하여 홍보효과를 극대화할 수 있습니다.</p>
+							</li>
+							<li>
+								<div>
+									<i class="benefit5"></i>
+									<p>오류·실패건의 문자를 보상받고 싶다면?<span>오류·실패건 문자 100% 환불</span></p>
+								</div>
+								<p>번호오류, 수신거부, 수신실패 등으로 인해 문자전송이
+									실패한 경우 100% 환불(자동충전)해 드립니다.</p>
+							</li>
+							<li>
+								<div>
+									<i class="benefit6 "></i>
+									<p>전송결과가 궁금하다면?<span>실시간 전송결과 확인 가능</span></p>
+								</div>
+								<p>전송결과 및 실패사유를 실시간으로 제공해드립니다.</p>
+							</li>
+							<li>
+								<div>
+									<i class="benefit7"></i>
+									<p>20건씩 나눠서 보내야한다면?<span>20건씩 분할 예약 전송 가능</span></p>
+								</div>
+								<p>누구나 쉽고 편리하게 20건씩 나눠서 분할 전송이 가능합니다.</p>
+							</li>
+							<li>
+								<div>
+									<i class="benefit8"></i>
+									<p>필요한 서류가 있다면?<span>문자온에서 간편하게 신청 가능</span></p>
+								</div>
+								<p>문자온에서 발송내역서 출력이 가능하며,
+									세금계산서는 메일로 자동으로 발행됩니다.</p>
+							</li>
+						</ul>
+					</div>
+				</div><!--// 이용방법/혜택 -->
+			</div>
+			<div class="popup_btn_wrap2" style="margin: 0 auto 30px auto;">
+				<button type="button" class="tooltip-close" data-focus="candidate_popup03-close"  data-focus-next="candidate_popup03">닫기</button>                      
+			</div>
+		</div>
+	</div><!--// 선거문자 이용안내 팝업 -->
+	
+		<!-- 이벤트 잔여 캐시 정보 표시 팝업 -->
+	<div class="tooltip-wrap">
+		<div class="popup-com event_cash_popup popup07" tabindex="0" data-tooltip-con="popup07" data-focus="popup07" data-focus-prev="popup07-close">
+			<div class="popup_heading">
+				<p>이벤트 잔액</p>
+				<button type="button" class="tooltip-close" data-focus="popup07-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in">
+				<div class="table_wrap">
+					<div class="table_top">
+						<p class="popup_title_18">첫 결제 이벤트 잔액(캐시)</p>
+						<p><span class="c_e40000 fwBold"><fmt:formatNumber value="${eventRemainCash}" pattern="#,###.#"/></span>원</p>
+					</div>
+					<table class="popup_table_type2">
+						<colgroup>
+							<col style="width: 25%;">
+							<col style="width: auto;">
+						</colgroup>
+						<tbody>
+							<tr>
+								<th>단문(<fmt:formatNumber value="${eventMberInfo.eventShortPrice}" pattern="#,###.#"/>)</th>
+								<td><span class="c_002c9a fwBold"><fmt:formatNumber value="${(eventRemainCash / eventMberInfo.eventShortPrice) - ((eventRemainCash / eventMberInfo.eventShortPrice) % 1) }" pattern="#,###"/></span>건</td>
+							</tr>
+							<tr>
+								<th>장문(<fmt:formatNumber value="${eventMberInfo.eventLongPrice}" pattern="#,###.#"/>)</th>
+								<td><span class="c_002c9a fwBold"><fmt:formatNumber value="${(eventRemainCash / eventMberInfo.eventLongPrice) - ((eventRemainCash / eventMberInfo.eventLongPrice) % 1)}" pattern="#,###"/></span>건</td>
+							</tr>
+							<tr>
+								<th>그림 1장(<fmt:formatNumber value="${eventMberInfo.eventPicturePrice}" pattern="#,###.#"/>)</th>
+								<td><span class="c_002c9a fwBold"><fmt:formatNumber value="${(eventRemainCash / eventMberInfo.eventPicturePrice) - ((eventRemainCash / eventMberInfo.eventPicturePrice) % 1)}" pattern="#,###"/></span>건</td>
+							</tr>
+							<tr>
+								<th>그림 2장(<fmt:formatNumber value="${eventMberInfo.eventPicture2Price}" pattern="#,###.#"/>)</th>
+								<td><span class="c_002c9a fwBold"><fmt:formatNumber value="${(eventRemainCash / eventMberInfo.eventPicture2Price) - ((eventRemainCash / eventMberInfo.eventPicture2Price) % 1)}" pattern="#,###"/></span>건</td>
+							</tr>
+							<tr>
+								<th>그림 3장(<fmt:formatNumber value="${eventMberInfo.eventPicture3Price}" pattern="#,###.#"/>)</th>
+								<td><span class="c_002c9a fwBold"><fmt:formatNumber value="${(eventRemainCash / eventMberInfo.eventPicture3Price) - ((eventRemainCash / eventMberInfo.eventPicture3Price) % 1)}" pattern="#,###"/></span>건</td>
+							</tr>
+						</tbody>
+					</table>
+				</div>
+				<div class="popup_btn_wrap2">
+					<button type="button" class="tooltip-close" data-focus="popup07-close"  data-focus-next="popup07">닫기</button>
+				</div>
+			</div>
+		</div>
+	</div>
+	<form id="callToForm" name="callToForm" method="post">
+		<input type="hidden" id="callSeq" name="callSeq" value="<c:out value='${callSeq}'/>"/>
+		<input type="hidden" id="callToArr" name="callToArr" value="0"/>
+		<input type="hidden" id="pageIndex" name="pageIndex" value="1" />
+	</form>
+    <form id="msgForm" name="msgForm" method="post">
+    	<input type="hidden" id="send_adYn" name="send_adYn" value="N"/><!-- 문자종류 선거문자 여부 값 -->
+		<input type="hidden" id="msgType" name="msgType" value="4" /><!-- 문자 종류 : 단문 - 4, 장문/그림 - 6 -->
+		<input type="hidden" id="imgFilePath" name="imgFilePath" value="" /><!-- 선택 이미지 파일 경로 정보 , 로 구분 최대 3장까지 -->
+		<input type="hidden" id="imgFileId" name="imgFileId" value="" /><!-- 선택 이미지 파일 아이디 정보 , 로 구분 최대 3장까지 -->
+		<input type="hidden" id="fileCnt" name="fileCnt" value="0" /><!-- 첨부파일 추가 갯수 -->
+		<input type="hidden" id="callToList" name="callToList" value=""/><!-- 수신자 전화번호 리스트 -->
+		<input type="hidden" id="callFrom" name="callFrom" value=""/> <!-- 발신자 전화번호 -->
+		<input type="hidden" id="eachPrice" name="eachPrice" value="0"/> <!-- 문자 개별 단가 금액 -->
+		<input type="hidden" id="totPrice" name="totPrice" value="0"/> <!-- 총 결제 금액 -->
+		<input type="hidden" id="smsLen" name="smsLen" value="0"/> <!-- 문자 길이 정보 -->
+		<input type="hidden" id="reserveYn" name="reserveYn" value="N"/> <!-- 즉시/예약 선택여부 -->
+		<input type="hidden" id="reqDate" name="reqDate" value=""/> <!-- 예약문자 날짜 -->
+		<input type="hidden" id="imgCnt" value="0" />
+		<input type="hidden" id="smsTxt" name="smsTxt" value=""/><!-- 문자발송 문자 내용 -->
+		<input type="hidden" id="nameList" name="nameList" value=""/><!-- 문자발송 문자 이름 리스트 -->
+		<input type="hidden" id="rep1List" name="rep1List" value=""/><!-- 문자발송 문자 치환1 리스트 -->
+		<input type="hidden" id="rep2List" name="rep2List" value=""/><!-- 문자발송 문자 치환2 리스트 -->
+		<input type="hidden" id="rep3List" name="rep3List" value=""/><!-- 문자발송 문자 치환3 리스트 -->
+		<input type="hidden" id="rep4List" name="rep4List" value=""/><!-- 문자발송 문자 치환4 리스트 -->
+		<input type="hidden" name="templateYn" />
+		<input type="hidden" id="sPrice" name="sPrice" value="<c:out value="${shortPrice}"/>"/><!-- 단문문자 단가 -->
+		<input type="hidden" id="mPrice" name="mPrice" value="<c:out value="${longPrice}"/>"/><!-- 장문문자 단가 -->
+		<input type="hidden" id="pPrice" name="pPrice" value="<c:out value="${picturePrice}"/>"/><!-- 그림문자 단가 -->
+		<input type="hidden" id="p2Price" name="p2Price" value="<c:out value="${picture2Price}"/>"/><!-- 그림2장문자 단가 -->
+		<input type="hidden" id="p3Price" name="p3Price" value="<c:out value="${picture3Price}"/>"/><!-- 그림3장문자 단가 -->
+		<input type="hidden" id="myPrice" name="myPrice" value="<c:out value="${userMoney}"/>"/>
+		<input name="msgKind" type="hidden" value="C"/><!-- 문자종류 일반:N , 광고:A , 선거:C -->
+		<input type="hidden" id="txtReplYn" name="txtReplYn" value="N"/><!-- 변환문자 유무 -->
+		<input type="hidden" id="shortMsgCnt" name="shortMsgCnt" value="0"/><!-- 단문 변환문자 건수  -->
+		<input type="hidden" id="longMsgCnt" name="longMsgCnt" value="0"/><!-- 장문 변환문자 건수 -->
+
+		<!-- 주소록 등록 -->
+		<input type="hidden" id="addrGrpId" name="addrGrpId" value=""/>
+		<input type="hidden" id="addrGrpNm" name="addrGrpNm" value=""/>		
+		
+		<!-- 이벤트 관련 변수 -->
+		<input type="hidden" id="eventStatus" name="eventStatus" value="<c:out value='${eventMberInfo.eventStatus}'/>"/>
+		<input type="hidden" id="eventRemainCash" name="eventRemainCash" value="<c:out value='${eventRemainCash}'/>"/>
+		<input type="hidden" id="eventYn" name="eventYn" value="N"/>
+		
+		<!-- 스팸문자 관련 변수 -->
+		<input type="hidden" id="spamKeyword" name="spamKeyword"/>
+		<input type="hidden" id="spamStatus" name="spamStatus"/>
+		<input type="hidden" id="exceptSpamYn" name="exceptSpamYn" value="<c:out value='${exceptSpamYn}'/>"/>
+		
+		<!-- 이벤트 캐시 부족시 일반캐시로 계산을 위해 저장, 우영두 2023.03.28 -->
+		<input type="hidden" id="norsPrice" name="norsPrice" value="<c:out value="${norShortPrice}"/>"/><!-- 단문문자 단가(이벤트 단가 제외) -->
+		<input type="hidden" id="normPrice" name="normPrice" value="<c:out value="${norLongPrice}"/>"/><!-- 장문문자 단가(이벤트 단가 제외) -->
+		<input type="hidden" id="norpPrice" name="norpPrice" value="<c:out value="${norPicturePrice}"/>"/><!-- 그림문자 단가(이벤트 단가 제외) -->
+		<input type="hidden" id="norp2Price" name="norp2Price" value="<c:out value="${norPicture2Price}"/>"/><!-- 그림2장문자 단가(이벤트 단가 제외) -->
+		<input type="hidden" id="norp3Price" name="norp3Price" value="<c:out value="${norPicture3Price}"/>"/><!-- 그림3장문자 단가(이벤트 단가 제외) -->	
+		<input type="hidden" id="evnPhoneNumCnt" name="evnPhoneNumCnt" value="0"/><!-- 치환 이벤트 발송 수신자 갯수 -->
+		<input type="hidden" id="evnShortMsgCnt" name="evnShortMsgCnt" value="0"/><!-- 치환 이벤트 단문 건수 -->
+		<input type="hidden" id="evnLongMsgCnt" name="evnLongMsgCnt" value="0"/><!-- 치환 이벤트 장문 건수 -->
+
+		
+	<!-- <div class="top_content current" id="tab1_1"> -->
+	    <div class="heading">
+	        <h2>선거 20건씩 문자전송</h2>
+	        <div class="election_btnWrap">
+	        	<button type="button" class="button2 info" onclick="infoPop('selectMsgDataView2');">발송규정</button>
+	        	<button type="button" class="button2 info" data-tooltip="candidate_popup03">사용안내</button>
+	        	<c:choose>
+	        		<c:when test="${empty LoginVO}">
+						<button type="button" class="btnType" onclick="javascript:fn_candidateLoginChk(); return false;"><i class="election_btn1"></i>후보자 등록</button>	        		
+	        		</c:when>
+	        		<c:when test="${not empty mberManageVO && mberManageVO.dept eq 'c'}">
+	        			<button type="button" class="btnType" onclick="javascript:fn_mberDeptChk(); return false;"><i class="election_btn1"></i>후보자 등록</button>
+	        		</c:when>
+	        		<c:otherwise>
+	        			<button type="button" class="btnType" data-tooltip="candidate_popup01"><i class="election_btn1"></i>후보자 등록</button>	
+	        		</c:otherwise>
+	        	</c:choose>
+                <button type="button" class="btnType" onclick="location.href='/web/member/pay/BillPub.do'"><i class="election_btn2"></i>세금계산서</button>
+                <button type="button" class="btnType" onclick="location.href='/web/mjon/msgsent/selectMsgSentView.do'"><i class="election_btn3"></i>발송결과 출력하기</button>
+            </div>
+	    </div>
+	    <%-- <div class="titBox">
+            <p>- 90byte 초과 시, 장문으로 전환됩니다. 장문 문자는 최대 2,000byte까지 작성할 수  있습니다.</p>
+			<p>- 그림문자 1건에 포토 최대 3장 첨부가능  [권장 사이즈 : <span class="c_222 fwRg">640 x 960</span>픽셀 / 최대용량 : <span class="c_222 fwRg">10MB</span>이내]</p>
+            <p>- 광고성 메시지는 반드시 유의사항 확인 후 발송해 주시기 바랍니다. <span><a href="#" data-tooltip="candidate_popup02">[선거문자 관련규정 안내]</a></span></p>
+        </div> --%>
+	    <div class="send_general">
+	        <div class="send_left">
+	        	<%-- <dl class="myprice_view">
+	        		<dt>나의 요금제</dt>
+	        		<dd>
+	        			<ul>
+							<li><span class="type">단문</span><span class="price"><c:out value="${shortPrice}"/></span>원</li>
+							<li><span class="type">장문</span><span class="price"><c:out value="${longPrice}"/></span>원</li>
+							<li><span class="type">그림</span><span class="price"><c:out value="${picturePrice}"/></span>원 <span class="count">(2장 : <c:out value="${picture2Price}"/>원 / 3장 : <c:out value="${picture3Price}"/>원)</span></li>
+						</ul>
+	        		</dd>
+	        	</dl> --%>
+	            <table class="tType1">
+	                <caption>일반 문자보내기 분류 번호 내용 등을 입력하는 표</caption>
+	                <colgroup>
+	                    <col style="width: 100px;">
+	                    <col style="width: auto;">
+	                </colgroup>
+	                <tbody>
+	                    <!-- <tr>
+	                        <th scope="row">문자분류</th>
+	                        <td class="send_cf">
+	                            <input id="send_adYnY" type="radio" name="send_adYn" value="Y" checked="checked">
+	                            <label for="send_adYnY">선거</label>
+	                        </td>
+	                    </tr> -->
+	                    <tr>
+                            <th scope="row">발신번호</th>
+                            <td class="put_num">
+                                <label for="callFrom" class="label"></label>
+                                <select id="callFromList" name="callFromList" class="sel_number" onchange="setCandidatePhone();">
+                                	<c:choose>
+                                		<c:when test="${not empty resultPhonList}">
+                                			<c:forEach var="phonList" items="${resultPhonList}" varStatus="status">
+												<option value="${phonList}">${phonList}</option>
+											</c:forEach>
+                                		</c:when>
+                                		<c:otherwise>
+                                			<option value="">등록된 발신 번호가 없습니다.</option>
+                                		</c:otherwise>
+                                	</c:choose>
+								</select>
+                                <button type="button" class="btnType btnType6" onclick="location.href='/web/user/sendNumberManage.do'">번호등록</button>
+                            </td>
+                        </tr>
+						<tr class="msg_title">
+                            <th scope="row">제목</th>
+                            <td>
+                           		<ul class="title_wrap">
+                           			<li>
+                           				<input id="title_y" type="radio"name="title_status" value="Y" onchange="titleStatus(this);">
+			                            <label for="title_y">사용</label>
+			                            <input id="title_n" type="radio" name="title_status" value="N" onchange="titleStatus(this);" checked="checked">
+			                            <label for="title_n">사용안함</label>
+                           			</li>
+                           			<li class="textbox">
+                           				<label for="mmsSubject" class="label"></label>
+										<input type="text" size="20" id="mmsSubject" name="mmsSubject" class="w100" maxlength="20" placeholder=""  onfocus="this.placeholder=''" >
+                           			</li>
+                           		</ul>
+                            </td>
+                        </tr>
+						<!-- 문자 내용 영역 -->
+						<tr>
+                            <th scope="row" class="vTop">내용</th>
+                            <td class="putText">
+                                <div class="clearfix">
+                                    <div class="put_left short">
+                    					<!-- 업로드한 이미지의 썸네일 영역 -->
+                                    	<ul class="thumb_wrap liOnImg"></ul>
+                   						<!-- //업로드한 이미지의 썸네일 영역 -->
+                                        <label for="smsTxtArea" class="label"></label>
+                                        <textarea id="smsTxtArea" name="smsTxtArea" class="put_text" placeholder="내용을 입력해주세요.
+-90btye 초과 시 LMS 자동전환
+-파일첨부 시 MMS 자동전환"></textarea>
+                                        <div class="text_length">
+											<div name="afterDeny">
+                                            	<p>
+                                             	<span class="fwMd" id="msgLeng">0 /</span>
+                                             	<span class="c_002c9a fwMd" id="limitLeng"> 90</span>byte
+                                            	</p>
+                                            	<span class="msg_com msg_short">단문</span>
+											</div>
+                                        </div>
+                                    </div>
+                                    <div class="put_right">
+                                        <div class="btn_popup_wrap spc_wrap">
+                                        	<button type="button" class="btnType btnType7" onclick="miniPopup(this);">특수문자</button>
+											<div class="send_miniPop spc_character">
+												<div class="tab_character">
+													<a href="#none" class="on">특수문자</a>
+													<a href="#none">웃음</a>
+													<a href="#none">슬픔</a>
+													<a href="#none">분노</a>
+													<a href="#none">사랑</a>
+													<a href="#none">그외</a>
+												</div>
+												<!-- 특수문자 부분 -->
+												<div class="cnt_character on">
+													<div class="box_character">
+														<c:forEach var="symbolList" items="${symbolList}" varStatus="status">
+															<c:if test="${symbolList.symbolType == 'D'}">
+																<a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}"><c:out value="${symbolList.symbol}"/></a>
+															</c:if>
+														</c:forEach>
+													</div>
+												</div>
+												<!-- 웃음 -->
+												<div class="cnt_character emt_character">
+													<div class="box_character">
+														<c:forEach var="symbolList" items="${symbolList}" varStatus="status">
+															<c:if test="${symbolList.symbolType == 'S'}">
+																<a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}">${symbolList.symbol}</a>
+															</c:if>
+														</c:forEach>
+													</div>
+												</div>
+												<!-- //웃음 -->
+												<!-- 슬픔 -->
+												<div class="cnt_character emt_character">
+													<div class="box_character">
+														<c:forEach var="symbolList" items="${symbolList}" varStatus="status">
+															<c:if test="${symbolList.symbolType == 'C'}">
+																<a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}">${symbolList.symbol}</a>
+															</c:if>
+														</c:forEach>
+													</div>
+												</div>
+												<!-- //슬픔 -->
+												<!-- 분노 -->
+												<div class="cnt_character emt_character">
+													<div class="box_character">
+														<c:forEach var="symbolList" items="${symbolList}" varStatus="status">
+															<c:if test="${symbolList.symbolType == 'A'}">
+																<a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}">${symbolList.symbol}</a>
+															</c:if>
+														</c:forEach>
+													</div>
+												</div>
+												<!-- //분노 -->
+												<!-- 사랑 -->
+												<div class="cnt_character emt_character">
+													<div class="box_character">
+														<c:forEach var="symbolList" items="${symbolList}" varStatus="status">
+															<c:if test="${symbolList.symbolType == 'L'}">
+																<a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}">${symbolList.symbol}</a>
+															</c:if>
+														</c:forEach>
+													</div>
+												</div>
+												<!-- //사랑 -->
+												<!-- 그외 -->
+												<div class="cnt_character emt_character emt_etc ">
+													<div class="box_character">
+														<c:forEach var="symbolList" items="${symbolList}" varStatus="status">
+															<c:if test="${symbolList.symbolType == 'E'}">
+																<a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}">${symbolList.symbol}</a>
+															</c:if>
+														</c:forEach>
+													</div>
+												</div>
+												<!-- //그외 -->
+												<button type="button" class="btn_close" onclick="miniPopup(this);">닫기</button>
+											</div>
+										</div>
+										<div class="btn_popup_wrap convers_wrap">
+											<button type="button" class="btnType btnType7" onclick="advMsgInsert();">선거필수문구입력</button>
+									        <!-- <button type="button" class="btnType btnType7" onclick="miniPopup(this)">특정문구 일괄변환<i class="qmMark"></i></button>
+											<div class="send_miniPop convers">
+												<div>
+													<div class="convers_top">
+														<span>특정문구 일괄변환이란?</span>
+														<p>주소록, 엑셀에 입력된 내용을 이용해 수신자마다 다른 내용의<br> 메시지를 발송하는 기능</p>
+													</div>
+													<div class="convers_middle"><a href="javascript:void(0)" class="changeWord" value="[*이름*]">[*이름*]</a></div>
+													<div class="convers_bottom">
+														<a href="javascript:void(0)" class="changeWord" value="[*1*]">[*1*]</a>
+														<a href="javascript:void(0)" class="changeWord" value="[*2*]">[*2*]</a>
+														<a href="javascript:void(0)" class="changeWord" value="[*3*]">[*3*]</a>
+														<a href="javascript:void(0)" class="changeWord" value="[*4*]">[*4*]</a>
+													</div>
+												</div>
+												<button type="button" class="btn_close" onclick="miniPopup(this);">닫기</button>
+											</div> -->
+										</div>
+                                        <button type="button" class="btnType btnType7" onclick="javascript:fnGoMyMsg(); return false;">내문자함</button>
+                                        <button type="button" class="btnType btnType8" onclick="openPhotoEditor();">이미지 불러오기</button>
+	                                    <div class="send_btnWrap">
+	                                        <button type="button" class="btnType btnType9" onclick="javascript:fn_saveMyMsg(); return false;">문자저장</button>
+	                                        <button type="button" class="btnType btnType9 btnReset">초기화</button>
+	                                    </div>
+                                	</div>
+                            	</div>
+                            	<p>* 현재 [<span id="nowMsgType">단문</span>] <span class="c_e40000 fwBold nowMsgCnt">0</span>건 발송 가능합니다.</p>
+                         	</td>
+                        </tr>
+	                    <tr>
+                            <th scope="row" class="vTop">받는사람</th>
+                            <td class="putText">
+                                <div class="clearfix receipt_num">
+									<div class="receipt_num_top">
+										<label for="callTo" class="label">받는 번호입력</label>
+										<input type="text" id="callTo" name="callTo"  placeholder="번호를 입력하세요" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" onfocus="this.placeholder=''" onblur="this.placeholder='번호를 입력하세요'" style="width:340px;">
+										<button type="button" class="btnType btnType6 addCallToF">번호추가</button>
+										<span><span class="vMiddle">*</span> 중복번호는 한번만 발송됩니다.</span>
+									</div>
+                                    <div class="receipt_num_midde receipt_number_table_wrap">
+	                                    <%-- 받는 사람 리스트 박스 시작 --%>
+	                                    <div class="put_left" id="twCallToList">
+											<div class="listType list">
+												<ul class="thead_ul table_ul">
+													<li></li>
+													<li>
+														번호
+														<!-- <button type="button" class="btn_sort_up"><img src="/publish/images/sortUp.png"></button>
+														<button type="button" class="btn_sort_down"><img src="/publish/images/sortDown.png"></button> -->
+													</li>
+													<li></li>
+													<li>번호
+														<!-- <button type="button" class="btn_sort_up"><img src="/publish/images/sortUp.png"></button>
+														<button type="button" class="btn_sort_down"><img src="/publish/images/sortDown.png"></button> -->
+													</li>
+												</ul>
+												<!-- <ul class="tbody_ul table_ul">
+												</ul> -->
+											</div>
+	                                    </div>
+	                                    <%-- 받는 사람 리스트 박스 종료 --%>
+										<div class="put_right">
+											<button type="button" data-tooltip="popup06"  class="btnType btnType7 popupAddr">주소록 불러오기</button>
+											<button type="button" data-tooltip="popup02"  class="btnType btnType7">엑셀 불러오기</button>
+											<div class="btn_popup_wrap">
+												<button type="button" class="btnType btnType3 check_validity">오류 검사 <i class="qmMark"></i></button>
+												<div class="error_hover_cont send_hover_cont">
+													<p>휴대폰 번호 입력 시 해당 휴대폰 번호에 대한 형식이 어긋나거나 휴대폰 번호에 오류가 있는지 등을 검사하는 기능</p>
+													<span>(예시) 010-1234-0001(O) / 010-123-0001(X)</span>
+												</div>
+											</div>
+											<dl class="receipt_info">
+												<dt>전체 받는사람</dt>
+												<dd>
+													<p><b id="totCallToCnt">0</b> 명</p>
+												</dd>
+												<dt>전송완료</dt>
+												<dd>
+													<p><b class="c_e40000" id="sendComplete">0</b> 명</p>
+												</dd>
+												<dt>잔여 받는사람</dt>
+												<dd>
+													<p><b class="c_002c9a" id="sendReady">0</b> 명</p>
+												</dd>
+											</dl>
+										</div>
+									</div>
+                                </div>
+                            </td>
+                        </tr>
+                        <tr>
+                            <th colspan="2" class="billingAmount">
+                            	<div>
+	                                <div class="final_pay">
+	                                    <div class="pay_info_list">
+	                                    	<p>발송금액 :</p>
+	                                    	<div class="info" id="repPriceTxt">
+	                                    		단문 : <strong>20</strong>건<span>/</span>장문 : <strong>150</strong>건<span>/</span>그림문자 : <strong>30</strong>건
+	                                    	</div>
+	                                    </div>
+	                                    <p class="price" ><span id="totalPriceTxt">0</span>원<span>(부가세 포함)</span></p>
+	                                </div>
+	                                <c:if test="${eventRemainCash > 0  && eventMberInfo.eventStatus eq 'Y'}">
+	                                	<p style="text-align: right; font-size: 14px; color: #666; margin: -10px 0 15px 0; font-weight: 300;">* 이벤트회원의 발송금액은 이벤트단가를 적용하여 계산된 금액이므로 실제 발송금액과 다를 수 있습니다.</p>
+	                                </c:if>
+	                                <div class="pay_type clearfix">
+	                                	<fmt:formatNumber type="number" maxFractionDigits="3" value="${userMoney}" var="commaPrice" />
+										<div>
+											<input type="radio" id="radio_bill_1" name="radio_bill" checked="checked">
+											<label for="radio_bill_1">보유잔액</label>
+											<%-- <label for="radio_bill_1">내 충전금 (<span id="spUserMoney">
+												<c:choose>
+													<c:when test="${not empty userMoney}">
+														<c:out value="${commaPrice}"/>
+													</c:when>
+													<c:otherwise>
+														0
+													</c:otherwise>
+												</c:choose>
+											</span>원)</label> --%>
+											<label for="userMoney" class="label">보유잔액</label>
+											<input type="text" id="userMoney" name="userMoney" value="<c:out value='${commaPrice}'/>" readonly>
+											<span class="won">원</span>
+											<button type="button" class="btnType btnType21" onclick="location.href='/web/member/pay/PayView.do'">충전</button>
+										</div>
+										<c:if test="${eventRemainCash > 0  && eventMberInfo.eventStatus eq 'Y'}">
+												<div><button type="button" data-tooltip="popup07" class="btnType btnType3 btn_event_cash">이벤트 잔액</button></div>
+										</c:if>
+									</div>
+									
+									<!--발송금액 아래 등급별 가격안내 추가-->
+									<div class="my_price_wrap" id="myPriceWrap" style="display: none;">
+										<div class="center-line"></div>
+										<ul>
+											<li class="title">
+												<img src="/publish/images/content/icon_mypage_message.png" alt="">나의 단가 &nbsp;<span>:</span> &nbsp;
+											</li>
+											<li class="price_line">
+												<span class="type">단문</span>
+												<span class="price"><fmt:formatNumber value="${shortPrice}" pattern="###.#" /></span>원
+												<span class="line">/ &nbsp;</span>
+											</li>
+											<li class="price_line">
+												<span class="type">장문</span>
+												<span class="price"><fmt:formatNumber value="${longPrice}" pattern="###.#" /></span>원
+												<span class="line">/ &nbsp;</span>
+											</li>
+											<li class="price_line">
+												<span class="type">그림</span>
+												<span class="price"><fmt:formatNumber value="${picturePrice}" pattern="###.#" /></span>원 
+												(2장 : <fmt:formatNumber value="${picture2Price}" pattern="###.#" />원 / 3장 : <fmt:formatNumber value="${picture3Price}" pattern="###.#" />원)
+											</li>
+										</ul>
+									</div>	
+									<!-- End -->									
+									
+                                </div>
+                            </th>
+                        </tr>
+                        <%-- <tr>
+                            <th scope="row">추천인 ID</th>
+                            <td class="check_num">
+                                <input id="radio5" type="radio"name="recom" checked="checked">
+                                <label for="radio5">없음</label>
+                                <input id="radio6" type="radio" name="recom">
+                                <label for="radio6">있음</label>
+                                <div>
+                                    <label for="recommId" class="label"></label>
+                                    <input type="text" size="20" id="recommId" name="recommId" value="" placeholder="추천인 아이디 입력" onfocus="this.placeholder=''" onblur="this.placeholder='추천인 아이디 입력'">
+                                    <button type="button" class="btnType btnType9" id="recommBtn">추천인 확인</button>
+                                </div>
+                            </td>
+                        </tr> --%>            
+                    </tbody>
+                </table>
+            </div>
+            <div class="send_right">
+                <div class="phone">
+                   	<div class="phoneIn">
+						<div>
+							<p><img src="/publish/images/search.png">미리보기</p>
+							<div class="text_length2 clearfix preShort">
+								<span class="msg_com msg_short">단문</span>
+								<div>
+									<span>글자크기</span>
+									<button type="button" class="fontPlus"><img src="/publish/images/content/font_plus.png"></button>
+									<button type="button" class="fontMinus"><img src="/publish/images/content/font_minus.png"></button>
+								</div>
+							</div>
+							<div class="text_length2 clearfix prePhoto">
+								<span class="msg_com msg_photo">포토</span>
+								<ul class="photo_msg_num">
+									<li class="photo_num_01" onclick="imgClick(0);"><a href="#none">1</a></li>
+									<li class="photo_num_02" onclick="imgClick(1);"><a href="#none">2</a></li>
+									<li class="photo_num_03" onclick="imgClick(2);"><a href="#none">3</a></li>
+								</ul>
+								<div>
+									<span>글자크기</span>
+									<button type="button" class="fontPlus"><img src="/publish/images/content/font_plus.png"></button>
+									<button type="button" class="fontMinus"><img src="/publish/images/content/font_minus.png"></button>
+								</div>
+							</div>
+							<!-- 텍스트 미리보기 -->
+							<div class="text_preview">
+								<div class="preiew_img preViewShort"></div>
+								<div class="preview_auto">
+									<p class="none_txt">내용을 입력해주세요.222222</p>
+									<pre class="realtime">adfasfdasdf</pre>
+								</div>
+							</div>
+							<!-- //텍스트 미리보기 -->
+						</div>
+					</div>
+                       <p class="addText">※ 단말기 설정에 따라 다르게 보일 수 있습니다</p>
+				</div>
+				<div class="phone_bottom">
+                    <div class="send_rev">
+                    	<div class="send_content">
+		                    <div class="rev_radio">
+		                    	<ul>
+		                    		<li><input type="radio" id="reserYnN" name="reserYn" value="N" checked="checked"><label for="reserYnN">즉시</label></li>
+		                    		<li><input type="radio" id="reserYnY" name="reserYn" value="Y"><label for="reserYnY">예약</label></li>
+		                    	</ul>
+		                    </div>
+		                    <div class="send_btn">
+		                        <button type="button" class="btnType btnType11" onclick="javascript:fn_sendMsgData(); return false;">발송하기</button>
+		                        <button type="button" class="btnType btnType10" onclick="javascript:fnTestSend(); return false;">테스트발송</button>
+		                    </div>
+	                    </div>
+                        <div class="rev_selected">
+                            <div class="rev_top">
+               		            <span>날짜 :</span>
+               		            <div class="calendar_wrap">
+									<input type="text" class="startDate2 inp resDate calendar02" title="검색 시작일" id="startDate2" name="startDate2" value="" data-datecontrol="true">
+								</div>
+               		            <label for="msgResHour" class="label">시 선택</label>
+								<div class="selBox">
+		       		            	<select class="selType1" id="msgResHour" name="msgResHour">
+		       		            		<c:forEach  var="hour"  begin="0" end="23" step="1" varStatus="status">
+		       		            			<c:choose>
+		       		            				<c:when test="${hour < 10}">
+		         		            			<option value="0${hour}">0${hour}시</option>
+		       		            				</c:when>
+		       		            				<c:otherwise>
+		       		            					<option value="${hour}">${hour}시</option>
+		       		            				</c:otherwise>
+		       		            			</c:choose>
+		       		            		</c:forEach>
+		       		            	</select>
+		       		            	<label for="msgResMin" class="label">분 선택</label>
+		       		            	<select class="selType1" id="msgResMin" name="msgResMin">
+		       		            		<c:forEach var="min" begin="0" end="59" step="1">
+		       		            			<c:choose>
+		       		            				<c:when test="${min < 10}">
+		         		            			<option value="0${min}">0${min}분</option>
+		       		            				</c:when>
+		       		            				<c:otherwise>
+		       		            					<option value="${min}">${min}분</option>
+		       		            				</c:otherwise>
+		       		            			</c:choose>
+		       		            		</c:forEach>
+		       		            	</select>
+								</div>
+               		        </div>
+                           	<!-- <div class="rev_bottom">
+             		            <input type="checkbox" id="divideChk" name="divideChk">
+             		            <label for="divideChk">분할전송</label>
+             		            <input type="text" class="dividType1" id="divideCnt" name="divideCnt" value="20" onkeypress='return checkNumber(event)' maxlength="4"/>
+     		            		<label for="divideCnt">건씩</label>
+             		            <select class="selType1" id="divideTime" name="divideTime">
+             		                <option value="1">01분</option>
+		        		            <option value="2">02분</option>
+		        		            <option value="3">03분</option>
+		        		            <option value="4">04분</option>
+             		                <option value="5">05분</option>
+             		                <option value="10">10분</option>
+             		                <option value="15">15분</option>
+             		                <option value="20">20분</option>
+             		                <option value="30">30분</option>
+             		            </select>
+             		            <label for="divideTime">간격</label>
+             		        </div> -->
+                        </div>
+                    </div>
+                </div>
+             </div>
+        </div>
+    <!-- </div> --><!--// tab content1 -->
+</form>
+<form id="latestMsgForm" name="latestMsgForm" method="post">
+	<input type="hidden" id="userId" name="userId" value="${LoginVO.id}"/>
+</form>
+<form id="addMyMsgForm" name="addMyMsgForm" method="post">
+	<input type="hidden" id="msgId" name="msgId" value=""/>
+	<input type="hidden" id="pageType1" name="pageType" value=""/>
+</form>
+<form name="popForm" id="popForm" method="post">
+	<input type="hidden"id="pageType2" name="pageType" value=""/> 
+</form>
+<form name="goToCustomForm" id="goToCustomForm" method="post" action="/web/mjon/custom/selectMsgCustomView.do">
+	<input type="hidden" id="pageType3" name="pageType" value="msgcampain"/> 
+</form>
+<form name="testSendForm" id="testSendForm" method="post">
+	<input type="hidden" name="msgKind" value="C"/> 
+	<input type="hidden" name="msgpreview" value=""/> 
+	<input type="hidden" name="mmsSubject" value=""/>
+	<input type="hidden" name="callFrom" value=""/>
+	<input type="hidden" name="imgFilePath" value=""/>
+	<input type="hidden" name="eachPrice" value=""/>
+	<input type="hidden" name="msgType" value=""/>
+	<input type="hidden" name="smsTxt" value=""/>
+</form>
 
src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataView.jsp (added)
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataView.jsp
@@ -0,0 +1,2271 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<%@ page import="itn.com.cmm.LoginVO" %>
+
+<!-- <script src="/publish/js/content.js"></script> -->
+
+<script type="text/javascript">
+
+var _regExp1 = /(^02.{0}|^01.{1}|^[0-9]{3})-?([0-9]{3,4})-?([0-9]{4})$/;
+
+var imgFilePath = []; // 최종 선택한 이미지 경로 저장 변수
+var imgFileId = []; // 최종 선택한 파일 아이디 저장 변수
+var templateYn = []; // 템플릿 사용 여부 저장 변수
+var tableL = null; //좌측 받는 사람 주소록 Tabulator 변수
+var tableR = null; //우측 주소록 불러오기 Tabulator 변수
+var tableAddr = null; //주소록 불러오기 팝업 Tabulator 변수
+
+var loginVO = '${loginVO}';
+
+var popCustomScrT=0;	// 맞춤제작 요청 JSPark => 2023.02.21 추가
+var msgResendAllFlag = "${msgResendAllFlag}";
+var msgResendAllGroupId = "${msgResendAllGroupId}";
+var msgResendAllAdvertiseYn = "${msgResendAllAdvertiseYn}";
+var msgResendAllReplaceYn = "${msgResendAllReplaceYn}";
+
+$(document).ready(function(){
+	//문자 발송 화면 폼 불러오기
+	listMsgDataView();
+	
+	//최 하단  문자 샘플 탭 리스트 내용 불러오기
+	fnLetterListAjax(1);
+	
+	//최 하단 그림문자 탭 리스트 내용 불러오기
+	fnPhotoListAjax(1);
+	
+	// 내보관함 리스트 로그인이 완료된 경우에만 로드되도록
+	if(loginVO != "" && loginVO != null){
+		//최 하단 내문자함 탭 리스트 내용 불러오기
+		fnMyMsgListAjax(1);
+	}
+	
+	//그림문자 샘플 탭 활성화 시키기
+	TabType2($('.tabType2 li').eq(1), '2');
+	
+	$(".tDep2_cateCode a").each(function(index, item){
+		
+		if($(this).text() == "선거"){
+			$('.tDep2_cateCode').find('.on').removeClass('on');
+			$(this).addClass('on');
+		}
+	})
+	
+	// 맞춤제작 요청 JSPark => 2023.02.21 추가
+	//맞춤제작 등록 Popup 
+	//customPopup();	
+
+});
+
+//문자 그룹정보 => 재전송용
+function getMjMsgGroupInfoByResend() {
+	$.ajax({
+		type: "POST",
+		url: "/web/mjon/msgdata/selectMjMsgGroupInfoByResendAjax.do",
+		data: {"msgResendAllGroupId" : msgResendAllGroupId},
+		dataType:'json',
+		async: false,
+		success: function (data) {
+			//alert(JSON.stringify(data));
+			if(data.isSuccess == true){
+				var msgData = data.resultMsgInfo;
+				var fileData = data.resultMsgAddPhotoInfo;
+				
+				// 발신번호
+				var reCallFrom = $.trim(removeDash($("#callFromList option:selected").val()));
+				if ($.trim(removeDash(msgData.callFrom)) != reCallFrom) {
+					alert("발신번호가 이전에 발송한 번호가 아닙니다.\n발신번호를 확인해주세요.")
+				}
+				
+				var smsTxt = msgData.smsTxt;
+				var subject = msgData.subject;
+				var fileId = "";
+				var filePath = "";
+				var len = fileData.length;
+				
+				// 기존 내용 지워주기
+				//$(".btnReset").trigger("click");
+				$('.delLi').each(function(){
+					$(this).remove();
+				});
+				
+				$('.preBoxF').each(function(){
+					$(this).remove();
+				});
+
+				$('#imgCnt').val(0);
+				
+				// 기존 imgFileId, imgFilePath 배열에 있는 내용 초기화 해주기
+				imgFilePath = [];
+				imgFileId = [];
+
+				// 문자제목
+				if (msgData.subject != null && msgData.subject != "") {
+					$('.msg_title').addClass('active');
+					$("input:radio[name='title_status']:radio[value='Y']").prop('checked', true); // 선택하기
+					$('.textbox').show();
+					$("#mmsSubject").val(subject);	
+				}
+				
+				// 문자내용
+				// 선거 기본정보 제거
+				if (smsTxt.indexOf("(선거운동정보)") == 0) {
+					smsTxt = $.trim(smsTxt.replace("(선거운동정보)", ""));
+					var smsTxtLastIdxCnt = smsTxt.lastIndexOf("후보자전화번호");
+					if (smsTxtLastIdxCnt != -1) {
+						smsTxt = $.trim(smsTxt.substring(0, smsTxtLastIdxCnt));	
+					}
+				}
+				$('#smsTxtArea').val(smsTxt);
+				
+				// 첨부 이미지가 있는경우 이미지 처리해주기
+				if(len > 0) {
+					for(var i=0; i < len; i++) {
+						var num = i + 1;
+						var imgId = fileData[i].atchFileId;
+						var imgSn = fileData[i].fileSn;
+						var fileStreCours = fileData[i].fileStreCours;
+						var streFileNm = fileData[i].streFileNm;
+						var fileExtsn = fileData[i].fileExtsn;
+						
+						/* var imgSrc = fileStreCours + "/" + streFileNm + "." + fileExtsn; */
+						var imgSrc = '/cmm/fms/getImage2.do?atchFileId=' + imgId + '&fileSn=' + imgSn;
+						myMsgImageControl(imgSrc, "edit_n", "Template", imgId);
+					}
+					
+					fnByteString($('#smsTxtArea').val());
+				}
+				else {
+					fnByteString($('#smsTxtArea').val());
+				}
+				
+				// 문자전송 상단으로 이동
+				var sendOfT=$('.send_top').offset().top;
+				$('html,body').stop().animate({'scrollTop':sendOfT-60},250);		
+				
+			} else {
+				//alert("Message : " + msg);
+			}
+		},
+		error: function (e) { 
+			//alert("저장에 실패하였습니다."); 
+			//console.log("ERROR : ", e); 
+		}
+	});
+}
+
+// 문자 상세정보 => 재전송용
+function getMjMsgListByResend() {
+	$.ajax({
+		type: "POST",
+		url: "/web/mjon/msgdata/selectMjMsgListByResendAjax.do",
+		data: {"msgResendAllGroupId" : msgResendAllGroupId},
+		dataType:'json',
+		async: true,
+		success: function (data) {
+			if(data.isSuccess == true){
+				var listCnt = data.resultList.length;
+				
+				//수신자 처리 변수
+				var callToList = [];	//수신자 처리 리스트
+				var tableData = [];		//수신자 tabulator 처리 변수
+				
+				for(var i = 0; i < listCnt; i++){ // 수신자 리스트 Tabulator에 입력해 주기
+					callToList[i] = data.resultList[i].callTo;
+					tableData.push({phone: removeDash(callToList[i])});
+				}
+				
+				if(tableData.length > 0){
+					tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기
+
+					totRows = tableL.getRows().length; 
+					updateTotCnt(totRows); //전체 데이터 갯수 구하기
+					
+					//결제 금액 구하기
+				    totalPriceSum(totRows);		
+				}				
+				
+			} else {
+				//alert("Message : " + msg);
+			}
+		},
+		error: function (e) { 
+			//alert("저장에 실패하였습니다."); 
+			//console.log("ERROR : ", e); 
+		}
+	});
+}
+
+//문자발송 URL Move
+function goMsgUrlMove() {
+	document.location.href = "/web/mjon/msgcampain/selectTWMsgDataView.do";
+}
+
+function listMsgDataView(){
+	
+	var sendData = $(document.searchForm).serializeArray() ;
+	$(".contentArea").load("/web/mjon/msgcampain/selectMsgTWDataSMLViewAjax.do", sendData ,function(response, status, xhr){
+		
+		//문자 재전송 처리를 위해 사용
+		$("#msgForm").ready(function(){	//문자 내용 폼이 로드된 후 실행
+			
+			var msgResendFlag = '${reSendMsgVO.msgResendFlag}';
+			var msgSeqList = [];
+			msgSeqList = '${reSendMsgVO.msgSeqList}';
+			if(msgSeqList.length > 0){
+					
+				fnMsgResend(msgResendFlag, msgSeqList);
+				
+			}
+
+			//주소록에서 주소를 전송한 경우 처리
+			var moveAddrFlag = '${addrVO.moveAddrFlag}';
+			var addrIdList = [];
+			addrIdList = '${addrVO.addrIdList}';
+			if(addrIdList.length > 0) {
+				fnAddrSet(moveAddrFlag, addrIdList);
+			}		
+			
+			// 문자 재전송 New
+			if (msgResendAllFlag == "Y") {
+				if (msgResendAllReplaceYn != "Y") {
+					// 문자 그룹정보 => 재전송용
+					getMjMsgGroupInfoByResend();
+				}
+
+				// 문자 상세정보 => 재전송용
+				getMjMsgListByResend();
+			}	
+			
+		});	
+		
+		
+	}).slideDown();
+}
+
+function fnAddrSet(moveAddrFlag, addrIdList){
+	
+	if(moveAddrFlag == 'Y'){ // 주소록에서 넘어오는 경우 
+		
+		var form = document.moveAddrForm;
+		form.addrIdList.value = addrIdList;
+		
+		var data = new FormData(form);
+		url = "/web/mjon/addr/selectAddrDataListAjax.do";
+		
+		$.ajax({
+	        type: "POST",
+	        url: url,
+	        data: data,
+	        dataType:'json',
+	        async: true,
+	        processData: false,
+	        contentType: false,
+	        cache: false,
+	        success: function (returnData, status) {
+				if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+					if("fail"==returnData.result){
+						
+						alert(returnData.message);
+						return false;
+						
+					}else if("loginFail"==returnData.result){
+						
+						alert(returnData.message);
+						return false;
+						
+					}else if(returnData.resultListCnt == '0'){
+						
+						alert("전달된 주소록이 없습니다.");
+						return false;
+						
+					}else{
+						
+						var listCnt = returnData.resultListCnt;
+						
+						//수신자 처리 변수
+						var tableData = [];		//수신자 tabulator 처리 변수
+						
+						for(var i = 0; i < listCnt; i++){ // 수신자 리스트 Tabulator에 입력해 주기
+							
+							tableData.push({
+								name: returnData.resultList[i].addrNm
+								,phone: removeDash(returnData.resultList[i].addrPhoneNo)
+								,rep1: returnData.resultList[i].addrInfo1
+								,rep2: returnData.resultList[i].addrInfo2
+								,rep3: returnData.resultList[i].addrInfo3
+								,rep4: returnData.resultList[i].addrInfo4
+								});
+							
+						}
+
+						tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기
+						
+						totRows = tableL.getRows().length;
+						
+						updateTotCnt(totRows); //전체 데이터 갯수 구하기
+						
+						//결제 금액 구하기
+					    totalPriceSum(totRows);
+						
+						return false;
+						
+					}
+				
+				} else if(status== 'fail'){
+					alert(returnData.message);
+				}
+			},
+	        error: function (e) { 
+	        	alert("주소록 가져오기에 실패하였습니다."); 
+	        	console.log("ERROR : ", e); 
+	        },
+			beforeSend : function(xmlHttpRequest) {
+	        	//로딩창 show
+	        	$('.loading_layer').addClass('active');				
+			},	        	        
+	        complete : function(xhr, textStatus) {
+	        	//로딩창 hide
+	        	$('.loading_layer').removeClass('active');
+			}	      
+	    });
+		
+	}
+	
+}
+
+function fnMsgResend(msgResendFlag, msgSeqList){
+	
+	if(msgResendFlag == 'Y'){ // 문자재전송에서 넘어오는 경우 
+		
+		var form = document.msgResendForm;
+		form.msgSeqList.value = msgSeqList;
+		
+		var data = new FormData(form);
+		url = "/web/mjon/msgcampain/selectReSendMsgDataListAjax.do";
+		
+		$.ajax({
+	        type: "POST",
+	        url: url,
+	        data: data,
+	        dataType:'json',
+	        async: false,
+	        processData: false,
+	        contentType: false,
+	        cache: false,
+	        success: function (returnData, status) {
+				if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+					if("fail"==returnData.result){
+						
+						alert(returnData.message);
+						return false;
+						
+					}else if("loginFail"==returnData.result){
+						
+						alert(returnData.message);
+						return false;
+						
+					}else if(returnData.resultListCnt == '0'){
+						
+						alert("재전송 문자내용이 없습니다.");
+						return false;
+						
+					}else{
+						
+						var data = returnData;
+						var listCnt = returnData.resultListCnt;
+						var photoInfo = returnData.resultMsgPhotoInfo;
+						//수신자 처리 변수
+						var callToList = [];	//수신자 처리 리스트
+						var tableData = [];		//수신자 tabulator 처리 변수
+						
+						//var subject = data.resultList[0].subject;	//제목
+						//var smsTxt = data.resultList[0].smsTxt;		//문자내용
+						//var fileCnt = data.resultList[0].fileCnt;		//그림문자 이미지 갯수
+						//var filePath1 = data.resultList[0].fileType1;	//이미지1 파일 경로
+						//var filePath2 = data.resultList[0].fileType2;	//이미지2 파일 경로
+						//var filePath3 = data.resultList[0].fileType3;	//이미지3 파일 경로
+						var atchFileId1 = photoInfo.atchFileId1;		//이미지1 파일 번호
+						var atchFileId2 = photoInfo.atchFileId2;		//이미지2 파일 번호
+						var atchFileId3 = photoInfo.atchFileId3;		//이미지3 파일 번호
+						
+						/* if(smsTxt != null){
+							
+							$("#smsTxtArea").val(smsTxt);
+							fnByteString(smsTxt);
+							
+						}
+						
+						if(subject != null){
+							
+							$("#mmsSubject").val(subject);
+							
+						}
+						
+						if(fileCnt > 0){ //문자 내용 이미지 처리해주기
+							
+							for(var i=0; i < fileCnt; i++){
+								
+								var imgId = "";
+								var imgSrc = "";
+								
+								if(i == 0){
+									
+									imgSrc = filePath1.replace("/usr/local/tomcat_mjon/webapps/mjon","");
+									imgId = atchFileId1;
+									
+								}else if(i == 1){
+									
+									imgSrc = filePath2.replace("/usr/local/tomcat_mjon/webapps/mjon","");
+									imgId = atchFileId2;
+									
+								}else{
+									
+									imgSrc = filePath3.replace("/usr/local/tomcat_mjon/webapps/mjon","");
+									imgId = atchFileId3;
+									
+								}
+								
+								myMsgImageControl(imgSrc, "edit_n", "Template", imgId);
+								
+							}
+							
+						} */
+						
+						for(var i = 0; i < listCnt; i++){ // 수신자 리스트 Tabulator에 입력해 주기
+							
+							callToList[i] = data.resultList[i].callTo;
+							tableData.push({phone: removeDash(callToList[i])});
+							
+						}
+						
+						if(tableData.length > 0){
+							
+							tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기
+							
+							//totRows = tableL.getRows().length; 
+							//updateTotCnt(totRows); //전체 데이터 갯수 구하기
+							
+							//결제 금액 구하기
+						    //totalPriceSum(totRows); 
+							
+						}
+						
+						return false;
+						
+					}
+				
+				} else if(status== 'fail'){
+					alert(returnData.message);
+				}
+			},
+	        error: function (e) { alert("문자 재전송 번호 등록에 실패하였습니다."); console.log("ERROR : ", e); }
+	    });
+		
+	}
+	
+}
+
+function fnLetterListAjax(index){
+	var form = document.letterForm;
+	
+	if($('.tDep1_letType a').eq(0).hasClass('on')) {
+		form.letterType.value='S';
+	} else if ($('.tDep1_letType a').eq(1).hasClass('on')) {
+		form.letterType.value='L';
+	}
+	
+	//검색자 입력 검색 시 카테고리, 해쉬태그 전체  초기화
+	if(form.searchKeyword.value != '') {
+		form.categoryCode.value = "";
+		form.hashTag.value = "";
+		
+		$('.tDep1_cateCode').find('.on').removeClass('on');
+		$('.tDep1_cateCode').find('.cateAll').addClass('on');
+		$('.tDep1_hashTag').find('.on').removeClass('on');
+		$('.tDep1_hashTag').find('.hashAll').addClass('on');
+	}else{
+		//해시태그가 선택되어 있을 경우 해당 태그 검색어를 전달해줌
+		var strTagTxt = $('.tDep1_hashTag').find('.on').text().replace("#","");
+		if(strTagTxt == "전체"){
+			form.hashTag.value = "";
+		}else{
+			form.hashTag.value = strTagTxt;
+		}
+	}
+	
+	form.pageIndex.value = index;
+	var sendData = $(document.letterForm).serializeArray();
+	//하위 카테고리
+	$("#tDep1_depThrCateCode").load("/web/mjon/msgcampain/selectCateConfThrDptListAjax.do", sendData ,function(response, status, xhr){
+		if(document.letterForm.searchKeyword.value == ''){
+			$('.bottom_content .area_total_count').hide();
+		}
+		if(form.hashTag.value != ''){
+			if($('#letterLoad .nodata_box').length > 0){
+				$('#letterLoad .nodata_box').hide().next('.nodata_box.hashTag').show();
+			}
+		}
+		
+	});
+	$("#letterLoad").load("/web/mjon/msgcampain/selectLetterDataListAjax.do", sendData ,function(response, status, xhr){
+		if(document.letterForm.searchKeyword.value == ''){
+			$('.bottom_content .area_total_count').hide();
+		}
+	});
+	
+}
+
+function fnPhotoListAjax(index){
+	var form = document.letterForm;
+	//검색자 입력 검색 시 카테고리, 해쉬태그 전체  초기화
+	if(form.searchKeyword.value != '') {
+		form.categoryCode.value = "";
+		form.hashTag.value = "";
+		
+		$('.tDep2_cateCode').find('.on').removeClass('on');
+		$('.tDep2_cateCode').find('.cateAll').addClass('on');
+		$('.tDep2_hashTag').find('.on').removeClass('on');
+		$('.tDep2_hashTag').find('.hashAll').addClass('on');
+	}else{
+		//해시태그가 선택되어 있을 경우 해당 태그 검색어를 전달해줌
+		var strTagTxt = $('.tDep2_hashTag').find('.on').text().replace("#","");
+		if(strTagTxt == "전체"){
+			form.hashTag.value = "";
+		}else{
+			form.hashTag.value = strTagTxt;
+		}
+	}
+	
+	form.letterType.value = 'P';
+	form.pageIndex.value = index;
+	var sendData = $(document.letterForm).serializeArray();
+	//하위 카테고리
+	$("#tDep2_depThrCateCode").load("/web/mjon/msgcampain/selectCateConfThrDptListAjax.do", sendData ,function(response, status, xhr){
+		if(document.letterForm.searchKeyword.value == ''){
+			$('.bottom_content .area_total_count').hide();
+		}
+		if(form.hashTag.value != ''){
+			if($('#letterLoad .nodata_box').length > 0){
+				$('#letterLoad .nodata_box').hide().next('.nodata_box.hashTag').show();
+			}
+		}
+		
+	});	
+	$("#photoLoad").load("/web/mjon/msgcampain/selectPhotoDataListAjax.do", sendData ,function(response, status, xhr){
+		photoLayerView();
+		if(document.letterForm.searchKeyword.value == ''){
+			$('.bottom_content .area_total_count').hide();
+		}
+		if(form.hashTag.value != ''){
+			if($('#photoLoad .nodata_box').length > 0){
+				$('#photoLoad .nodata_box').hide().next('.nodata_box.hashTag').show();
+			}
+		}
+	});
+	
+}
+
+function fnMyMsgListAjax(index){
+
+	if(loginVO == "" || loginVO == null){
+		//alert("로그인 후 사용이 가능합니다.");
+		location.href="/web/user/login/login.do";
+		return false;
+	}else{
+		document.myMsgForm.pageIndex.value = index;
+		var sendData = $(document.myMsgForm).serializeArray();
+		$("#myMsgLoad").load("/web/mjon/msgcampain/selectMyMsgDataListAjax.do", sendData ,function(response, status, xhr){
+			/* $(".msg_cont").mCustomScrollbar({
+				axis: 'y',
+				scrollbarPosition: "inside",
+				theme: "dark",
+				autoHideScrollbar: false
+			}); */
+			
+		});
+	}
+}
+
+function fnMyMsgSearchListAjax(index){
+	
+	document.myMsgForm.pageIndex.value = index;
+	var sendData = $(document.myMsgForm).serializeArray();
+	$("#myMsgLoad").load("/web/mjon/msgcampain/selectMyMsgDataListAjax.do", sendData ,function(response, status, xhr){
+		
+		/* $(".msg_cont").mCustomScrollbar({
+			axis: 'y',
+			scrollbarPosition: "inside",
+			theme: "dark",
+			autoHideScrollbar: false
+		}); */
+		
+	});
+	
+}
+
+function fnMsgDataView(){
+	
+	/* var sendData = $(document.searchForm).serializeArray() ;
+	
+	//엑셀 문자 탭 활성화 시키기
+	TabType1($('.tabType1 li').eq(1), '2');
+	
+	$(".contentExcelArea").load("/web/mjon/msgcampain/selectMsgExcelDataViewAjax.do", sendData ,function(response, status, xhr){
+	}); */
+	
+	//location.href="/web/mjon/msgcampain/excel/selectMsgExcelDataView.do";
+	location.href="/web/mjon/msgcampain/selectMsgDataView.do";
+	
+}
+
+function fn_saveMyMsg(){ // 내 문자 보관함 저장
+	
+	var form = document.msgForm;
+	var myImgFileId = [];			//신규 이미지 추가 파일 Id 저장 변수
+	var adverYn = $("input[name='send_adYn']").val(); //광고 체크여부
+	
+	/*
+		이미지 에디터를 사용하여 추가한 경우 이미지 업로드 처리 - 단 에디터에서 템플릿을 선택한 경우는 업로드안함
+		신규 이미지 추가를 한 경우만 이미지 파일 업로드 처리함
+	*/
+	$('.thumb_wrap').find('.thumb_img').each(function(idx, el) {
+		
+		if($("#delLi"+idx).hasClass("Template")){ //이미지 에디터 템플릿 이미지 선택 여부 확인
+			templateYn.push("Y"); 
+		} else {
+			templateYn.push("N"); 
+		}
+		
+		if($(el).hasClass("edit_y")) { //에디터를 사용했고
+			//이미지 변환
+			const imgBase64 = $(el).attr("src");
+			const decodImg = atob(imgBase64.split(',')[1]);  // base64~ 부분을 제외하고 데이터 디코딩
+			
+	
+			let array = [];
+			for (let i = 0; i < decodImg.length; i++) {
+			  array.push(decodImg.charCodeAt(i));
+			}
+
+			const file = new Blob([new Uint8Array(array)], {type: 'image/jpeg'});
+			const fileName = 'canvas_img_' + new Date().getMilliseconds() + '.jpg';
+			let formData = new FormData();
+			formData.append('file', file, fileName);
+			
+			$.ajax({
+				type: 'post',
+				url: '/web/mjon/msgcampain/insertEditImageAjax.do',
+				cache: false,
+				data: formData,
+				dataType:'json',
+				processData: false,
+				contentType: false,
+				async: false,
+				success: function (returnData, status) {
+					if(status == 'success'){
+						// imgFilePath 에 배열로 담아주기(이미지 순서대로)
+						//console.log(imgFilePath);
+						//imgFilePath.push(returnData.filefullPath);
+						myImgFileId.push(returnData.atchFileId);
+						
+					} else if(status== 'fail'){
+						alert(returnData.message);
+					}
+				},
+				error: function (e) { alert("이미지 업로드에 실패하였습니다."); console.log("ERROR : ", e); }
+			});
+			
+		} else {
+			//에디터 안거친 템플릿 이미지면 바로 src 때림
+			imgFilePath.push($(el).attr("src"));
+		}	
+	});
+	
+	if(myImgFileId.length > 0 && imgFileId.length > 0){ //기존 샘플 이미지와 이미지 에디터 둘다 사용한 경우
+		
+		var tempImgId = [];
+		
+		tempImgId.push(myImgFileId);
+		tempImgId.push(imgFileId);
+		form.imgFileId.value = tempImgId; 
+		
+	}else if(myImgFileId.length > 0){	//이미지 에디터에서 신규 등록한 이미지 
+		
+		form.imgFileId.value = myImgFileId; 
+		
+	}else{	//샘플 이미지 선택만 했을경우(이미지 에디터 사용 안했을때)
+		
+		form.imgFileId.value = imgFileId; 
+	}
+	
+	//광고 문자 내용 합쳐주기
+	if(adverYn == 'Y'){
+		
+		var adTxt = $('.ad_txt').text();
+		var denyTxt = $('.deny_txt').text();
+		var smsTxt = form.smsTxtArea.value;
+		
+		//var adverTxt = adTxt + '\n\n' + smsTxt + '\n\n' + denyTxt;
+		var adverTxt = smsTxt;
+		form.smsTxt.value = adverTxt;
+		
+	}else{
+		
+		var smsTxt = form.smsTxtArea.value;
+		form.smsTxt.value = smsTxt;
+		
+	}
+	
+	//문자 종류 설정(S:단문 , L:장문 , P:그림)
+	var photoSts = $('.delLi').length;
+	var conLeng = conByteLeng(form.smsTxt.value); // 내용 문자 입력 바이트 수 계산하기
+	
+	if(photoSts > 0){
+		
+		form.msgType.value = 'P';
+		
+	}else if(conLeng > 90){
+	
+		form.msgType.value = 'L';
+		
+	}else{
+		
+		form.msgType.value = 'S';
+		
+	}
+	
+	if(photoSts == '0' && conLeng == '0'){
+		
+		alert("문자내용을 입력해 주세요.");
+		return false;
+		
+	}
+	
+	var data = new FormData(form);
+	url = "/web/mjon/msgcampain/insertMyMsgDataAjax.do";
+	
+	$.ajax({
+        type: "POST",
+        url: url,
+        data: data,
+        dataType:'json',
+        async: false,
+        processData: false,
+        contentType: false,
+        cache: false,
+        success: function (returnData, status) {
+			if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+				if("fail"==returnData.result){
+					
+					alert(returnData.message);
+					return false;
+					
+				}else{
+					
+					alert("내 문자함에 저장되었습니다.");
+					
+					//내 문자함 탭 활성화 시키기
+					TabType2($('.tabType2 li').eq(3), '4');
+					var offset = $('.tabType2').offset();
+				    $('html, body').animate({scrollTop : offset.top-140}, 400);
+					
+					//최 하단 내문자함 탭 리스트 내용 불러오기
+					var sendData = $(document.myMsgForm).serializeArray();
+					$("#myMsgLoad").load("/web/mjon/msgcampain/selectMyMsgDataListAjax.do", sendData ,function(response, status, xhr){
+					});
+					
+				}
+			
+			} else if(status== 'fail'){
+				alert(returnData.message);
+			}
+		},
+        error: function (e) { alert("문자 저장에 실패하였습니다."); console.log("ERROR : ", e); }
+    });
+	
+}
+
+//내 문자함으로 탭이동
+function fnGoMyMsg(){
+	
+	//내 문자함 탭 활성화 시키기
+	TabType2($('.tabType2 li').eq(3), '4');
+	
+	var offset = $('.tabType2').offset();
+    $('html, body').animate({scrollTop : offset.top-140}, 400);
+	
+}
+
+//MJ_MSG_GROUP_DATA 누락데이터 체크
+function getMsgGroupDataErrorCheck() {
+	var isError = false;
+	
+	$.ajax({
+	    type: "POST",
+	    url: "/web/mjon/msgdata/selectMsgGroupNotExistInfoAjax.do",
+	    data: {},
+	    dataType:'json',
+	    async: false,
+	    success: function (data) {
+			if (data.isSuccess) { 
+				if (data.isError == true) {
+					isError = true;
+				}
+			} 
+		},
+	    error: function (e) {
+	    	
+	    }
+	});	
+
+	return isError;
+}
+
+function checkConf() {
+	var confCheck = false;
+	
+	$.ajax({
+		type: "POST",
+		url: "/web/mjon/conf/selectMjonMsgUseConfAjax.do",
+		data: {},
+		dataType:'json',
+		async: false,
+		success: function (returnData, status) {
+			if(returnData.result == "fail") {
+				console.log(returnData.message);
+			}else if(returnData.result == "success"){
+				confCheck = true;
+			}
+		}
+		,error: function (e) {console.log("ERROR : ", e); }
+	});	
+	
+	return confCheck;
+}
+
+//문자발송 처리 함수
+function fn_sendMsgData(){
+	
+	if(!checkConf()){	//문자온 conf-check
+		alert("현재 문자 발송하기 기능 점검 중입니다.\n\n1분 후 다시 시도해주세요.");
+		return false;
+	}
+	
+	var form = document.msgForm;
+
+	//회원 보유 잔액 비교
+	var totPriceOnly = stringReplaceAll(form.totPrice.value, ",", "");
+	var userMoneyOnly = stringReplaceAll(form.myPrice.value, ",", "");
+	if(parseFloat(userMoneyOnly) < parseFloat(totPriceOnly)){
+		alert("문자 발송에 필요한 회원님의 보유 잔액이 부족 합니다.");
+		return false;
+	}	
+	
+	var loginVO = '${LoginVO}';
+	var adverYn = $("input[name='send_adYn']").val();
+	var spamStatus = false;
+	var exceptSpamYn = $("#exceptSpamYn").val(); //금지어 필터링 예외 여부 - N 일 경우만 스팸 검사를 진행
+	
+	alert(adverYn);
+	
+/* 	//이벤트 진행중 회원의 경우 이벤트 잔여금액 비교 처리 필요.
+	var eventStatus = form.eventStatus.value;
+	var eventRemainCash = parseFloat(form.eventRemainCash.value);
+	
+	if(eventStatus == 'Y'){
+		
+		if(parseFloat(eventRemainCash) < parseFloat(totPriceOnly)){
+			
+			alert("고객님의 이벤트 캐시 잔액은 " + eventRemainCash + "원으로 입력하신 수량의 문자를 전부 발송할 수 없습니다. 잔액 이하로 발송건수를 재설정하시기 바랍니다.");
+			return false;
+		}
+		
+	} */
+	
+	if(loginVO == "" || loginVO == null){
+		
+		alert("문자발송 서비스는 로그인 후 이용 가능합니다.");
+		return false;
+		
+	}
+	
+	//MJ_MSG_GROUP_DATA 누락데이터 체크
+	//if (getMsgGroupDataErrorCheck() == false) {
+	//	alert("고객님께서 발송한 최근문자가 발송결과에 표시되지않아, 문자발송이 임시로 차단되었습니다.\n문자온 고객센터에 문의해주세요.");
+	//	return false;	 	
+	//}
+	
+	if(form.callFromList.value == ""){
+		
+		alert("발신번호를 입력해 주세요.");
+		return false;
+		
+	}
+	
+	var titleStatus = form.title_status.value;
+	if(titleStatus == 'N'){//장문 제목 사용안함으로 선택시 제목에 있는 데이터 지워주기
+		
+		form.mmsSubject.value = "";
+		
+	}else{//장문 제목에 치환문자 포함된 경우 입력 못하도록 처리.
+		
+		var mmsSubject = form.mmsSubject.value;
+		if(getSpacialStringChk(mmsSubject)){
+			alert("문자 제목에는 치환문자(엑셀 내 *이름*, *1*, *2*, *3*, *4* 등)를 사용하실 수 없습니다.");
+			return false;
+		}
+		
+	}
+	
+	//문자내용 첫글자에 특수기호 포함 여부 체크
+	var strCont = form.smsTxtArea.value;
+	var rtnStr = strChinJpnCheck(strCont);
+	
+	//문자제목에 이모지가 있는지 체크
+	var titleStatusYn = $("input[name='title_status']:checked").val();
+	if(titleStatusYn == 'Y') {
+		if(!emojiCheck(form.mmsSubject.value)) return false;
+	}
+	
+	//문자내용에 이모지가 있는지 체크
+	if(!emojiCheck(strCont)) return false;
+	
+	if(rtnStr.length > 0){
+		
+		alert("입력하신 문구 중 \" " + rtnStr + " \" 는 일부 휴대폰에서 표기되지 않을 수 있습니다.");
+		
+	}
+	
+	//문자내용 첫글자에 특수기호 포함 여부 체크
+	/* var strCont = form.smsTxtArea.value;
+	var repStr = strFirstCharCheck(strCont);
+	
+	if(repStr.length > 0){
+		
+		alert("문자 내용 첫 글자는 특수기호가 들어갈 수 없습니다.");
+		$('#smsTxtArea').val(strCont.replace(repStr, ""));
+		fnByteString(strCont.replace(repStr, ""));
+		return false;
+		
+	} */
+	
+	if(imgFilePath.length == 0){ // 그림문자일 경우 내용이 없어도 됨 , 장문 문자일 경우만 문자내용 체크함
+		
+		if(form.smsTxtArea.value == ""){
+			
+			alert("문자 내용을 입력해 주세요.");
+			return false;
+			
+		}
+		
+	}
+	
+	//선거 문자 내용 합쳐주기
+	if(adverYn == 'Y'){
+		
+		var adTxt = $('.ad_txt').text();
+		var denyTxt = $('.deny_txt').html();
+		var smsTxt = form.smsTxtArea.value;
+		
+		//선거운동정보 하단 테스트내용 줄바꿈 처리해주기
+		denyTxt = denyTxt.replaceAll("<br>","\n");
+		denyTxt = denyTxt.replaceAll("<br/>","\n");
+		
+		var adverTxt = adTxt + "\n" + smsTxt + "\n" + denyTxt;
+		form.smsTxt.value = adverTxt;
+		
+	}else{
+		
+		var smsTxt = form.smsTxtArea.value;
+		form.smsTxt.value = smsTxt;
+		
+	}
+	
+	//수신번호 리스트 체크하기
+	var numCnt = 0;
+	var nameList = [];		//치환문자 이름
+	var phoneNum = [];	//받는사람
+	var rep1List = [];		//치환문자1
+	var rep2List = [];		//치환문자2
+	var rep3List = [];		//치환문자3
+	var rep4List = [];		//치환문자4
+	
+	var chkSts = $('input:checkbox[name="chkCallTo"]').is(':checked');
+	
+	if(!chkSts){
+		
+		alert("받는사람 연락처를 한 건 이상 선택해주세요.");
+		return false;
+		
+	}
+	
+	//받는사람 목록에서 체크된 연락처만 전달하도록 함.
+	$("input:checkbox[name='chkCallTo']:checked").each(function(){
+		
+		var callToNum = $(this).closest("div").next().text();
+		
+		if(!checkHpNum(callToNum)){
+			alert("선택한 연락처 목록에 잘 못된 연락처가 있습니다. 연락처 번호 : " + callToNum + " 입니다.");
+			return false;
+		}else{
+			phoneNum.push(callToNum);
+		}
+		
+	});
+	
+	var reserYn = $("input[name=reserYn]:checked").val(); // 예약 발송 여부 확인
+	
+	if(reserYn == 'Y'){
+		
+		var date = $(".resDate").val();//form.msgResDate.value;
+		var hour = form.msgResHour.value;
+		var min = form.msgResMin.value;
+		
+		if(date == ""){
+			
+			alert("예약전송 날짜를 선택해 주세요.");
+			return false;
+			
+		}else{
+			
+			var now = new Date();
+			var reqDate = date + " " + hour + ":" + min + ":00";
+			var gapDate = getGapDayTime(date, hour, min);
+			
+			if(gapDate < 0){ // 음수이면 이전날짜, 크면 이후 날짜.
+				alert("예약 날짜는 현재 시간 이후의 날짜 및 시간을 선택해 주세요.");
+				return false;
+			}else{
+				form.reqDate.value = reqDate;	//예약일자 파라미터 저장
+			}
+		}
+
+	}else{
+		
+		form.reqDate.value = "";
+		
+	}
+	
+	var fileLinks = document.getElementsByName("fileLinks");
+	
+	var conLeng = conByteLeng($('#smsTxt').val()); // 내용 문자 입력 바이트 수 계산하기
+	
+	if(conLeng > 2000){
+		
+		alert("문자 내용은 2000byte를 넘을 수 없습니다.");
+		return false;
+		
+	}
+	
+	if(confirm("문자를 전송하시겠습니까?")){
+		
+
+		imgFilePath = [];
+		$('.thumb_wrap').find('.thumb_img').each(function(idx, el) {
+			if($("#delLi"+idx).hasClass("Template")){
+				templateYn.push("Y");
+			} else {
+				templateYn.push("N");
+			}
+			
+			if($(el).hasClass("edit_y")) {
+				//이미지 변환
+				const imgBase64 = $(el).attr("src");
+				const decodImg = atob(imgBase64.split(',')[1]);  // base64~ 부분을 제외하고 데이터 디코딩
+				
+		
+				let array = [];
+				for (let i = 0; i < decodImg.length; i++) {
+				  array.push(decodImg.charCodeAt(i));
+				}
+
+				const file = new Blob([new Uint8Array(array)], {type: 'image/jpeg'});
+				const fileName = 'canvas_img_' + new Date().getMilliseconds() + '.jpg';
+				let formData = new FormData();
+				formData.append('file', file, fileName);
+				
+				$.ajax({
+					type: 'post',
+					url: '/web/mjon/msgcampain/insertEditImageAjax.do',
+					cache: false,
+					data: formData,
+					dataType:'json',
+					processData: false,
+					contentType: false,
+					async: false,
+					success: function (returnData, status) {
+						if(status == 'success'){
+							// imgFilePath 에 배열로 담아주기(이미지 순서대로)
+							//console.log(imgFilePath);
+							imgFilePath.push(returnData.filefullPath);
+							imgFileId.push(returnData.atchFileId);
+							
+						} else if(status== 'fail'){
+							alert(returnData.message);
+						}
+					},
+					error: function (e) { alert("이미지 업로드에 실패하였습니다."); console.log("ERROR : ", e); }
+				});
+				
+			} else {
+
+				if(imgFilePath.length != imgFileId.length){
+					//에디터 안거친 템플릿 이미지면 바로 src 때림
+					imgFilePath.push($(el).attr("src"));
+				}
+				
+			}	
+		});
+		
+		form.imgFilePath.value = imgFilePath; // 저장한 이미지 경로 담아주기
+		form.callToList.value = phoneNum; //수신자번호 리스트 저장해주기
+		form.callFrom.value = removeDash(form.callFromList.value); // 발신번호 대쉬(-) 문자 없애주기
+		form.reserveYn.value = reserYn; // 즉시 / 예약 문자 선택 여부 
+		form.templateYn.value = templateYn;
+		form.imgFileId.value = imgFileId;
+		form.nameList.value = nameList;
+		form.rep1List.value = rep1List;
+		form.rep2List.value = rep2List;
+		form.rep3List.value = rep3List;
+		form.rep4List.value = rep4List;
+		
+		//총 결제금액 천단위 콤마 삭제 후 전송
+		var totPrice = form.totPrice.value;
+		totPrice = totPrice.replace(",","");
+		form.totPrice.value = totPrice;
+		
+		//문자내용이 입력된 경우 스팸 필터링 실행
+		if(!form.smsTxtArea.value == "" && exceptSpamYn == "N"){
+			
+			console.log(smsTxtArea);
+			var spmData = new FormData(form);
+			url = "/web/mjon/msgdata/selectSpamTxtChkAjax.do";
+			
+			$.ajax({
+		        type: "POST",
+		        url: url,
+		        data: spmData,
+		        dataType:'json',
+		        async: false,
+		        processData: false,
+		        contentType: false,
+		        cache: false,
+		        success: function (returnData, status) {
+					if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+						
+						if("fail" == returnData.result){
+							
+							alert(returnData.message);
+							return false;
+							
+						}else if("loginFail" == returnData.result){
+							
+							alert(returnData.message);
+							return false;
+								
+						}else if("spams" == returnData.result){
+							
+// 							var spmFilterTxt = returnData.spmFilterTxt;
+							spamStatus = true;
+							
+// 							form.spamKeyword.value = spmFilterTxt;
+							form.spamStatus.value='Y';
+						}else{
+							form.spamKeyword.value = '';
+							form.spamStatus.value='N';
+							
+						}
+						
+					} else if(status== 'fail'){
+						alert(returnData.message);
+						return false;
+					}
+				},
+		        error: function (e) { alert("문자 발송에 실패하였습니다."); console.log("ERROR : ", e); return false;}
+		    });
+			
+		}
+		
+		
+		//이벤트 진행중 회원의 경우 이벤트 잔여금액 비교 처리 필요.
+		//이벤트 캐시가 부족한 경우 이벤트 캐시로 발송 가능한 만큼만 이벤트 금액으로 발송 처리해줌.
+		//이 후 나머지 발송 건수는 이벤트 캐시가 아닌 일반 단가로 발송 처리를 진행 함.
+		var eventStatus = form.eventStatus.value;
+		
+		if(eventStatus == 'Y'){ //이벤트 진행 대상자이면 문자종류에 이벤트로 구분
+			
+			form.eventYn.value = "Y"; //이벤트문자 종류 설정
+			
+		}
+		
+		var eventRemainCash = parseFloat(form.eventRemainCash.value);
+		
+		if(eventStatus == 'Y'){
+			
+			if(parseFloat(eventRemainCash) < parseFloat(totPriceOnly)){
+				
+				if(confirm("고객님의 이벤트 캐시 잔액(" + eventRemainCash + "원) 부족으로 요청하신 문자("+numberWithCommas(phoneNum.length)+"건)를 모두 발송할 수 없습니다. 이벤트 캐시 초과 건에 대해서는 일반 단가를 적용하여 발송하시겠습니까?")){
+					
+					var smsTxtArea = $('#smsTxtArea').val();
+					var evnMsgType = $("#msgType").val();
+					var evnEachPrice = $("#eachPrice").val();	//form 에 저장된 이벤트 개별 단가 불러오기
+					var evnSendCnt = Math.floor(eventRemainCash / evnEachPrice);
+					var norEachPrice = 0;
+					var imgCnt = $("#imgCnt").val();	//그림 이미지 갯수
+					var txtReplYn = $("#txtReplYn").val();	//치환문자 포함 여부 
+					var evnPhoneNumCnt = Number($("#evnPhoneNumCnt").val());	//치환문자 체크하면서 단/장문 건수 카운팅하면서 이벤트 금액으로 발송가능한 수신자 갯수 정보
+					var myPrice = parseFloat($("#myPrice").val());	//회원보유 잔여 캐시 금액
+					
+					//수신목록 저장 배열 변수 
+					var evnPhoneNum = [];	//이벤트 단가 받는사람
+					var norPhoneNum = [];	//일반 단가 받는 사람
+					
+					//치환문자 포함 문자 저장 배열 변수(이벤트 문자 저장)
+					var evnName = [];
+					var evnRep1 = [];
+					var evnRep2 = [];
+					var evnRep3 = [];
+					var evnRep4 = [];
+					
+					//치환문자 포함 문자 저장 배열 변수(일반 문자 저장)
+					var norName = [];
+					var norRep1 = [];
+					var norRep2 = [];
+					var norRep3 = [];
+					var norRep4 = [];
+					
+					
+					/**
+					Desc:	1. 그림, 치환, 일반 문자에 대해서 각각 이벤트 단가로 전송할 리스트 와 일반단가로 전송할 리스트를 분리 하는 로직
+							2. 그림 및 일반 문자는 단순 이벤트 금액으로 보낼수 있는 건수를 계산하여 리스트[0] 부터 발송 건수만큼 추출하여 evnPhoneNum 배열에 입력 후 이벤트 금액으로 발송 진행
+							3. 이벤트 발송이 완료되면, 이벤트 건수를 제외한 나머지 건수를 norPhoneNum 배열에 입력 후 일반 금액으로 발송 진행
+							4. 일반 발송시에 전송 단가(eachPrice), 전체금액(totPrice) 등 변수 정보 변경
+							=====
+							5. 그림문자가 아닌 치환문자인 경우 치환 처리를 진행하면서 단문, 장문을 구분하고 이때 이벤트 금액에서 단문, 장문 가격을 차감하여 보낼 수량을 카운팅 함.
+							6. 치환 체크가 완료되면 치환시 나온 카운트 갯수만큼 이벤트 배열과 일반 배열에 분리처리 후 전송함.
+					Param Array : evnPhoneNum, norPhoneNum
+					function :  getNorEachPrice - 메세지 타입(msgType)에 따른 단문, 장문, 그림문자 개별 단가 금액 확인
+								sendMsgAjax 	- 문자 발송 요청 Ajax 처리
+					*/
+
+					//그림문자인 경우
+					if(imgCnt > 0){
+						
+						//이벤트 가격으로 전송 할 받는 사람 리스트 저장처리
+						for(var i=0; i< evnSendCnt; i++){
+							evnPhoneNum[i]= phoneNum[i];
+							
+							//그림문자에 치환문자가 포함된 경우
+							if(txtReplYn == 'Y'){
+								
+								evnPhoneNum[i] = phoneNum[i];
+								evnName[i] = nameList[i];
+								evnRep1[i] = rep1List[i];
+								evnRep2[i] = rep2List[i];
+								evnRep3[i] = rep3List[i];
+								evnRep4[i] = rep4List[i];
+								
+							}
+						}
+						
+						//일반 가격으로 전송 할 받는 사람 리스트 저장처리
+						for(var j=0; j < phoneNum.length - evnSendCnt; j++){
+							norPhoneNum[j]= phoneNum[j + evnSendCnt];
+							
+							//그림문자에 치환문자가 포함된 경우
+							if(txtReplYn == 'Y'){
+								
+								norPhoneNum[j]= phoneNum[j + evnSendCnt];
+								norName[j] = nameList[j + evnSendCnt];
+								norRep1[j] = rep1List[j + evnSendCnt];
+								norRep2[j] = rep2List[j + evnSendCnt];
+								norRep3[j] = rep3List[j + evnSendCnt];
+								norRep4[j] = rep4List[j + evnSendCnt];
+								
+							}
+							
+						};
+						
+					}else if(txtReplYn == 'Y'){//치환 문자가 있는 경우 , 그림문자에 치환이 있는 경우 그림문자 가격으로 발송
+						
+						//이벤트 가격으로 전송 할 받는 사람 리스트 저장처리
+						for(var i=0; i< evnPhoneNumCnt; i++){
+							evnPhoneNum[i] = phoneNum[i];
+							evnName[i] = nameList[i];
+							evnRep1[i] = rep1List[i];
+							evnRep2[i] = rep2List[i];
+							evnRep3[i] = rep3List[i];
+							evnRep4[i] = rep4List[i];
+							
+						}
+						
+						//일반 가격으로 전송 할 받는 사람 리스트 저장처리
+						for(var j=0; j < phoneNum.length - evnPhoneNumCnt; j++){
+							norPhoneNum[j]= phoneNum[j + evnPhoneNumCnt];
+							norName[j] = nameList[j + evnPhoneNumCnt];
+							norRep1[j] = rep1List[j + evnPhoneNumCnt];
+							norRep2[j] = rep2List[j + evnPhoneNumCnt];
+							norRep3[j] = rep3List[j + evnPhoneNumCnt];
+							norRep4[j] = rep4List[j + evnPhoneNumCnt];
+							
+						};
+						
+					}else{//치환문자 없는 경우 처리
+						
+						//이벤트 가격으로 전송 할 받는 사람 리스트 저장처리
+						for(var i=0; i< evnSendCnt; i++){
+							evnPhoneNum[i]= phoneNum[i];
+						}
+						
+						//일반 가격으로 전송 할 받는 사람 리스트 저장처리
+						for(var j=0; j < phoneNum.length - evnSendCnt; j++){
+							norPhoneNum[j]= phoneNum[j + evnSendCnt];
+						};
+					}
+						
+					var orgShortMsgCnt = $("#shortMsgCnt").val();	//단문 총 건수 백업
+					var orgLongMsgCnt = $("#longMsgCnt").val();		//장문 총 건수 백업
+					//이벤트 단가 문자 전송 처리 시작
+					if(evnPhoneNum.length > 0){
+						
+						form.callToList.value = evnPhoneNum; //수신자번호 리스트 저장해주기
+						form.totPrice.value = evnEachPrice * evnSendCnt;	//이벤트 단가 총 결제금액 셋팅해주기
+						form.eventStatus.value = 'Y';
+						form.eventYn.value = 'Y';
+						
+						var evnTotPrice = parseFloat(form.totPrice.value); 
+						
+						if(myPrice < evnTotPrice){
+						
+							alert("문자 발송에 필요한 회원님의 보유 잔액이 부족 합니다.");
+							return false;
+							
+						}else{
+							
+							myPrice = myPrice - evnTotPrice;
+							
+						}
+						
+						//치환문자가 있는 경우 변수 정보 담아주기(그림문자 아닌경우)
+						if(txtReplYn == 'Y' &&  imgCnt < 1){
+							
+							var evnShortMsgCnt = $("#evnShortMsgCnt").val();
+							var evnLongMsgCnt = $("#evnLongMsgCnt").val();
+							
+							form.shortMsgCnt.value = evnShortMsgCnt;
+							form.longMsgCnt.value = evnLongMsgCnt;
+							form.nameList.value = evnName;
+							form.rep1List.value = evnRep1;
+							form.rep2List.value = evnRep2;
+							form.rep3List.value = evnRep3;
+							form.rep4List.value = evnRep4;
+							
+						}else if(txtReplYn == 'Y' &&  imgCnt > 0){//치환문자가 있는 경우 변수 정보 담아주기(그림문자인 경우)
+							
+							form.nameList.value = evnName;
+							form.rep1List.value = evnRep1;
+							form.rep2List.value = evnRep2;
+							form.rep3List.value = evnRep3;
+							form.rep4List.value = evnRep4;
+							
+						}
+						
+						//이벤트 발송 실행 해주기
+						var form = document.msgForm;
+						
+						var data = new FormData(form);
+						url = "/web/mjon/msgcampain/sendMsgDataAjax.do";
+						
+						$.ajax({
+					        type: "POST",
+					        url: url,
+					        data: data,
+					        dataType:'json',
+					        async: true,
+					        processData: false,
+					        contentType: false,
+					        cache: false,
+					        success: function (returnData, status) {
+								if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+									if("fail" == returnData.result){
+										
+										alert(returnData.message);
+										return false;
+										
+									}else if("loginFail" == returnData.result){
+										
+										alert(returnData.message);
+										return false;
+											
+									}else if("smsLengFail" == returnData.result){
+										
+										alert(returnData.message);
+										return false;
+											
+									}else if("imgSourceFail" == returnData.result){
+										
+										$('.pop_msg_fails').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
+										$('.pop_msg_fails .msg_text').html(returnData.message);
+										$('.mask').addClass('on');
+										
+									}else if("spamKeyWordFail" == returnData.result){//스팸 및 스미싱 단어가 들어간 문자 발송시 회원 이용정지 처리
+										
+										$('.pop_msg_spam').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
+										$('.pop_msg_spam .msg_text').html(returnData.message);
+										$('.mask').addClass('on');
+										
+									}else if("statusFail" == returnData.result){
+										
+										alert(returnData.message);
+										//문자발송 URL Move
+										goMsgUrlMove();
+										return false;
+										
+									}else{
+										
+										var smsCnt = returnData.resultSts;
+										var blockCnt = returnData.resultBlockSts;
+										
+										//이벤트 발송 처리가 완료 되면 나머지 일반 캐시로 발송할 문자 처리를 진행해 준다.
+										var norPhoneNumCnt = norPhoneNum.length; 
+										if(norPhoneNumCnt > 0){
+											
+											var norEachPrice = getNorEachPrice(evnMsgType); //일반 개별 단가 금액 셋팅해주기
+											
+											form.callToList.value = norPhoneNum;	//수신자번호 리스트 저장해주기
+											form.eachPrice.value =  norEachPrice;	//일반 개별 단가 금액 셋팅해주기
+											form.totPrice.value = norEachPrice * norPhoneNumCnt;	//일반 단가 총 결제 금액 셋팅해주기
+											form.sPrice.value = $("#norsPrice").val();
+											form.mPrice.value = $("#normPrice").val();
+											form.pPrice.value = $("#norpPrice").val();
+											form.p2Price.value = $("#norp2Price").val();
+											form.p3Price.value = $("#norp3Price").val();
+											form.eventStatus.value = 'N';
+											form.eventYn.value = 'N';
+											
+											var norTotPrice = parseFloat(form.totPrice.value); 
+											
+											if(myPrice < norTotPrice){
+											
+												var failMsg = "이벤트 캐시 잔액으로 발송한 문자("+smsCnt+"건)의 발송이 완료되었으나 일반 문자 발송("+norPhoneNumCnt+"건)에 필요한 회원님의 보유 잔액이 부족 합니다.";
+												
+												$('.loading_layer').removeClass('active');
+
+												$('.pop_msg_fails').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
+												$('.pop_msg_fails .msg_text').html(failMsg);
+												$('.mask').addClass('on');
+												
+												return false;
+												
+											}
+											
+											//치환문자가 있는 경우 변수 정보 담아주기(그림문자가 아닌경우)
+											if(txtReplYn == 'Y' &&  imgCnt < 1){
+												
+												//치환문자 단/장문 혼용된 경우 각 타입별 건수를 재 계산해준다.
+												//총 단/장문 각각 건수에서 이벤트로 발송한 건수를 빼준다.
+												var evnShortMsgCnt = $("#evnShortMsgCnt").val();
+												var evnLongMsgCnt = $("#evnLongMsgCnt").val();
+												
+												var shortMsgCnt = Number(orgShortMsgCnt) - Number(evnShortMsgCnt);
+												var longMsgCnt = Number(orgLongMsgCnt) - Number(evnLongMsgCnt);
+												
+												
+												//계산 값이 음수로 나오는 경우 0건으로 간주한다.
+												if(shortMsgCnt <= 0){
+													
+													shortMsgCnt = 0;
+													
+												}
+												
+												if(longMsgCnt <= 0){
+													
+													longMsgCnt = 0;
+													
+												}
+												
+												form.shortMsgCnt.value = shortMsgCnt;
+												form.longMsgCnt.value = longMsgCnt;
+												
+												form.nameList.value = norName;
+												form.rep1List.value = norRep1;
+												form.rep2List.value = norRep2;
+												form.rep3List.value = norRep3;
+												form.rep4List.value = norRep4;
+												
+											}else if(txtReplYn == 'Y' &&  imgCnt > 0){//치환문자가 있는 경우 변수 정보 담아주기(그림문자인 경우)
+												
+												form.nameList.value = norName;
+												form.rep1List.value = norRep1;
+												form.rep2List.value = norRep2;
+												form.rep3List.value = norRep3;
+												form.rep4List.value = norRep4;
+												
+											}
+											
+											
+											sendMsgAjax(smsCnt, blockCnt);
+										}
+										
+									}
+									
+								} else if(status== 'fail'){
+									alert(returnData.message);
+								}
+							},
+							beforeSend : function(xmlHttpRequest) {
+					        	//로딩창 show
+					        	$('.loading_layer').addClass('active');				
+							},	        	        
+					        complete : function(xhr, textStatus) {
+					        	//로딩창 hide
+					        	//$('.loading_layer').removeClass('active');
+							},	      			
+					        error: function (e) { alert("문자 발송에 실패하였습니다."); console.log("ERROR : ", e); }
+					    });
+						
+					}else{
+						
+						//이벤트 건수로 발송 할 수 없는 경우 일반 캐시 단가로 발송처리하기
+						if(norPhoneNum.length > 0){
+							
+							form.callToList.value = norPhoneNum; //수신자번호 리스트 저장해주기
+							form.eachPrice.value = getNorEachPrice(evnMsgType); //일반 개별 단가 금액 셋팅해주기
+							form.sPrice.value = $("#norsPrice").val();
+							form.mPrice.value = $("#normPrice").val();
+							form.pPrice.value = $("#norpPrice").val();
+							form.p2Price.value = $("#norp2Price").val();
+							form.p3Price.value = $("#norp3Price").val();
+							form.eventStatus.value = 'N';
+							form.eventYn.value = 'N';
+							
+							sendMsgAjax(0,0);
+							
+						}else{
+							
+							alert("문자 전송 중 오류가 발생하였습니다.!!");
+							return false;
+							
+						}
+						
+					}
+					
+					return false;
+				}else{
+					
+					return false;
+					
+				}
+				
+			}else{
+				
+				//발송 Ajax 호출해주기
+				sendMsgAjax(0,0);
+				
+			}
+			
+		}else{
+			
+			//발송 Ajax 호출해주기
+			sendMsgAjax(0,0);
+			
+		}
+		
+	}
+	
+}
+
+
+//이벤트가 아닌 일반 개별 단가 셋팅해주기
+function getNorEachPrice(evnMsgType){
+	
+	var norEachPrice = 0;
+	var evnImgCnt = $("#imgCnt").val();
+	
+	//일반 단가로 변경해주기
+	if(evnMsgType == '4'){
+		
+		norEachPrice = $("#norsPrice").val();
+		console.log("norEachPrice Short::: "+norEachPrice);
+		
+	}else if(evnMsgType == '6'){
+		
+		if(evnImgCnt == 0){//장문 가격
+			
+			norEachPrice = $("#normPrice").val();
+			console.log("norEachPrice Long ::: "+norEachPrice);
+			
+		}else if(evnImgCnt == 1){
+			
+			norEachPrice = $("#norpPrice").val();
+			console.log("norEachPrice p1 ::: "+norEachPrice);
+			
+		}else if(evnImgCnt == 2){
+			
+			norEachPrice = $("#norp2Price").val();
+			console.log("norEachPrice p2 ::: "+norEachPrice);
+			
+		}else if(evnImgCnt == 3){
+			
+			norEachPrice = $("#norp3Price").val();
+			console.log("norEachPrice p3 ::: "+norEachPrice);
+			
+		}
+		
+	}
+	
+	return norEachPrice;
+}
+
+
+function sendMsgAjax(paramSmsCnt, paramBlockCnt){
+	
+	var form = document.msgForm;
+	var reserYn = $("#reserveYn").val();
+	
+	var data = new FormData(form);
+	url = "/web/mjon/msgcampain/sendMsgDataAjax.do";
+	
+	$.ajax({
+        type: "POST",
+        url: url,
+        data: data,
+        dataType:'json',
+        async: true,
+        processData: false,
+        contentType: false,
+        cache: false,
+        success: function (returnData, status) {
+			if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
+				if("fail" == returnData.result){
+					
+					alert(returnData.message);
+					return false;
+					
+				}else if("loginFail" == returnData.result){
+					
+					alert(returnData.message);
+					return false;
+						
+				}else if("smsLengFail" == returnData.result){
+					
+					alert(returnData.message);
+					return false;
+						
+				}else if("imgSourceFail" == returnData.result){
+					
+					$('.pop_msg_fails').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
+					$('.pop_msg_fails .msg_text').html(returnData.message);
+					$('.mask').addClass('on');
+					
+				}else if("spamKeyWordFail" == returnData.result){//스팸 및 스미싱 단어가 들어간 문자 발송시 회원 이용정지 처리
+					
+					$('.pop_msg_spam').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
+					$('.pop_msg_spam .msg_text').html(returnData.message);
+					$('.mask').addClass('on');
+					
+				}else if("statusFail" == returnData.result){
+					
+					alert(returnData.message);
+					//문자발송 URL Move
+					goMsgUrlMove();
+					return false;
+					
+				}else{
+					
+					var smsCnt = Number(returnData.resultSts);
+					var blockCnt = Number(returnData.resultBlockSts);
+					
+					smsCnt = Number(smsCnt) + Number(paramSmsCnt);
+					blockCnt = Number(blockCnt) + Number(paramBlockCnt);
+					
+					if((smsCnt + blockCnt) == 0){
+						
+						$('.pop_msg_spam').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
+						$('.pop_msg_spam .msg_text').html("문자 발송(예약)에 실패하였습니다.<br/> 다시 시도해주세요. <br/>* 정상적으로 발송 시도하였으나 실패하신 경우 혹시 문자내용에 사용불가 이모지 <br/>또는 복사-붙여넣기로 인한 보이지 않는 특수문자가 포함되었는지 확인 후 다시 시도해주세요.");
+						$('.mask').addClass('on');
+						
+					}else{
+						
+						$('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
+						
+						//예약발송 건의 경우 결과 팝업 문구 변경
+						if(reserYn == 'Y'){
+							$('.pop_msg_success .msg_text').html("예약 성공 : <strong>"+ smsCnt + "</strong>건,수신거부 : <span>" + blockCnt + "</span>건의<br>문자가 예약 되었습니다.");
+						}else{
+							$('.pop_msg_success .msg_text').html("발송 성공 : <strong>"+ smsCnt + "</strong>건,수신거부 : <span>" + blockCnt + "</span>건의<br>문자가 발송 되었습니다.");
+						}
+						
+						$('.mask').addClass('on');
+						
+					}
+					
+				}
+				
+			} else if(status== 'fail'){
+				alert(returnData.message);
+			}
+		},
+		beforeSend : function(xmlHttpRequest) {
+        	//로딩창 show
+        	$('.loading_layer').addClass('active');				
+		},	        	        
+        complete : function(xhr, textStatus) {
+        	//로딩창 hide
+        	$('.loading_layer').removeClass('active');
+		},	      			
+        error: function (e) { alert("문자 발송에 실패하였습니다."); console.log("ERROR : ", e); }
+    });
+	
+}
+
+
+function linkPage(pageNo){
+	fnLetterListAjax(pageNo);
+}
+
+
+function linkPhoPage(pageNo){
+	fnPhotoListAjax(pageNo);
+}
+
+function myMsgPage(pageNo){
+	fnMyMsgListAjax(pageNo);
+}
+
+function fnMyMsgCheckDelete(){
+	
+	var msgId = [];
+	if($("input:checkbox[name='myMsgDel']").is(":checked")==false){
+		alert("선택된 항목이 없습니다.");
+		return;
+	}
+	
+	$("input:checkbox[name='myMsgDel']:checked").each(function(index){
+		
+		msgId[index] = $(this).val();
+		
+	});
+	
+	if(msgId.length > 0){
+		
+		document.myMsgForm.msgIdList.value = msgId;
+		var sendData =  $(document.myMsgForm).serializeArray();
+		
+		$("#myMsgLoad").load("/web/mjon/msgcampain/deleteMyMsgDataListAjax.do", sendData ,function(response, status, xhr){
+			
+			//문자 내용 스크롤 적용
+			/* $(".msg_cont").mCustomScrollbar({
+				axis: 'y',
+				scrollbarPosition: "inside",
+				theme: "dark",
+				autoHideScrollbar: false
+			}); */
+			
+		});
+		
+	}else{
+		
+		alert("삭제할 문자를 선택해 주세요.");
+		return false;
+		
+	}
+	
+}
+
+//문자 샘플 2줄, 4줄 보기 기능 
+function fnLPageUnit(){
+	
+	var form = document.letterForm;
+	var pageUnit = form.LPageUnit.value;
+	
+	form.pageUnit.value = pageUnit;
+	fnLetterListAjax();
+	
+}
+
+//그림문자 샘플 2줄, 4줄 보기 기능 
+function fnPhPageUnit(){
+	
+	var form = document.letterForm;
+	var pageUnit = form.PhPageUnit.value;
+	
+	form.pageUnit.value = pageUnit;
+	fnPhotoListAjax();
+	
+}
+
+//그림문자 샘플 2줄, 4줄 보기 기능 
+function fnPhPageUnit(){
+	
+	var form = document.letterForm;
+	var pageUnit = form.PhPageUnit.value;
+	
+	form.pageUnit.value = pageUnit;
+	fnPhotoListAjax();
+	
+}
+
+function fnMsgPageUnit(){
+	
+	var form = document.myMsgForm;
+	var pageUnit = form.msgPageUnit.value;
+	
+	form.pageUnit.value = pageUnit;
+	fnMyMsgListAjax();
+	
+}
+
+function fnMyMsgSearchListOrd(){
+	
+	var form = document.myMsgForm;
+	var sortOrd = form.searchSortOrd.value;
+	
+	if(sortOrd == 'desc'){
+		
+		form.searchSortOrd.value = 'asc';
+		$('#sortCnd').text('등록순');
+		
+	}else{
+		
+		form.searchSortOrd.value = 'desc';
+		$('#sortCnd').text('최근순');
+		
+	}
+	
+	//내문자함 내용 검색하기
+	fnMyMsgSearchListAjax(1);
+	
+}
+
+function msgSuccessClose(obj){
+	$(obj).closest('.pop_msg_success').attr('style','');
+	//문자발송 URL Move
+	goMsgUrlMove();
+	$('html').scrollTop(0);
+}
+
+function msgFailsClose(obj){
+	$(obj).closest('.pop_msg_fails').attr('style','');
+}
+
+function msgSpamClose(obj){
+	$(obj).closest('.pop_msg_spam').attr('style','');
+	//location.href="/web/uat/uia/actionLogout.do";
+}
+
+function msgResultLink(){
+	var reserYn = $("input[name=reserYn]:checked").val(); // 예약 발송 여부 확인
+	if(reserYn == 'Y'){
+		
+		location.href="/web/mjon/reservmsg/selectReservMsgView.do";
+		
+	}else{
+		
+		location.href="/web/mjon/msgsent/selectMsgSentView.do";
+		
+	}
+	
+}
+
+//START
+//맞춤제작 요청 JSPark => 2023.02.21 추가
+//맞춤제작 등록 Popup 
+function customPopup(){
+	$("#customPopup").load("/web/mjon/custom/selectMsgCustomPopupAjax.do", "" ,function(response, status, xhr){
+		popupImgList(1);
+	});
+}
+
+function openMsgCustomPopup() {
+	if(loginVO == "" || loginVO == null){
+		alert("로그인 후 이용이 가능합니다.");
+		return false;
+	} else {
+		$("#customPopupOpen").trigger("click");
+	}
+	$("#customType04").hide();
+	popCustomScrT=$(window).scrollTop();
+	popScrTarget();
+}
+
+$(window).on('load',function(){
+	setTimeout(function(){
+		popScrTarget();
+	},500);
+});
+
+function popScrTarget(){
+	var closeTarget=$('.custom_layer .tooltip-close');
+	closeTarget.attr('onclick','popScrCloseSetting();');
+}
+
+function popScrCloseSetting(){
+	setTimeout(function(){
+		$(window).scrollTop(popCustomScrT);	
+	},1);
+}
+//END
+</script>
+	<div class="tooltip-wrap">
+		<!-- 문자발송 성공 레이어팝업 -->
+		<div class="popup-com pop_msg_success">
+			<div class="popup_heading">
+				<p>문자 전송 결과</p>
+				<button type="button" class="tooltip-close" onclick="msgSuccessClose(this);"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in">
+				<div class="msg_text">발송성공 : <strong>1</strong> 건, 수신거부 : <span>0</span>건의<br>문자가 발송 되었습니다.</div>
+			</div>
+			<div class="popup_btn">
+				<button type="button" onclick="msgResultLink(); return false;">문자 발송결과 바로가기</button>                      
+				<button type="button" class="tooltip-close" onclick="msgSuccessClose(this);">확인</button>                      
+			</div>
+		</div>
+	</div>
+	<div class="tooltip-wrap">
+		<!-- 문자발송 실패 레이어팝업 -->
+		<div class="popup-com pop_msg_fails">
+			<div class="popup_heading">
+				<p>문자 전송 결과</p>
+				<button type="button" class="tooltip-close" onclick="msgFailsClose(this);"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in">
+				<div class="msg_text">발송성공 : <strong>1</strong> 건, 수신거부 : <span>0</span>건의<br>문자가 발송 되었습니다.</div>
+			</div>
+			<div class="popup_btn">
+				<button type="button" class="tooltip-close" onclick="msgFailsClose(this);">확인</button>                      
+			</div>
+		</div>
+	</div>
+	<div class="tooltip-wrap">
+		<!-- 문자발송 스팸 이용정지 레이어팝업 -->
+		<div class="popup-com pop_msg_spam">
+			<div class="popup_heading">
+				<p>문자 전송 결과</p>
+				<button type="button" class="tooltip-close" onclick="msgSpamClose(this);"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button>
+			</div>
+			<div class="layer_in">
+				<div class="msg_text"></div>
+			</div>
+			<div class="popup_btn">
+				<button type="button" class="tooltip-close" onclick="msgSpamClose(this);">확인</button>                      
+			</div>
+		</div>
+	</div>
+    <div class="inner">
+        <!-- send top -->
+        <div class="send_top">
+            <!-- tab button -->
+            <ul class="tabType1">
+                <li class="tab active"><button type="button" onclick="TabType1(this,'1');">단문 · 장문 · 그림 문자</button></li>
+                <li class="tab">
+                	<!-- <button type="button" onclick="TabType1(this,'2');">대량 문자(엑셀·TXT)</button> -->
+                	<button type="button" onclick="javascript:fnMsgDataView(); return false;">단체문자(엑셀·TXT)</button>
+                </li>
+            </ul><!--// tab button -->
+			<!-- tab content1 -->
+			<!-- <span id="contentArea"></span> -->
+			<div class="top_content current election contentArea" id="tab1_1" style="min-height: 555px;"></div>
+			
+			<!-- tab content2 -->
+			<!-- <span id="contentExcelArea"></span> -->
+			<!-- <div class="top_content current get_excel contentExcelArea" id="tab1_2"></div> -->
+		</div><!--// send top -->
+	<!-- send bottom -->
+	<div class="send_bottom">
+		<!-- tab button -->
+		<ul class="tabType2 selectedTab">
+			<li class="tab active"><button type="button" onclick="TabType2(this,'1');">문자 샘플</button></li>
+			<li class="tab"><button type="button" onclick="TabType2(this,'2');">그림문자 샘플</button></li>
+			<li class="tab"><button type="button" onclick="TabType2(this,'3');">지도/약도 추가</button></li>
+			<li class="tab"><button type="button" onclick="TabType2(this,'4');">내 문자함</button></li>
+		</ul>
+		<!--// tab button -->
+		<!-- tab content1 -->
+		<form id="letterForm" name="letterForm" method="post">
+			<input type="hidden" id="letterType" name="letterType" value="<c:out value='${letterVO.letterType}'/>"/>
+			<input type="hidden" id="memberType" name="memberType" value="<c:out value='${letterVO.memberType}'/>"/>
+			<input type="hidden" id="categoryCode" name="categoryCode" value="<c:out value='${letterVO.categoryCode}'/>"/>
+			<input type="hidden" id="hashTag" name="hashTag" value="<c:out value='${letterVO.hashTag}'/>"/>
+			<input type="hidden" id="pageIndex" name="pageIndex" value="<c:out value='${letterVO.pageIndex}' default='1' /> "/>
+			<input type="hidden" id="pageUnit" name="pageUnit" value="<c:out value='${letterVO.pageUnit}'/>"/>
+			<input type="hidden" id="upperCateNo" name="upperCateNo" value=""/>
+			<input type="hidden" id="bestCategory" name="bestCategory" value="<c:out value='${letterVO.bestCategory}'/>"/>
+		
+			<div class="search_sample">
+				<input type="text" id="searchKeyword" name="searchKeyword" value="<c:out value='${letterVO.searchKeyword}'/>" placeholder="문자샘플 검색하기" onfocus="this.placeholder=''" onblur="this.placeholder='문자샘플 검색하기'" maxlength="10">
+				<button class="btnSearchF"><img src="/publish/images/search02.png" alt=""></button>
+			</div>
+			<!-- tab content1 -->
+			<div class="bottom_content current" id="tab2_1">
+				<div class="area_tabs">
+					<div class="top_tab">
+						<!-- <div class="tab_depth1 tDep1_mType">
+							<a href="#none" class="on" value="">전체</a>
+							<a href="#none" value="B">기업</a>
+							<a href="#none" value="P">개인</a>
+							<div class="on_active">전체</div>
+						</div> -->
+						<div class="tab_depth2 tDep1_letType">
+							<a href="#none" class="on" value="S">단문문자</a>
+							<a href="#none" value="L">장문문자</a>
+						</div>
+						<select name="LPageUnit" id="LPageUnit" class="selType2" onChange="fnLPageUnit(); return false;">
+							<option value="10">2줄보기</option>
+							<option value="20">4줄보기</option>
+							<option value="30">6줄보기</option>
+						</select>
+						<div class="customReq">
+							<%-- 맞춤제작 요청 JSPark => 2023.02.21 추가 --%>
+							<%--
+							<input type="hidden" id="customPopupOpen" data-tooltip="popup01">
+							<button type="button" onclick="openMsgCustomPopup(); return false;"><i></i>맞춤제작 요청</button>					
+							--%>	
+							<button type="button" onClick="location.href='/web/mjon/custom/selectMsgCustomView.do'"><i></i>맞춤제작 요청</button>
+						</div>
+					</div>
+					<div class="bottom_tab">
+						<div class="tab_depth3 tDep1_cateCode">
+							<a href="#none" class="on cateAll" value="">All</a>
+							<a href="#none" value="best">BEST</a>
+							<c:forEach var="cateList" items="${cateCodeList}" varStatus="status">
+								<a href="#none" value="<c:out value='${cateList.cateCode}'/>"><c:out value="${cateList.cateNm}"/></a>
+							</c:forEach>
+						</div>
+						<div class="tab_depth4 tDep1_threeCateCode" id="tDep1_depThrCateCode"> <!-- 해쉬태그 삭제 및 하위 카테고리 추가로 인해 class="tDep1_hashTag" 삭제 -->
+							<%-- <a href="#none" class="on hashAll" value="">전체</a>
+							<c:forEach var="hashList" items="${hashTagList}" varStatus="status">
+								<a href="#none" value="${hashList.hashNm}">#<c:out value="${hashList.hashNm}"/></a>
+							</c:forEach> --%>
+						</div>
+					</div>
+				</div>
+				<div id="letterLoad">
+				</div>
+			</div><!--// tab content1 -->
+			<!--// tab content2 -->
+			<div class="bottom_content" id="tab2_2">
+				<div class="area_tabs">
+					<div class="top_tab">
+						<!-- <div class="tab_depth1 tDep2_mType">
+							<a href="#none" class="on" value="">전체</a>
+							<a href="#none" value="B">기업</a>
+							<a href="#none" class="on" value="P">개인</a>
+							<div class="on_active">전체</div>
+						</div> -->
+						<div class="tab_depth2 tDep2_letType">
+							<a href="#none" class="on" value="P">그림문자</a>
+						</div>
+						<select name="PhPageUnit" id="PhPageUnit" class="selType2" onChange="fnPhPageUnit(); return false;">
+							<option value="10">2줄보기</option>
+							<option value="20">4줄보기</option>
+							<option value="30">6줄보기</option>
+						</select>
+						<div class="customReq">
+							<%-- 맞춤제작 요청 JSPark => 2023.02.21 추가 --%>
+							<%--
+							<input type="hidden" id="customPopupOpen" data-tooltip="popup01">
+							<button type="button" onclick="openMsgCustomPopup(); return false;"><i></i>맞춤제작 요청</button>					
+							--%>	
+							<button type="button" onClick="location.href='/web/mjon/custom/selectMsgCustomView.do'"><i></i>맞춤제작 요청</button>
+						</div>
+					</div>
+					<div class="bottom_tab">
+						<div class="tab_depth3 tDep2_cateCode">
+							<a href="#none" class="on cateAll" value="">All</a>
+							<a href="#none" value="best">BEST</a>
+							<c:forEach var="cateList" items="${cateCodeList}" varStatus="status">
+								<a href="#none" value="<c:out value='${cateList.cateCode}'/>"><c:out value="${cateList.cateNm}"/></a>
+							</c:forEach>
+						</div>
+						<div class="tab_depth4 tDep2_threeCateCode" id="tDep2_depThrCateCode"><!-- 해쉬태그 삭제 및 하위 카테고리 추가로 인해 class="tDep2_hashTag" 삭제 -->
+							<!-- 하위 카테고리(3뎁스)로 대체 -->
+							<%-- <a href="#none" class="on hashAll" value="">전체</a>
+							<c:forEach var="hashList" items="${hashTagList}" varStatus="status">
+								<a href="#none" value="${hashList.hashNm}">#<c:out value="${hashList.hashNm}"/></a>
+							</c:forEach> --%>
+						</div>
+					</div>
+				</div>
+				<div id="photoLoad">
+			    </div>
+				<!-- pagination -->
+			</div><!--// tab content2 -->
+		</form>
+		
+		<!--tab content3 -->
+		<div class="bottom_content" id="tab2_3">
+			<div class="map_search">
+				<label for="" class="label"></label>
+				<div class="mapWrap">
+					<script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script>
+					<script type="text/javascript" src="//dapi.kakao.com/v2/maps/sdk.js?appkey=7fc7b80a3e32ac964da92f6aa3d6000d&libraries=services"></script>
+					<input type="text" id="sample5_address" placeholder="도로명 또는 지번을 입력해주세요." onfocus="this.placeholder=''" onblur="this.placeholder='도로명 또는 지번을 입력해주세요.'">
+					<button type="button" class="btnType map_check" onclick="sample5_execDaumPostcode()">확인</button>
+					<button type="button" class="btnType map_add" onclick="insertajax();">약도링크 추가</button>
+					<p><span class="vMiddle">*</span> 지도링크는 입력메시지 끝부분에 추가됩니다.</p>
+					<div id="map" style="width:100%;height:450px; margin-top: 10px;">&nbsp;</div>
+					
+					<div class="mapInfo">
+					</div>
+				</div>
+			</div>
+			<script>
+			    var mapContainer = document.getElementById('map'), // 지도를 표시할 div
+			        mapOption = {
+			            center: new daum.maps.LatLng(37.613898152040385, 127.15319231152851), // 지도의 중심좌표
+			            level: 5 // 지도의 확대 레벨
+			        };
+			
+			    //지도를 미리 생성
+			    var map = new daum.maps.Map(mapContainer, mapOption);
+			    //주소-좌표 변환 객체를 생성
+			    var geocoder = new daum.maps.services.Geocoder();
+			    //마커를 미리 생성
+			    var marker = new daum.maps.Marker({
+			        position: new daum.maps.LatLng(37.613898152040385, 127.15319231152851),
+			        map: map
+			    });
+			    var testcoords = new daum.maps.LatLng(37.613898152040385, 127.15319231152851);
+			    setTimeout(function(){ 
+			    	map.relayout();
+			    	map.setCenter(testcoords);
+			    }, 5000);
+			    
+				//lat 위도 lng 경도
+			    var paramLat;
+			    var paramLng;
+			    
+			    function sample5_execDaumPostcode() {
+			        new daum.Postcode({
+			            oncomplete: function(data) {
+			                var addr = data.address; // 최종 주소 변수
+			
+			                // 주소 정보를 해당 필드에 넣는다.
+			                document.getElementById("sample5_address").value = addr;
+			                // 주소로 상세 정보를 검색
+			                geocoder.addressSearch(data.address, function(results, status) {
+			                    // 정상적으로 검색이 완료됐으면
+			                    if (status === daum.maps.services.Status.OK) {
+			
+			                        var result = results[0]; //첫번째 결과의 값을 활용
+			
+			                        // 해당 주소에 대한 좌표를 받아서
+			                        var coords = new daum.maps.LatLng(result.y, result.x);
+			                        // 지도를 보여준다.
+			                        mapContainer.style.display = "block";
+			                        map.relayout();
+			                        // 지도 중심을 변경한다.
+			                        map.setCenter(coords);
+			                        // 마커를 결과값으로 받은 위치로 옮긴다.
+			                        marker.setPosition(coords)
+			                        paramLat = result.y;
+			                        paramLng = result.x;
+			                        
+			                    }
+			                });
+			            }
+			        }).open({
+			        	q: document.getElementById("sample5_address").value
+			        });
+			    }
+			    
+			    function insertajax(){
+			    	var mapInsertConfirm = confirm('약도를 추가하시겠습니까?');
+			    	
+			    	if(mapInsertConfirm){
+				    	$.ajax({
+				            cache : false,
+				            url : "<c:url value='/MapUrlInsertAjax.do'/>", 
+				            type : 'POST', 
+				            data : {
+				            	"mapLat" : paramLat,
+				            	"mapLng" : paramLng
+				            },
+				            dataType:'json',
+				            success : function(returnData, status){
+				    			if(status == "success") {
+				    				if (returnData.url != 0) {
+				    					var smsTxttmp = $('#smsTxtArea').val();
+				    					
+				    					/* document.getElementById("testarea").value = returnData.url + "/MapUrl.do?seq=" + returnData.seq; */
+				    					$('#smsTxtArea').val(smsTxttmp+returnData.url + "/MapUrl.do?seq=" + returnData.seq);
+				    					
+				    					smsTxttmp = $('#smsTxtArea').val();
+				    					
+				    					fnByteString(smsTxttmp);
+				    				}
+				    			}else{ alert("ERROR!");return;} 
+				    		},
+				    
+				            error : function(request , status, error){
+				    			alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
+				    			
+				            }
+				        });
+			    	}
+			    	else{
+			    		alert("취소되었습니다.");
+			    	}
+			    } 
+			</script>
+		</div><!--// tab content3 -->
+		<!-- tab content4 -->
+		<form id="myMsgForm" name="myMsgForm" method="post">
+			<input name="pageIndex" type="hidden" value="1"/>
+			<input name="msgIdList" type="hidden" value=""/>
+			<input name="pageUnit" type="hidden" value=""/>
+			<input name="searchSortOrd" type="hidden" value="desc"/>
+			<input name="msgKind" type="hidden" value="C"/>
+			<div class="bottom_content" id="tab2_4">
+				<div class="search_wrap clearfix">
+		            <div class="btn_left">
+		                    <span>· 기간</span>
+		                    <div class="calendar_wrap">
+								<input type="text" class="startDate inp calendar" title="검색 시작일" id="startDate" name="myMsgStDt" value="" data-datecontrol="true">
+								<span class="dateEtc">~</span>
+								<input type="text" class="endDate inp calendar" title="검색 종료일" id="endDate" name="myMsgEndDt" value="" data-datecontrol="true">
+							</div>
+		                    <div class="search">
+		                        <label for="searchWord" class="label"></label>
+		                        <input type="text" id="searchWord" name="searchKeyword" placeholder="내 문자함 검색" onfocus="this.placeholder=''" onblur="this.placeholder='내보관함 검색'" maxlength="10">
+		                    <button type="button" class="btnType btnType2" onclick="javascript:fnMyMsgSearchListAjax(1); return false;">검색</button>
+		                </div>
+		            </div>
+		            <div class="btn_right">
+		                <button type="button" id="sortOrd" name="sortOrd" onClick="javascript:fnMyMsgSearchListOrd(); return false;"><span id="sortCnd">최근순</span><i></i></button>
+		                <select name="msgType" id="msgType1" class="selType2" onChange="fnMyMsgSearchListAjax(1); return false;">
+		                    <option value="">전체보기</option>
+		                    <option value="S">단문문자</option>
+		                    <option value="L">장문문자</option>
+		                    <option value="P">그림문자</option>
+		                </select>
+		                <select name="msgPageUnit" id="msgPageUnit" class="selType2" onChange="fnMsgPageUnit(); return false;">
+		                    <option value="10">2줄보기</option>
+		                    <option value="20">4줄보기</option>
+		                    <option value="30">6줄보기</option>
+		                </select>
+		            </div>
+		        </div>
+				<div id="myMsgLoad">
+				</div>
+			</div><!--// tab content4 -->
+		</form>
+	</div><!-- inner close -->
+	
+	<!-- 맞춤제작 요청 레이어 팝업 -->
+	<div class="tooltip-wrap" id="customPopup">
+	</div>
+	<!--// 맞춤제작 요청 레이어 팝업 -->		
+</div>
+<form id="msgResendForm" name="msgResendForm" method="post">
+	<input name="msgResendFlag" type="hidden" value="N"/>
+	<input name="msgSeqList" type="hidden" value=""/>
+</form>
+<form id="moveAddrForm" name="moveAddrForm" method="post">
+	<input name="moveAddrFlag" type="hidden" value="N"/>
+	<input name="addrIdList" type="hidden" value=""/>
+</form>
src/main/webapp/js/MJUtill.js
--- src/main/webapp/js/MJUtill.js
+++ src/main/webapp/js/MJUtill.js
@@ -882,3 +882,20 @@
 	txtArea.selectionEnd = selectPos; // 커서 끝지점을 추가 삽입된 텍스트 이후로 지정
 	txtArea.focus();
 }
+
+//선거문자 20건 수신자 목록 추가된 건수 및 발송 금액 변경해주기
+function fnChkCallToChange(){
+	
+	var callToCnt = 0;
+	$("input[name=chkCallTo]").each(function(){
+		
+		var chkSts = $(this).is(':checked');
+		if(chkSts){
+			callToCnt++;
+		}
+	});
+	
+	updateTotCnt(callToCnt); //전체 데이터 갯수 구하기
+	totalPriceSum(callToCnt);
+	
+}
src/main/webapp/publish/js/publish.js
--- src/main/webapp/publish/js/publish.js
+++ src/main/webapp/publish/js/publish.js
@@ -1,37 +1,67 @@
-
-// 마우스 길게 누르는 function
-var onlongclick = function ($target, time, callback) {
-  $($target).on("mousedown", function () {
-    const timer = setTimeout(callback, time);
-    $($target).on("mouseup", function () {
-      clearTimeout(timer);
-    });
-  });
-}
-
-
-var publishCommon = {
-  count: 0,
-  longMousePressCheck: function (checkTarget, checkTime) {
-    // checkTarget → 체크박스([name='']) / checkTime → 몇초 간격으로 체크 될지
-    var checkLength = checkTarget.length; // 체크박스 몇개인지
-    var cnt = 0; // 몇개 체크됐는지
-    var checkEvent = setInterval(function () {
-      if (this.count == 0) {} 
-      else if (cnt >= checkLength) {
-        clearInterval(checkEvent); // 자동체크 끝.
-      }
-      $(checkTarget[cnt]).prop('checked', true); // 체크박스 체크.
-      cnt++;
-    }, checkTime);
-  },
-  clickCheck: function (checkTarget) {
-    // 한번 클릭 했을 때 체크, checkTarget → 체크박스([name=''])
-    if (checkTarget.length < this.count) {
-      // 체크 다하면 더이상 작동 x.
-      return false;
-    }
-    $(checkTarget[this.count]).prop('checked', true); // 체크박스 체크
-    this.count++;
-  }
-}
+
+// 마우스 길게 누르는 function
+var onlongclick = function ($target, time, callback) {
+  $($target).on("mousedown", function () {
+    const timer = setTimeout(callback, time);
+    $($target).on("mouseup", function () {
+      clearTimeout(timer);
+    });
+  });
+}
+
+
+var publishCommon = {
+  count: 0,
+  longMousePressCheck: function (checkTarget, checkTime) {
+    // checkTarget → 체크박스([name='']) / checkTime → 몇초 간격으로 체크 될지
+    var checkLength = checkTarget.length; // 체크박스 몇개인지
+    var cnt = 0; // 몇개 체크됐는지
+    var checkEvent = setInterval(function () {
+      if (this.count == 0) {} 
+      else if (cnt >= checkLength) {
+        clearInterval(checkEvent); // 자동체크 끝.
+      }
+      $(checkTarget[cnt]).prop('checked', true); // 체크박스 체크.
+      cnt++;
+      console.log("+++++ publishCommon ::: " + cnt);
+    }, checkTime);
+  },
+  clickCheck: function (checkTarget) {
+    // 한번 클릭 했을 때 체크, checkTarget → 체크박스([name=''])
+    /*if (checkTarget.length < this.count) {
+      // 체크 다하면 더이상 작동 x.
+      return false;
+    }
+    $(checkTarget[this.count]).prop('checked', true); // 체크박스 체크
+    this.count++;*/
+	  
+	$("input:checkbox[name='chkCallTo']").each(function(){
+			
+		var chkSts = $(this).is(":checked");
+		
+		if(!chkSts){
+			$(this).prop("checked","true");
+			return false;				
+		}
+	
+	});
+    
+    console.log("+++++ publishCommonClick ::: " + this.count);
+  },
+  clickCheckPrice : function(){
+	  
+	  var callToCnt = 0;
+		$("input[name=chkCallTo]").each(function(){
+			
+			var chkSts = $(this).is(':checked');
+			if(chkSts){
+				callToCnt++;
+			}
+		});
+		
+		updateTotCnt(callToCnt); //전체 데이터 갯수 구하기
+		totalPriceSum(callToCnt);
+	  
+  }
+  
+}
Add a comment
List