function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i= 37 && value <= 40) || value == 46 || (value >= 48 && value <= 57) || value == 110 || value == 190 || value == 192 || value == 27 || value == 116 || (value >= 96 && value <= 105)) return true; else return false; } // 숫자+"."만 입력 // onkeydown을 사용할 것 2004/05/08 - 박일형 function num_chekDot() { if (isNumericDot(event.keyCode)==false){ alert("숫자만 입력 가능합니다."); event.returnValue=false; } } //숫자+"-"인지 체크 function isNumericHyphen( value ) { if (value == 8 || value == 9 || value == 13 || (value >= 35 && value <= 40) || value == 46 || (value >= 48 && value <= 57) || value == 109 || value == 189 || value == 27 || value == 116 || (value >= 96 && value <= 105)) return true; else return false; } // 숫자+"-"만 입력 // onkeydown을 사용할 것 2004/05/08 - 박일형 function num_chekHyphen() { if (isNumericHyphen(event.keyCode)==false){ alert("숫자와 '-'만 입력 가능합니다."); event.returnValue=false; } } //숫자인지 체크 function isNumeric( value ) { if (value == 8 || value == 9 || value == 13 || (value >= 37 && value <= 40) || value == 46 || value == 27 || value == 116 || (value >= 48 && value <= 57) || (value >= 96 && value <= 105)) return true; else return false; } // 숫자만 입력 // onkeydown을 사용할 것 2004/05/08 - 박일형 function num_chek() { if (isNumeric(event.keyCode)==false){ alert("숫자만 입력 가능합니다."); event.returnValue=false; } } // 파일 부분에 텍스트 입력 못하게 하기 위해서 function fileWriteNot(){ event.returnValue=false; } // 기능: 문자열의 앞, 뒤 공백을 제거한다 // 파라미터: 문자열 // 리턴값: 문자열 function trim(str) { var s = str.replace(/^ */, ""); s = s.replace(/ *$/, ""); return s; } //개발 관련 공통 js // 새창 띄우기 // 파라미터 설명 // name : 윈도우 창 이름 // url : 뿌려줄 페이지 // width : 윈도우 창 넓이 // height: 윈도우 창 높이 // toolbar : 툴바 나타낼지 여부 // menubar : 메뉴바 나타낼지 여부 // statusbar : 상태바 나타낼지 여부 // scrollbar : 스크롤바 나타낼지 여부 // resizable : 리사이즈 기능 여부 // 예제 : open_window('./test.do', 'test', '' ,'' ,'200','100','','','','','') function open_window(url, name, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) { toolbar_str = toolbar ? 'yes' : 'no'; menubar_str = menubar ? 'yes' : 'no'; statusbar_str = statusbar ? 'yes' : 'no'; scrollbar_str = scrollbar ? 'yes' : 'no'; resizable_str = resizable ? 'yes' : 'no'; /* target = window.open(url, name, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar_str+', menubar=' +menubar_str+', status='+statusbar_str+', scrollbars='+scrollbar_str+', resizable='+resizable_str); target.focus(); */ if (url != null && url != ""){ window.open(url, name, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar_str+', menubar=' +menubar_str+', status='+statusbar_str+', scrollbars='+scrollbar_str+', resizable='+resizable_str); } } //개발 관련 공통 js // 새창 띄우기 // 파라미터 설명 // name : 윈도우 창 이름 // url : 뿌려줄 페이지 // width : 윈도우 창 넓이 // height: 윈도우 창 높이 // toolbar : 툴바 나타낼지 여부 // menubar : 메뉴바 나타낼지 여부 // statusbar : 상태바 나타낼지 여부 // scrollbar : 스크롤바 나타낼지 여부 // resizable : 리사이즈 기능 여부 // 예제 : open_window('./test.do', 'test', '' ,'' ,'200','100','','','','','') function open_window1(url, name, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) { toolbar_str = toolbar ? 'yes' : 'no'; menubar_str = menubar ? 'yes' : 'no'; statusbar_str = statusbar ? 'yes' : 'no'; scrollbar_str = scrollbar ? 'yes' : 'no'; resizable_str = resizable ? 'yes' : 'no'; /* target = window.open(url, name, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar_str+', menubar=' +menubar_str+', status='+statusbar_str+', scrollbars='+scrollbar_str+', resizable='+resizable_str); target.focus(); */ if (url != null && url != ""){ var temp = url.substring(0,7); if(temp!="http://"){ url = "http://"+url; } window.open(url, name, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar_str+', menubar=' +menubar_str+', status='+statusbar_str+', scrollbars='+scrollbar_str+', resizable='+resizable_str); } } // 검색어 특수 문자 체크 // return : false (검색안됨), true (특수문자검색 및 메세지) function chkSpeChar( oInputCtrl) { var speChar = " `~!#$%^&*+=|\\[]{}:;-,<>/?'\""; for(var iCnt = 0; iCnt < speChar.length; iCnt++) { special = speChar.substr(iCnt, 1); if( oInputCtrl.value.indexOf(special) != -1) { alert("특수문자[" + special + "]를 검색어에 입력 할 수 없습니다."); return true; } } return false; } //행당월의 날짜 셀렉트 박스 function chkDay(o,valYear, valMonth, valDay, dayValue){ var tyearName,tMonthName,tDayName, lastDay,i; tyearName = eval(o + "." + valYear); tMonthName = eval(o + "." + valMonth); tDayName = eval(o + "." + valDay); //lert(tyearName.selectedIndex) //alert(tyearName.selectedIndex); //alert(tMonthName.selectedIndex); if(tyearName.selectedIndex>0 && tMonthName.selectedIndex>0){ lastDay = getDayNum(parseInt(tyearName.value,10), parseInt(tMonthName.value,10)); tDayName.options.length = lastDay+1; tDayName.options[0].value = ""; tDayName.options[0].text = "일"; for(i=0 ; i < lastDay ; i++) { //alert(tDayName.options[i].value); if (i+1<10){ tDayName.options[i+1].value = "0"+(i+1); tDayName.options[i+1].text = "0"+(i+1); }else{ tDayName.options[i+1].value = i+1; tDayName.options[i+1].text = i+1; } } if (dayValue!=""){ tDayName.selectedIndex = dayValue; } tDayName.focus(); }else{ tDayName.options.length = 1; tDayName.options[0].value = ""; tDayName.options[0].text = "일"; } } //해당월의 마지막날짜 function getDayNum(valYear, valMonth){ var monthDays; monthDays = [31,28,31,30,31,30,31,31,30,31,30,31]; if ((((valYear % 4) == 0) && ((valYear % 100) != 0)) || ((valYear % 400) == 0)){ monthDays[1] = 29; } return monthDays[parseInt(valMonth)-1]; } // 메일주소 체크 function chkEmailAddr( sEmail) { var sRegExp = /([\w|\-]+)@([\w|\-]+)\.(\w+)/; return sRegExp.test( sEmail) } //textarea 박스의 글자 제어 함수 //pInName : (예 document.frmForm.content) function showMsgLen(pInName, pLen, pMsgLen){ if (getStrLen(eval(pInName+".value"))>pLen){ alert("영문 " + pLen + "자, 한글 " + pLen/2 + " 이내로 작성해 주세요."); eval(pInName+".focus()"); } pMsgLen.innerHTML = getStrLen(eval(pInName+".value")) + '/' + pLen; } function getStrLen(str){ var len=0, j; for (i=0, j=str.length; i127) ) { len = len+1; } } return len; } //다음 텝으로 이동하기 (주민번호나 전화 번호 등) function numTeb(o, pLen, pPre, pNext){ if (eval("o." + pPre + ".value.length==" + pLen)){ eval("o." + pNext + ".focus();"); return; } } // Form Validation: // @author 우동식 // control : text box name // msg : ("제목을 입력하세요.") // return : false (form validation fail), true (form validation 성공) function isFilled(control, msg) { if (control.value == null || control.value.length == 0) { alert(msg); control.focus(); control.select(); return false; } return true; } // Form Validation: // @author 우동식 // control : radio box // return : false (form validation fail), true (form validation 성공) function isChecked(control, msg) { // radio button. var val = false; for (var i=0; i0) { control.focus(); alert(msg); } return val; } // 리스트의 체크박스 전체 선택 및 해지 함수 시작 /*전체 선택 해제*/ function AllChk(o, pAll, pChk){ var value; var tmpChkAll, tmpChk; tmpChkAll = eval("o." + pAll); tmpChk = eval("o." + pChk); if (tmpChkAll.checked==true){ value=true; }else{ value=false; } if ( tmpChk != null ){ var olen = eval(tmpChk.length); if ( olen != null ){ for ( var i = 0 ; i < tmpChk.length ; i++ ){ tmpChk[i].checked = value; } }else{ tmpChk.checked = value; } } } /*각 체크 박스를 선택하여 전체 체크박스 제어*/ function chkBox(o, pAll, pChk){ var value; var tmpChkAll, tmpChk; tmpChkAll = eval("o." + pAll); tmpChk = eval("o." + pChk); value = true; if ( tmpChk != null ){ var olen = eval(tmpChk.length); if ( olen != null ){ for ( var i = 0 ; i < tmpChk.length ; i++ ){ if (tmpChk[i].checked == false){ value=false; break; } } }else{ if (tmpChk.checked == false){ value=false; } } } tmpChkAll.checked=value; } // 리스트의 체크박스 전체 선택 및 해지 함수 끝 //선택 삭제 확인 function checkDelete(fName, o){ var sum; sum=0; var tmpChk; tmpChk = eval("o." + fName) if ( tmpChk != null ){ var olen = eval(tmpChk.length); if ( olen != null ){ for ( var i = 0 ; i < tmpChk.length ; i++ ){ if (tmpChk[i].checked == true){ sum++; } } }else{ if (tmpChk.checked==true){ sum=1; } } } if (sum==0){ alert("선택하셔야 합니다."); return false; } if (confirm("삭제하시겠습니까?") == true){ return true; } return false; } /*페이징 폼 submit*/ function listPage(val){ document.listFrm.page.value = val; document.listFrm.submit(); } //웹에디터 부분 function BackGroundColor(o){ var bgcolorChk; bgcolorChk = o.tbContentElement.DOM.body.style.backgroundColor; if (bgcolorChk==""){ o.contentValue.value = o.tbContentElement.DOM.body.innerHTML; }else{ o.contentValue.value = "
" + o.tbContentElement.DOM.body.innerHTML + "
"; } } // 쿠키값 가져 오기 (주로 오픈창에서 하루만 부분 제에 할때 사용 function getCookie(name) { var nameOfCookie=name+"="; var x=0; while(x<=document.cookie.length) { var y=(x+nameOfCookie.length) if(document.cookie.substring(x,y)==nameOfCookie) { if((endOfCookie=document.cookie.indexOf(";",y))==-1) endOfCookie=document.cookie.length; return unescape(document.cookie.substring(y,endOfCookie)); } x=document.cookie.indexOf(" ",x) +1; if(x==0) break; } return ""; } //로그인 체크 function chkLogin(o){ if(trim(o.loginName.value)==""){ alert("아이디를 입력하세요."); o.loginName.focus(); return false; } if(trim(o.password.value)==""){ alert("비밀번호를 입력하세요."); o.password.focus(); return false; } return; } //로그인 체크 function chkLoginSSO(o){ if(trim(o.id.value)==""){ alert("아이디를 입력하세요."); o.id.focus(); return false; } if(trim(o.passwd.value)==""){ alert("비밀번호를 입력하세요."); o.passwd.focus(); return false; } return; } //전체 오픈 function linkPopOpen(value, wValue, hValue){ open_window( value, "linkPop", "10", "10", wValue, hValue, "", "", "", "auto", ""); } // 이미지 width 만 줄이기 function resizeImage(o, pWidth){ var MAX_WIDTH=pWidth; if (o.width > MAX_WIDTH) { o.width = MAX_WIDTH; } } // 이미지 width, height 줄이기 function resizeImageWH(o, pWidth, pHeight){ var MAX_WIDTH=pWidth; var MAX_HEIGHT=pHeight; if (o.width > MAX_WIDTH) { o.width = MAX_WIDTH; } if (o.height > MAX_HEIGHT) { o.height = MAX_HEIGHT; } } // 이미지 팝업창 윈도우 크기에 따라서 제어 function ImageReSizeWindow(o){ var objBody, height, width var version; version = navigator.appVersion; objBody = document.body height = objBody.offsetHeight + (objBody.offsetHeight - objBody.clientHeight) width = objBody.offsetWidth + (objBody.offsetWidth - objBody.clientWidth) if (o.width > o.height) { if(o.width <= width){ width = o.width + 30; height = o.height + 20; }else if(o.width < window.screen.Width && o.width > width){ width = o.width + 30; height = o.height + 20; }else if(o.width >= window.screen.Width){ width = window.screen.Width - 100; height = window.screen.Height - 100; } if(version.indexOf("Windows NT 5.1") > -1){ height = height + 20; } window.resizeTo(width, height); }else{ if(o.height <= height){ width = o.width + 30; height = o.height + 20; }else if(o.height < window.screen.Height && o.height > height){ width = o.width + 30; height = o.height + 20; }else if(o.height >= window.screen.Width){ width = window.screen.Width - 100; height = window.screen.Height - 100; } if(version.indexOf("Windows NT 5.1") > -1){ height = height + 20; } window.resizeTo(width, height); } } // 메인 , 우측 마우스 온오버시 이미지 변경 스크립트 시작 function replaceImg(imgName,obj) { obj.src = imgName; } function showL(num){ var temp; for(i=3;i<=6;i++){ temp = "layer_" + i; if(i == num){ document.all[temp].style.display = ""; } else { document.all[temp].style.display = "none"; } } } function hideL(){ var temp; for(i=3;i<=6;i++){ temp = "layer_" + i; document.all[temp].style.display = "none"; } } //검색 function searchSend(o) { if(trim(o.qt.value)=="") { alert("검색어를 입력하세요"); o.qt.focus(); return false; } return; } // 달력 function show_cal(url, what, fName, check){ var txt = new String(""); document.all[what].innerHTML = txt; } // textarea 글자수 제한 function fc_chk_byte(aro_name,ari_max,pMsgLen){ var len=0, j; var li_len = 0; var str = aro_name.value; var ls_str2 = ""; for (i=0, j=str.length; i127) ) { len = len+1; } // 전체 크기가 li_max를 넘지않으면 if(len <= ari_max) { li_len = i + 1; } } if (len > ari_max){ alert( ari_max + " 글자를 초과 입력할수 없습니다. \n 초과된 내용은 자동으로 삭제 됩니다. "); ls_str2 = str.substr(0, (li_len-1)); aro_name.value = ls_str2; len = ari_max } if ((pMsgLen!="") && (pMsgLen!=null)) { pMsgLen.innerHTML = '[ ' +len + '/' + ari_max + ' ]'; } } function checkSpace( str ){ if(str.search(/\s/) != -1){ return 1; } else { return ""; } } // 비밀번호 체크 function validPWD( formName , str ){ var retVal = checkSpace( str ); if( retVal!=null && retVal != "" ) { eval("document."+formName+".msg.value='비밀번호는 빈 공간 없이 연속된 영문 소문자와 숫자만 사용할 수 있습니다.'"); return true; } /* checkFormat */ var isID = /^[a-z0-9]{4,12}$/; if( !isID.test(str) ) { eval("document."+formName+".msg.value='비밀번호는 4~12자의 영문 소문자와 숫자만 사용할 수 있습니다.'"); return true; } return false; } function checkImgFormat_add(imgPath) { if ( imgPath.indexOf(".PNG") != -1 || imgPath.indexOf(".GIF") != -1 || imgPath.indexOf(".png") != -1 || imgPath.indexOf(".gif") != -1 || imgPath.indexOf(".jpg") != -1 || imgPath.indexOf(".GIF") != -1 || imgPath.indexOf(".JPG") != -1) { return true; } else { if ( imgPath != "" ) { alert("지원하지 않는 파일형식이므로 첨부하실수없습니다."); return false; } else { return false; } } } //비밀번호 체크(영문, 숫자만 허용) function isAlphaNum( value ) { if(value == 8 || value == 9 || value == 13 || value == 21 || (value >= 35 && value <= 40) || (value >= 45 && value <= 46) || (value >= 48 && value <= 57) || (value >= 65 && value <= 90) || (value >= 96 && value <= 105) || value == 27 || value == 116) return true; else return false; } //비밀번호 체크(영문, 숫자만 허용) // onkeydown을 사용할 것 2004/05/08 - 박일형 function alphaNumCheck() { if (isAlphaNum(event.keyCode)==false){ alert("영문과 숫자만 입력 가능합니다."); event.returnValue=false; } } function newContentImg(tmpDate){ var chkDate = new Date(); var yearStrTmp, monthStrTmp, dayStrTmp; yearStrTmp = chkDate.getYear(); monthStrTmp = chkDate.getMonth()+1; dayStrTmp = chkDate.getDate(); if (monthStrTmp<10){ monthStrTmp = '0' + monthStrTmp; } if (dayStrTmp<10){ dayStrTmp = '0' + dayStrTmp; } yearStrTmp = '' + yearStrTmp + monthStrTmp + dayStrTmp; if (tmpDate'); } } function resizeImg(imgObj,w,h) { var imgOriginal = new Image(); imgOriginal.visibleImgObj = imgObj; imgOriginal.onload = function() { resizeImgSub(this,w,h); } imgOriginal.src = imgObj.src; } function resizeImgSub(img,w,h) { var imgTemp = new Image(); imgTemp.src = img.src; if ( imgTemp.width > w || imgTemp.height > h ){ if ( (img.width / w) > (img.height / h) ) img.visibleImgObj.height = Math.round(img.height * (w / img.width)); else img.visibleImgObj.width = Math.round(img.width * (h / img.height)); } else { img.visibleImgObj.width = imgTemp.width; img.visibleImgObj.height = imgTemp.height; } } function isExtension(path) { if(path == null) { alert("적합하지 않은 Object입니다."); return false; } if(path.value != ""){ var extension = path.value.substring(path.value.lastIndexOf('.')+1, path.value.length); if(extension.toLowerCase() == "exe" || extension.toLowerCase() == "dll"){ alert("적합한 File을 첨부하여 주세요.\r\r(\"exe\", \"dll\" 확장자는 첨부되지 않습니다.)"); path.focus(); return false; } } return true; } function resizeImg(imgObj) { var imgOriginal = new Image(); imgOriginal.visibleImgObj = imgObj; imgOriginal.onload = function() { resizeImgSub(this); } imgOriginal.src = imgObj.src; } function resizeImgSub(img) { var imgTemp = new Image(); imgTemp.src = img.src; if ( imgTemp.width > img.visibleImgObj.width || imgTemp.height > img.visibleImgObj.height ){ if ( (img.width / img.visibleImgObj.width) > (img.height / img.visibleImgObj.height) ) img.visibleImgObj.height = Math.round(img.height * (img.visibleImgObj.width / img.width)); else img.visibleImgObj.width = Math.round(img.width * (img.visibleImgObj.height / img.height)); } else { img.visibleImgObj.width = imgTemp.width; img.visibleImgObj.height = imgTemp.height; } } function getBodoComName(pValue){ Ccode = ["01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22"] Cname = ["경향신문","국민일보","국정브리핑","노컷뉴스","뉴시스","데일리서프라이즈","데일포커스","동아일보","매일경제","문화일보","부산일보","서울경제","서울신문","세계일보","연합뉴스","오마이뉴스","조선일보","중앙일보","프레시안","한겨레","한국일보","헤럴드경제"] var tmpName; tmpName = ""; for(i=0; i