/////////////////////////////////////////////////////////////// // wfcb적용을 위해 추가 jinspeed /////////////////////////////////////////////////////////////// function WM_getCursorHandler(e) { // set event properties to global vars (add or subtract as desired) window.event.clientX = e.pageX; window.event.clientY = e.pageY; window.event.x = e.layerX; window.event.y = e.layerY; window.event.screenX = e.screenX; window.event.screenY = e.screenY; // route the event back to the intended function if (window.routeEvent && typeof(window.routeEvent)==="function") { if ( window.routeEvent(e) === false ) { return false; } else { return true; } } } /** * 함수명 : Div 보이기 */ function showDivision(div_name, div_top, div_left) { try { var div_style = document.getElementById(div_name).style; div_style.top = div_top; div_style.left = div_left; div_style.display = "block"; try { if (navigator.appName.match(/Explorer/i)) {// && (navigator.appVersion.match(/MSIE \d+.\d+/)[0].split(" ")[1]< 7.0)) { var bf = document.getElementById(div_name + "_layoutBackframe"); if (bf == null) { var lf = document.getElementById(div_name); if (lf != null) { bf = document.createElement("iframe"); bf.id = div_name + "_layoutBackframe"; bf.src = "/mlg/nocontents.jsp"; bf.border = "0"; bf.frameBorder = "0"; bf.scrolling = "no"; bf.style.margin = "0"; bf.style.padding = "0"; bf.style.position = "absolute"; bf.style.top = "0px"; bf.style.left = "0px"; bf.style.border = "0"; bf.style.zIndex = "-1"; bf.style.height = lf.offsetHeight; bf.style.width = lf.offsetWidth; bf.style.overflow = "hidden"; bf.style.filter = "mask()"; lf.appendChild(bf); } } } } catch (ignored) {} } catch(e) { } } function showDivisionCenter(div_name) { try { var scrollLeft,scrollTop; if (window.pageYOffset){ scrollTop = window.pageYOffset ; } else if(document.documentElement && document.documentElement.scrollTop){ scrollTop = document.documentElement.scrollTop; } else if(document.body){ scrollTop = document.body.scrollTop; } if(window.pageXOffset){ scrollLeft=window.pageXOffset ; } else if(document.documentElement && document.documentElement.scrollLeft){ scrollLeft=document.documentElement.scrollLeft; } else if(document.body){ scrollLeft=document.body.scrollLeft; } var windowWidth,windowHeight; // frame width & height if(window.innerWidth){ windowWidth=window.innerWidth; } else if(document.documentElement && document.documentElement.clientWidth){ windowWidth=document.documentElement.clientWidth; } else if(document.body){ windowWidth=document.body.offsetWidth; } if(window.innerHeight){ windowHeight=window.innerHeight; } else if(document.documentElement && document.documentElement.clientHeight){ windowHeight=document.documentElement.clientHeight; } else if(document.body){ windowHeight=document.body.clientHeight; } var div_height = 0; var div_width = 0; var div_style = document.getElementById(div_name).style; div_height = div_style.height; div_width = div_style.width; if(div_width === "" || div_width === null){ if(div_name==="ins") { div_width = 288; div_height = 70; }else if(div_name==="logout") { div_width = 469; div_height = 237; }else if(div_name==="logoutDone") { div_width = 469; div_height = 255; }else { div_width = 400; div_height = 200; } } //var div_top = (scrollTop + windowHeight / 2) - 118 + "px"; //var div_left = (scrollLeft + windowWidth / 2) - 209 + "px"; var div_top = (scrollTop + windowHeight / 2) - (div_height / 2) + "px"; var div_left = (scrollLeft + windowWidth / 2) - (div_width / 2) + "px"; showDivision(div_name, div_top, div_left) ; } catch(e) { } } /** * 함수명 : Div 감추기 */ function hideDivision(div_name) { try { var div_style = document.getElementById(div_name).style; div_style.display = "none"; } catch(e) { } } /** * 함수명 : 프로그레스바 보이기 */ function showProgressBar() { try { showDivisionCenter("ins"); } catch(e) { } } function hideProgressBar() { try { hideDivision("ins"); } catch(e) { } } /** * Form Submit시 "처리중"으로 버튼 변경 */ var strConpButton = ""; strConpButton = "Processing"; /** * 입력값이 NULL인지 체크 */ function isNull(input) { if (input.value === null || input.value === "") return true; return false; } /** * 입력값에 스페이스 이외의 의미있는 값이 있는지 체크 * ex) if (isEmpty(form.keyword)) { * alert("검색조건을 입력하세요."); * } */ function isEmpty(input) { if (input === null || input === "") return true; try { if (input.value === null || input.value.replace(/ /gi,"") === "") return true; } catch (ignore) {} return false; } /** * 한글검증 */ function isHangul(str){ if(isEmpty(str)) return false; for(var idx=0;idx < str.length;idx++){ var c = escape(str.charAt(idx)); if ( c.indexOf("%u") == -1 ) { return false; } } return true; } /** * 입력값이 알파벳,숫자로 되어있는지 체크 */ function isAlphaNum(input) { var format = /([^A-Za-z0-9]+)/; // ^ (반대의 의미) 반드시 필요 if(input.search(format) === -1) return true; return false; } /** * 입력값이 숫자로 되어있는지 체크 */ function isNumber(input) { var format = /([^0-9]+)/; // ^ (반대의 의미) 반드시 필요 if (typeof input === "string") { if(input.search(format) === -1) return true; } else { try { if (input.value.search(format) === -1) return true; } catch (e) {} } return false; } /** * 입력값이 전화번호 형식(숫자-숫자-숫자)인지 체크 (form.element) */ function isValidPhone(input) { var format = /^(\d+)-(\d+)-(\d+)$/; return isValidFormat(input,format); } /** * 입력값의 바이트 길이를 리턴 (form.element) * ex) if (getByteLength(form.title) > 100) { * alert("제목은 한글 50자(영문 100자) 이상 입력할 수 없습니다."); * } */ function getByteLength(input) { var byteLength = 0; for (var inx = 0; inx < input.value.length; inx++) { var oneChar = escape(input.value.charAt(inx)); if ( oneChar.length === 1 ) { byteLength ++; } else if (oneChar.indexOf("%u") !== -1) { byteLength += 2; } else if (oneChar.indexOf("%") !== -1) { byteLength += oneChar.length/3; } } return byteLength; } /** * 입력값이 사용자가 정의한 포맷 형식인지 체크 (form.element) * 자세한 format 형식은 자바스크립트의 'regular expression'을 참조 */ function isValidFormat(input,format) { if (input.value.search(format) !== -1) { return true; //올바른 포맷 형식 } return false; } /** * 입력값에서 콤마를 없앤다.(form.element) */ function removeComma(input) { return input.value.replace(/,/gi,""); } /** * 입력값에서 콤마를 없앤다.(String) */ function removeCommaString(input) { return input.replace(/,/gi,""); } /** * 현재 시각을 Time 형식으로 리턴 */ function getCurrentTime() { return toTimeString(new Date()); } /** * Cookie 구하기 */ function getCookie(uName) { var flag = document.cookie.indexOf(uName+'='); if (flag !== -1) { flag += uName.length + 1; end = document.cookie.indexOf(';', flag); if (end === -1) end = document.cookie.length; return unescape(document.cookie.substring(flag, end)); } } /** * Cookie 생성하기 */ function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } /** * 반각을 전각으로 변환 */ function Half2Full(HalfVal) { var arg; arg = myHalf2Full(HalfVal); return arg; } function myHalf2Full(HalfVal) { var FullChar = [ " ", "!",""","#","$","%","&","'","(", //33~ ")","*","+",",","-",".","/","0","1","2", //41~ "3","4","5","6","7","8","9",":",";","<", //51~ "=",">","?","@","A","B","C","D","E","F", //61~ "G","H","I","J","K","L","M","N","O","P", //71~ "Q","R","S","T","U","V","W","X","Y","Z", //81~ "[","₩","]","^","_","`","A","B","C","D", //91~ "E","F","G","H","I","J","K","L","M","N", //101~ "O","P","Q","R","S","T","U","V","W","X", //111~ "Y","Z","{","|","}","~" //121~ ]; var stFinal = ""; var ascii; for( i = 0; i < HalfVal.length; i++) { ascii = HalfVal.charCodeAt(i); if( (31 < ascii && ascii < 128)) { stFinal += FullChar[ascii-32]; } else { stFinal += HalfVal.charAt(i); } } return stFinal; } /** * 입력된 form.element의 값중에서 , 삭제함 */ function unFrmMoney(input){ input.value = replace(input.value,",",""); } /** * 입력된 form.element의 yyyymmdd 값을 yyyy.mm.dd 로 변경 */ function formatDate(sDate){ if(sDate.value=="") return ""; var returnDate = sDate.substring(0,4) + "." + sDate.substring(4,6) + "." + sDate.substring(6,8); return returnDate; } /** * 입력된 form.element의 yyyymmdd 값을 yyyy-mm-dd 로 변경 */ function frmDate(input){ if(input.value=="") return input.value = input.value.substring(0,4) + "-" + input.value.substring(4,6) + "-" + input.value.substring(6,8); } /** * 입력된 form.element의 값중에서 - 삭제함 */ function unFrmDate(input){ input.value = replace(input.value,"-",""); } /** * 입력된 form.element의 값중에서 . 삭제함 */ function unFrmDateDot(input){ input.value = replace(input.value,".",""); } /** * 입력된 form.element의 값중에서 . 을 - 로 변경 */ function chFrmDateDash(input){ input.value = replace(input.value,".","-"); } /** * 입력된 form.element의 값중에서 - 삭제함 */ function unFrmAcct(input){ input.value = replace(input.value,"-",""); } /** * 문자열에 있는 특정문자패턴을 다른 문자패턴으로 바꾸는 함수. */ function replace(targetStr, searchStr, replaceStr) { var i=0,j=0; if (targetStr === null || searchStr === null || replaceStr === null) return ""; var tmpStr = ""; var tlen = targetStr.length; var slen = searchStr.length; var i=0; var j=0; while (i < tlen - slen+1) { j = i + slen; if (targetStr.substring(i,j) === searchStr) { tmpStr += replaceStr; i += slen; } else { tmpStr += targetStr.substring(i, i + 1); i++; } } tmpStr += targetStr.substring(i); return tmpStr; } /** * 문자열에서 좌우 공백제거 */ function trim(str) { return replace(str," ",""); } /** * 콤마설정. */ function putComma(input) { var num = input; if (num < 0) { num *= -1; var minus = true; }else{ var minus = false; } var dotPos = (num+"").split("."); var dotU = dotPos[0]; var dotD = dotPos[1]; var commaFlag = dotU.length % 3; if(commaFlag) { var out = dotU.substring(0, commaFlag); if (dotU.length > 3) out += ","; } else var out = ""; for (var i=commaFlag; i < dotU.length; i+=3) { out += dotU.substring(i, i+3); if( i < dotU.length-3) out += ","; } if(minus) out = "-" + out; if(dotD) return out + "." + dotD; else return out; } /** * Left 빈자리 만큼 padStr 을 붙인다 */ function lpad(src, len, padStr){ var retStr = ""; var padCnt = Number(len) - String(src).length; for(var i=0;i= 4 && len <= 10 ) { for(var i=0; i"); for(i4=0; i4" + temp_value[i4]); } else { document.write("