function fnImageCheck(fileId) { var fileValue = $('#' + fileId).val(); if(fileValue && fileValue != '') { if(fileValue.toUpperCase().indexOf('.PNG') == -1 && fileValue.toUpperCase().indexOf('.JPG') == -1 && fileValue.toUpperCase().indexOf('.GIF') == -1 && fileValue.toUpperCase().indexOf('.BMP') == -1) { alert("이미지만 첨부가 가능합니다."); $('#' + fileId).focus(); return false; } } return true; } function fnGetCookie(name) { /* var prefix = name + "="; var cookieStartIndex = document.cookie.indexOf(prefix); if (cookieStartIndex == -1) return null; var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length); if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length; return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)); */ var results = document.cookie.match ( '(^|;) ?' + name + '=([^;]*)(;|$)' ); if ( results ) return ( unescape ( results[2] ) ); else return null; } function fnGetCookiePopup(name) { /* var prefix = name + "="; var cookieStartIndex = document.cookie.indexOf(prefix); if (cookieStartIndex == -1) return null; var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length); if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length; return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)); */ var results = document.cookie.match ( '(^|;) ?' + name + '=([^;]*)(;|$)' ); if ( results ) return ( unescape ( results[2] ) ); else return null; } function fnSetCookieValue(name, value) { var expireDate = new Date(); expireDate.setFullYear(expireDate.getFullYear() + 1); document.cookie = name + "=" + escape(value) + "; path=/; expires=" + expireDate.toGMTString() + ";"; } function fnSetCookiePopup( name, value, expiredays ) { var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + expiredays ); if(value != null) { document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"; } else { document.cookie = name + "=; path=/; expires=" + todayDate.toGMTString() + ";"; } } function fn_egov_popupOpen_PopupManage(popupId,fileUrl,width,height,top,left,stopVewAt){ var url = "/uss/ion/pwm/openPopupManage.do?"; url = url + "fileUrl=" + fileUrl; url = url + "&stopVewAt=" + stopVewAt; url = url + "&popupId=" + popupId; var name = popupId; var openWindows = window.open(url,name,"width="+width+",height="+height+",top="+top+",left="+left+",toolbar=no,status=no,location=no,scrollbars=yes,menubar=no,resizable=yes"); if (openWindows) {openWindows.focus();} } function fnTabListLoading(frmId, frmUrl) { var frm = document.getElementById(frmId); if(frm) { if(frm.src == "about:blank") { frm.src = frmUrl; } } } function initTabMenu(tabContainerID) { var tabContainer = document.getElementById(tabContainerID); var tabAnchor = tabContainer.getElementsByTagName("a"); var i = 0; for(i=0; i\n"); imgwin.document.write("크게보기\n"); // 새창으로 페이지 제목 imgwin.document.write("\n"); imgwin.document.write("function resize() {\n"); imgwin.document.write("pic = document.il;\n"); imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); imgwin.document.write(" if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 60; myWidth = eval(pic).width + 10;\n"); imgwin.document.write(" } else { myHeight = eval(pic).height + 56; myWidth = eval(pic).width + 8; }\n"); imgwin.document.write(" clearTimeout();\n"); imgwin.document.write(" var height = screen.height;\n"); imgwin.document.write(" var width = screen.width;\n"); imgwin.document.write(" var leftpos = width / 2 - myWidth / 2;\n"); //hjhj imgwin.document.write(" var toppos = height / 2 - myHeight / 2; \n"); imgwin.document.write(" self.moveTo(leftpos, toppos);\n"); imgwin.document.write(" self.resizeTo(myWidth, myHeight);\n"); imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); imgwin.document.write("\n"); imgwin.document.write("\n"); imgwin.document.write("이미지를 클릭하시면 창이 닫힙니다.\n"); imgwin.document.write("\n"); imgwin.document.close(); } function goUrl(value) { var obj = document.getElementById("sLink"+value); if(value != "") { if(obj.value == "") { alert("사이트를 선택하세요"); return false; } window.open(obj.value); } } function fn_byte_convert(val) { var size = "0 KB"; if (val >= 1073741824) size = fn_comma(round(val / 1073741824, 2)) + " GB"; else if (val >= 1048576) size = fn_comma(round(val / 1048576, 2)) + " MB"; else if (val >= 1024) size = fn_comma(round(val / 1024, 2)) + " KB"; else if (val > 0 && round(val < 1024, 2)) size = "1 KB"; return size; } function round(n, digits) { var factor = Math.pow(10, digits); // 정수부 반올림 var increment = 5/(factor*10); return Math.floor((n+increment)*factor)/factor; } function fn_comma(n) { var reg = /(^[+-]?\d+)(\d{3})/; n += ''; while (reg.test(n)) { n = n.replace(reg, '$1' + ',' + '$2'); } return n; } function fn_egov_editor_file_add(userFile, wireData) { //확장자 추출 부분 작업 var fileVal = userFile.orignlFileNm, ext = fileVal.split("."), splitSize = ext.length - 1, fileExt = ext[splitSize].toLowerCase(), icon = "icon-file"; if(fileExt=="bmp" || fileExt=="gif" || fileExt=="jpeg" || fileExt=="jpg" || fileExt=="png"){ icon = "icon-img"; } var pageChk = $("#staffPage").val(); var list = ""; if(pageChk == "staff"){ list += ""; list += "" + userFile.orignlFileNm + ""; list += "-" list += ""; //list += "-"; }else if(pageChk == "common"){ list += ""; list += "" + userFile.orignlFileNm + ""; list += "-"; list += ""; }else{ list += ""; list += "파일 " + userFile.orignlFileNm + ""; list += "" + fn_byte_convert(userFile.fileMg) + ""; list += ""; list += ""; } $('#fileGroupId_' + wireData.editorId).val(userFile.atchFileId); $('#fileCurrSize_' + wireData.editorId).val(wireData.totalFileMg); $('#fileCurrCount_' + wireData.editorId).val(wireData.totalFileCount); $('#multiFileList_' + wireData.editorId).append(list); /*if(userFile.IsEdit == 'True') { $('#' + userFile.atchFileId + '_' + userFile.fileSn).remove(); }*/ if(tinymce) { var html = ""; if (isImage(userFile.orignlFileNm)) { html = '' + userFile.fileStreWebCours + ''; } else if(isVideo(userFile.orignlFileNm)) { html = '' + userFile.fileStreWebCours + ''; } if(html != ''){ tinymce.activeEditor.insertContent(html); } } fn_egov_file_clean_action(wireData.editorId); } function fn_egov_editor_tmpr_file_del(editorId, tmprFileId) { if(confirm('삭제하시면 본문에서도 삭제됩니다. 계속하시겠습니까?')) { var url = "/cmm/fms/deleteStreamLongFileByAjax.do"; var param = {tmprFileId:tmprFileId}; $.ajax({ type : "POST", url : url, data : param, dataType : "json", success : function(data) { if(data.delCount > 0) { fn_egov_editor_file_del_action(data, editorId); } }, error: function(xhr, textStatus, errorThrown) { alert('An error occurred! ' + ( errorThrown ? errorThrown :xhr.status )); } }); } } function fn_egov_editor_file_del(editorId, estnAt, progrmId, atchFileId, fileSn) { if(confirm('삭제하시면 본문에서도 삭제됩니다. 계속하시겠습니까?')) { var url = "/cmm/fms/deleteFileInfByAjax.do"; var param = {estnAt:estnAt, progrmId:progrmId, atchFileId:atchFileId, fileSn:fileSn}; $.ajax({ type : "POST", url : url, data : param, dataType : "json", success : function(data) { if(data.delCount > 0) { fn_egov_editor_file_del_action(data, editorId); } }, error: function(xhr, textStatus, errorThrown) { alert('An error occurred! ' + ( errorThrown ? errorThrown :xhr.status )); } }); } } function fn_egov_editor_file_del_action(data, editorId) { $('#fileCurrSize_' + editorId).val(data.totalFileMg); $('#fileCurrCount_' + editorId).val(data.totalFileCount); $('#' + data.atchFileId + '_' + data.fileSn).remove(); $('.' + data.atchFileId + '_' + data.fileSn).remove(); tinyMCE.activeEditor.dom.remove(tinyMCE.activeEditor.dom.select('[class=' + data.atchFileId + '_' + data.fileSn + ']')); tinyMCE.activeEditor.dom.remove(tinyMCE.activeEditor.dom.select('[data-mce-p-class=' + data.atchFileId + '_' + data.fileSn + ']')); fn_egov_file_clean_action(editorId); } function fn_egov_file_clean_action(editorId) { if($('#multiFileList_' + editorId).children().length == 1) { $('#tr_file_empty_' + editorId).show(); } else { $('#tr_file_empty_' + editorId).hide(); } $('#lblMaxCount_' + editorId).html($('#posblAtchFileNumber_' + editorId).val()); $('#lblMaxSize_' + editorId).html(fn_byte_convert($('#posblAtchFileSize_' + editorId).val())); $('#lblCurrCount_' + editorId).html($('#fileCurrCount_' + editorId).val()); $('#lblCurrSize_' + editorId).html(fn_byte_convert($('#fileCurrSize_' + editorId).val())); } function fn_egov_downFile(url) { window.open(url); } var nowZoom = 100; function zoomIn() { nowZoom = nowZoom + 20; if(nowZoom >= 500) nowZoom = 500; zooms(); } function zoomOut() { nowZoom = nowZoom - 10; if(nowZoom <= 70) nowZoom = 70; zooms(); } function zoomReset(){ nowZoom = 100; zooms(); } function zooms(){ document.body.style.zoom = nowZoom + '%'; if(nowZoom==70){ alert ("30%축소 되었습니다. 더 이상 축소할 수 없습니다."); } if(nowZoom==500){ alert ("500%확대 되었습니다. 더 이상 확대할 수 없습니다."); } } var token = ""; var loginYn = ""; $(document).ready(function(){ /*$('a').click(function() { ssoLinkAction(this); });*/ $('#btnMyMenuAdd').click(function() { if (confirm('마이메뉴에 추가 하시겠습니까?')) { location.href = this.href; } return false; }); $.datepicker.setDefaults({ dateFormat: 'yy-mm-dd', prevText: '이전 달', nextText: '다음 달', monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], dayNames: ['일', '월', '화', '수', '목', '금', '토'], dayNamesShort: ['일', '월', '화', '수', '목', '금', '토'], dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'], showMonthAfterYear: true, yearSuffix: '년' }); $('.datepicker').datepicker({ dateFormat: 'yy-mm-dd' }); $(document).on("keyup", ".numonly", function(key) { if(key.keyCode == 8 || key.keyCode == 46) { return; } var val = $(this).val().replace(/[^0-9]/gi,""); $(this).val(val == "" ? 0 : val); }); }); /*function ssoLinkAction(aObj) { if(token != "" && loginYn == "Y" && aObj.href.indexOf('javascript') == -1 && aObj.href.indexOf(document.domain) == -1) { var makeUrl = aObj.href; if(aObj.href.indexOf('token') == -1) { makeUrl = aObj.href + (aObj.href.indexOf('?') == -1 ? '?' : '&') + 'token=' + token; } aObj.href = makeUrl; } }*/ function getJson(url, param, callback) { $.ajax({ type : "POST", url : url, data : param, dataType : "json", success : function(result) { if(result.success) { callback(result); } else { alert('문제가 발생하여 작업을 완료하지 못하였습니다.'); } }, error: function(xhr, textStatus, errorThrown) { alert('An error occurred! ' + ( errorThrown ? errorThrown :xhr.status )); } }); } function getHtml(url, param, callback) { $.ajax({ type : "POST", url : url, data : param, dataType : "html", success : function(result) { callback(result); }, error: function(xhr, textStatus, errorThrown) { alert('An error occurred! ' + ( errorThrown ? errorThrown :xhr.status )); } }); } /** * 앞뒤 공백 제거 */ function trim(str) { return str.replace(/(^[ \f\n\r\t]*)|([ \f\n\r\t]*$)/g, ""); } //금액 function numberWithCommas(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } //랜덤함수 function randOnlyString(leng){ var ALPHA = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'], rN = '', leng = leng == null || leng == 'undefined' ? 8 : leng; for(var i=0; i