// dummy var dateObj = new Date(); var dummy = dateObj.getTime(); // 숫자만 입력 // onkeydown="javascript:ckkOnlyNumberInput(event);" function ckkOnlyNumberInput(e) { // IE코드 if (window.event) { var code = window.event.keyCode; } else // 그 외 브라우저 { var code = e.which; } // 숫자(48 ~ 57, 96 ~ 105) // 백스페이스 : 8 // TAB : 9 // DELETE : 46 if ( (code > 47 && code < 58) || (code > 95 && code < 106) || code == 8 || code == 9 || code == 13 || code == 46) { window.event.returnValue = true; return; } if (window.event) { window.event.returnValue = false; } else { e.preventDefault(); } } // 숫자 + 알파벳 function chkOnlyNumberAlphabetInput(e) { // IE코드 if (window.event) { var code = window.event.keyCode; } else // 그 외 브라우저 { var code = e.which; } // 숫자(48 ~ 57, 96 ~ 105) // 알파벳(65 ~ 90) // 백스페이스 : 8 // TAB : 9 // DELETE : 46 if ((code > 47 && code < 58) || (code > 95 && code < 106) || (code > 64 && code < 91) || code == 8 || code == 9 || code == 13 || code == 46) { window.event.returnValue = true; return; } if (window.event) { window.event.returnValue = false; } else { e.preventDefault(); } } // 커서 이동 // onKeyUp="chkFocusMove('target1', 'target2', 6);" function chkFocusMove(target1, target2, number) { try { if ( $("#"+target1).val().length >= number) { $("#"+target2).focus(); } } catch (e) {} } // 서비스 준비중 function errMsg() { alert(' 죄송합니다. 현재 홈페이지 점검중입니다! \n 교육신청은 02-3482-4632~5번으로 연락주십시오! \n 빠르게복구하겠습니다.!'); return; } // 숫자 체크 function checkNum(str) { var isNum = true; if (str == null || str == '') { isNum = false; return isNum; } for (var j = 0 ; j < str.length; j++) { if ( str.substring(j, j + 1) != "0" && str.substring(j, j + 1) != "1" && str.substring(j, j + 1) != "2" && str.substring(j, j + 1) != "3" && str.substring(j, j + 1) != "4" && str.substring(j, j + 1) != "5" && str.substring(j, j + 1) != "6" && str.substring(j, j + 1) != "7" && str.substring(j, j + 1) != "8" && str.substring(j, j + 1) != "9" ) { isNum = false; } } return isNum; } //숫자만 입력 // onkeypress='chkNumOnly(this.form);' function chkNumOnly(fform) { if ((event.keyCode > 47) && (event.keyCode < 58)) { event.returnValue=true; } else { event.returnValue =false; fform.focus(); } } // 영문, 특수 문자 체크 function checkEngNum(str) { var alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; var nonChar = '_-'; var nonKorean = alpha + nonChar; var i ; for ( i=0; i < str.length; i++ ) { if( nonKorean.indexOf(str.substring(i,i+1)) < 0) { break ; } } if ( i != str.length ) { return false ; } else { return true ; } return true; } // 레이어 가운대 띄우기 function centerLayerMove(strLayerid) { var obj_centerLayer=document.getElementById(strLayerid); var bodywidth=document.documentElement.clientWidth; var bodyheight=document.documentElement.clientHeight; var divWidth=obj_centerLayer.offsetWidth; var divHeight=obj_centerLayer.offsetHeight; if(typeof document.body.style.maxHeight!="undefined") { var bodyWidth=document.body.clientWidth; bodyHeight=document.body.clientHeight; if(!!(window.attachEvent && !window.opera)) { pageLeft=document.documentElement.scrollLeft; pageTop=document.documentElement.scrollTop; } else { pageLeft=window.pageXOffset; pageTop=window.pageYOffset; } } else { pageLeft=document.documentElement.scrollLeft; pageTop=document.documentElement.scrollTop; } var divLeft=pageLeft,divTop=pageTop; if(bodyWidth > divWidth) { divLeft=pageLeft+Math.ceil((bodyWidth-divWidth)/2); } if(bodyHeight > divHeight) { divTop=pageTop+Math.ceil((bodyHeight-divHeight)/2); } obj_centerLayer.style.left=divLeft+"px"; obj_centerLayer.style.top=divTop+"px"; if(obj_centerLayer.style.display=="") { setTimeout(function(){centerLayerMove(strLayerid);},100); } } // 레이어 팝업 function setLayerPopupShow(target, width, height) { // Get the screen height and width var maskHeight = $(document).height(); var maskWidth = $(window).width(); // Set heigth and width to mask to fill up the whole screen $('#mask').css({'width':maskWidth,'height':maskHeight}); // transition effect $('#mask').fadeTo("slow",0.4); // location var topPx = (document.documentElement.scrollTop) + width + "px"; var leftPx = parseInt(document.body.clientWidth/2) - height + "px"; $("#"+target).css("display","block"); $("#"+target).css("top",topPx); $("#"+target).css("left",leftPx); } // layer popup hide function setLayerPopupHide(target, mask) { if(mask == 'hidden') { $('#mask').hide(); } $("#"+target).css("display","none"); }