// 쿠키 받기 함수 function getCookie(strname) { var nameOfCookie = strname + "="; 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 setCookie(name, value, expire) { var tDate = new Date(); tDate.setDate(tDate.getDate() + expire); document.cookie = name + "=" + escape(value) + ";path=/;expires="+tDate.toGMTString()+";" } // 포커스된 입력박스 색표시 function sendfocuscolor(objname) { objname.style.backgroundColor = "#F5F5F5"; } // 블러된 입력박스 색표시 function sendblurcolor(objname) { objname.style.backgroundColor = "#FFFFFF"; } //목록 포커스 색표시 function sendlistfocuscolor(objname) { objname.style.background = "#F5F5F5"; } //목록 블러 색 표시 function sendlistblurcolor(objname) { objname.style.background = "#FFFFFF"; } //한글입력검사 function checkkorean(strvalue) { var i = 0; var str = /[가-힣]/; while(i < strvalue.length) { if(!str.test(strvalue.charAt(i))) return true; i++; } return false; } //아이디검사 function checkid(strvalue) { var str = /[A-Za-z0-9]/; var i = 0 while(i < strvalue.length) { if(!str.test(strvalue.charAt(i))) { return true; break; } i++; } if(strvalue.length < 6) return true; return false; } // 비밀번호 검사 function checkpwd(strvalue) { if(checkspace(strvalue)) return true; if(strvalue.length < 6) return true; return false; } //주민등록번호검사 function checkresidentno(strvalue) { var str = /\d{6}[1-4]\d{6}/; if(str.test(strvalue)) { var check = new Array(13); var key = new Array(2,3,4,5,6,7,8,9,2,3,4,5); var sum = 0; for(var i=0; i<13; i++) check[i] = parseInt(strvalue.charAt(i),10); for(var i=0; i<12; i++) sum += check[i] * key[i]; var rs = (11-(sum%11)) % 10 if(rs != check[12]) return true; return false; } return true; } //공백입력검사 function checkspace(strvalue) { var str = /[ \n\r]/; var i = 0; var count = 0; while(i < strvalue.length) { if(str.test(strvalue.charAt(i))) count++; i++; } if(count == strvalue.length) return true; else return false; } //숫자입력검사 function checkdigit(strvalue, size) { var str = /[0-9]/; for(var i=0; i -1) { strvalue = strvalue.substr(strvalue.lastIndexOf(".") + 1,strvalue.length - strvalue.lastIndexOf(".") - 1).toLowerCase(); if(str.test(strvalue)) return false; else return true; } else return true; } //통화자리수표시 함수 function checkcurrency(intvalue) { var strvalue = intvalue.toString(); var commalocation = strvalue.length % 3; if(commalocation > 0) { var returnvalue = strvalue.substring(0,commalocation); if(strvalue.length > 3) returnvalue += ","; } else returnvalue = ""; for(var i=commalocation; i < strvalue.length; i+=3) { returnvalue += strvalue.substring(i, i+3); if(i < strvalue.length - 3) returnvalue += ","; } return returnvalue; } //팝업창 닫기 함수 function sendclose() { window.close(this); return false; } //인수 있는 팝업창 닫기 함수 function sendpopupclose(strname,strdays) { setCookie( strname, "done" , strdays); // 1=하룻동안 공지창 열지 않음 window.close(); } //뒤로 이동 함수 function sendback() { window.history.back(); return false; } // 엔터키를 받아 실행하는 함수 function sendkeypress(value) { if(window.event.keyCode == 13) { var objbtn = document.getElementById(value); objbtn.click(); } } //취소 함수 function sendcancel(strmsg, strlocation) { if(confirm(strmsg)) window.location.href = strlocation; } function sendpolicy() { sendopen("/member/security.htm", "policy", 725, 550, "no", "yes", false); } //팝업창 오픈 함수 - 가운데 정렬 function sendopen(strurl, strid, intwidth, intheight, strresizable, strscrollbars, boolreplace) { var top = window.screen.availHeight / 2 - intheight / 2; var left = window.screen.availWidth / 2 - intwidth / 2; var objwin = window.open(strurl,strid,"top=" + top + ",left=" + left + ",width=" + intwidth + ",height=" + intheight + ",location=no,menubar=no,resizable=" + strresizable + ",scrollbars=" + strscrollbars + ",status=no,titlebar=no,toolbar=no",boolreplace); if(objwin == null) alert("팝업을 허용하여 주시기 바랍니다."); else objwin.focus(); } //팝업창 오픈 함수 - 왼쪽 정렬 function sendpopupopen(strurl, strid, intleft, inttop, intwidth, intheight, strresizable, strscrollbars, boolreplace) { var objwin = window.open(strurl,strid,"top=" + inttop + ",left=" + intleft + ",width=" + intwidth + ",height=" + intheight + ",location=no,menubar=no,resizable=" + strresizable + ",scrollbars=" + strscrollbars + ",status=no,titlebar=no,toolbar=no",boolreplace); if(objwin == null) alert("팝업을 허용하여 주시기 바랍니다."); else objwin.focus(); } //다문화 사이트 링크 function sendglobalsitelink(combobox) { if(combobox.value != "") window.open(combobox.value,"_blank"); } //다문화 사이트 로그인 링크 function sendglobalsiteloginlink(combobox) { if(combobox.value != "") window.location.href = "/common/globalsitecheck.aspx?url=" + combobox.value; } /** 주어진 텍스트 박스의 최대길이(byte단위) 까지만 입력 받는다. viewer 는 길이를 표시할 div 또는 span태크 아이디 입력. 사용법 : onkeyup="VC_checkContentLength(this, '내용', 1000, null)" */ var VC_checkContentLength = function(obj, objName, maxLength, viewer) { var len = VC_getBytes(obj.value); if ( viewer != null ) { viewer.innerText = len; } if ( len > maxLength ) { alert(objName + "은(는) 최대 " + maxLength + "bytes 까지 등록할 수 있습니다. "); obj.value = VC_cutMaxLength(obj.value, maxLength); return true; } return false; } /** 한글등의 문자열의 바이트 수를 반환. */ var VC_getBytes = function(str) { return(str.length +(escape(str) + '%u').match(/%u/g).length-1); } /** 주어진 문자열을 주어진 길이 까지 잘라서 반환. */ var VC_cutMaxLength = function(message, max){ var inte = 0; var lcno = 0; var msg = ""; var msglen = message.length; for (i=0; i 4) { inte = 2; } else if (ch != '\r') { inte = 1; } if ((lcno + inte) > max) { break; } lcno += inte; msg += ch; } return msg; } function closeWin(){ self.close(); }