/** 2005/12/05 ±èÀ¯°æ 2006-08-01 9:30¿ÀÀü nonkr() À̸ÞÀÏ¿¡¼­ '_', '.' »ç¿ë°¡´É 2006-08-09 1:10¿ÀÈÄ nonkr2() »çÀ̹ö¹Î¿ø 2006-08-28 1:43¿ÀÈÄ isDate() / isNumber() / getStrLen() Ãß°¡ 2006-08-29 11:22¿ÀÀü setSep() /getSep()/ setCustNoSep()/ getCustNoSep() Ãß°¡ 2006-09-07 3:01¿ÀÈÄ CheckDay() ƯÁ¤³¯Â¥ ¿äÀÏ ±¸Çϱâ - ÀüÈ­»ó´ã¿¹¾à 2006-12-21 2:52¿ÀÈÄ isDateAlert() ³¯Â¥Çü½Ä¸Â´ÂÁö 2007-02-16 2:16¿ÀÈÄ addYear() À±³â 2007-03-07 1:53¿ÀÈÄ Add_Comma() 2007-05-09 2:57¿ÀÈÄ nonkr() À̸ÞÀÏ¿¡¼­ '-','*' »ç¿ëÃß°¡-½ÉÈ﹫ 2007-05-09 2:57¿ÀÈÄ filter_word Ãß°¡(±âÁ¸ÆäÀÌÁö¿¡¼­´Â Á¦°Å)-½ÉÈ﹫ 2007-09-12 filter_word¿¡¼­ "." »ç¿ë°¡´ÉÇϵµ·Ï ó¸® ¿©·¯±ºµ¥¼­ À̸ÞÀÏ Ã¼Å©¸¦ ÇϹǷΠisNotValidEmail()ÇÊ¿ä¾ø¾î¼­ ¹«·ÂÈ­ ÇÔ - ½ÉÈ﹫ 2007-10-16 2:22¿ÀÈÄ setLocalPhoneNo() ÀüÈ­¹øÈ£ ±¹¹ø Ãß°¡ - ±èÀ¯°æ */ //var filter_word = /[$\\@\\\#%\^\&\.\(\)\[\]\+\,\{\}\`\~\=\|]/; //Ư¼ö¹®ÀÚ¸¦ ¹è¿­ var filter_word = /[$\\@\\\#%\^\&\(\)\[\]\+\,\{\}\`\~\=\|]/; //Ư¼ö¹®ÀÚ¸¦ ¹è¿­ //top.jsp¿¡ doInitÀ» callÇϹǷΠ°øÅëó¸® //°¢ ÆäÀÌÁö¿¡¼­ »ç¿ë½Ã »ó°ü ¾ø´Ù. 2006-01-15 function doInit(){ } //ERMS¿¡¼­ È£ÃâÇÏ¿© »ç¿ë function initCategory (form, a){ } function openWinPop(url,winName,intWidth,intHeight) { var winPosLeft = (screen.width - intWidth) / 2; // »õâ X ÁÂÇ¥ var winPosTop = (screen.height - intHeight) / 2 - 10; // »õâ Y ÁÂÇ¥ var winOpt = "width="+intWidth+",height="+intHeight+",top="+winPosTop+",left="+winPosLeft+'location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no'; var win = window.open(url, winName, winOpt); win.focus(); } function openWinPopNoScroll(url,winName,intWidth,intHeight) { var winPosLeft = (screen.width - intWidth) / 2; // »õâ X ÁÂÇ¥ var winPosTop = (screen.height - intHeight) / 2 - 10; // »õâ Y ÁÂÇ¥ var winOpt = "width="+intWidth+",height="+intHeight+",top="+winPosTop+",left="+winPosLeft+'location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'; var win = window.open(url, winName, winOpt); win.focus(); } function bluring(){ if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG"||event.srcElement.tagName=="MAP") document.body.focus(); } document.onfocusin=bluring; function errorWinOpen(param){ openWin("/websales/common/popup/comMsgPop.jsp?"+param,"ErrorWindow",'400','190'); } function onlyNumber(){ var code = window.event.keyCode; if ((code > 34 && code < 41) || (code > 47 && code < 58) || (code > 95 && code < 106) || code == 8 || code == 9 || code == 13 || code == 46){ window.event.returnValue = true; return; } window.event.returnValue = false; } function openZipPop(){ openWin("/websales/common/popup/zipPop.jsp?","ZipWindow",'416','314'); } //¿ìÆí¹øÈ£ function getZipCode(formName,zipcodeseq,zipcode1,zipcode2,address1,address2){ popupWindow = XecureNavigate("/internet/GMZipcodeAction.do?formName="+formName+"&zipcodeseq="+zipcodeseq+"&zipcode1="+zipcode1+"&zipcode2="+zipcode2+"&address1="+address1+"&address2="+address2,"zipwin","scrollbars=no, toolbar=no,location=no,directories=no,resizable=no,mebar=no,left="+window_left+",top="+window_top+",width=420,height=313"); } function openJobPop(){ openWin("/websales/common/popup/jobPop.jsp?","ZipWindow",'456','324'); } function getRadioValue(obj){ var len = obj.length; var radioValue = ""; for(var i =0; i < len; i ++) { if ( obj[i].checked == true ) radioValue = obj[i].value; } return radioValue; } String.prototype.isemail = function() { if (this.search(/^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/) == -1) return false; else { for (var i=0; i < this.length;i++) if (this.charCodeAt(i) > 256) return false; return true; } } function isNotValidEmail(field){ var checkflag = true; var retvalue; if(field.value == "") { retvalue = false; } else { if (window.RegExp) { var tempstring = "a"; var exam = new RegExp(tempstring); if (tempstring.match(exam)) { var ret1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); var ret2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); retvalue = (!ret1.test(field.value) && ret2.test(field.value)); } else { checkflag = false; } } else { checkflag = false; } if (!checkflag) { retvalue = ( (field.value != "") && (field.value.indexOf("@")) > 0 ); } } //2007-09-12 ¿©·¯±ºµ¥¼­ ¸ÞÀÏ Ã¼Å©ÇϹǷΠ¹«·ÂÈ­ÇÔ retvalue=true; if(retvalue) { return false; } else { alert("À̸ÞÀÏ ÁÖ¼Ò¸¦ Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ¼¼¿ä"); return true; } } /* ÄÞº¸¹Ú½ºÀÇ Æ¯Á¤°ªÀÌ ¼±ÅÃµÇ°Ô ÇÑ´Ù. * setSelect(0, '2000', 'selGroupCd') */ function setSelect(pIdx, pVal, pName) { var sel = document.getElementsByName(pName); if(sel.length > pIdx-1) { if( sel[pIdx].type == 'select-one') { sel[pIdx].value = pVal; } } } //Áö¿ª¹øÈ£ SELECT BOX »ý¼º //2007-10-16 ±âŸÃß°¡ function setLocalPhoneNo(tname, name, event, width) { var selectHtml = ""; selectHtml = ""; //alert(name); eval("document.all." + name).innerHTML = selectHtml; //alert(document.all.divLocalPhoneNo.innerHtml); } //Ư¼ö¹®ÀÚüũ function nonkr(charVal) { onvalue = charVal.value; count=0; for (i=0;i= 0) { count++ } } if(count!=0) { alert("ÀԷ½à ¼ýÀÚ, ¿µ¹®, Çѱ۸¸ »ç¿ë °¡´ÉÇÕ´Ï´Ù."); //charVal.value = ""; charVal.focus(); return false; } else { // alert(onvalue + "¸¦ ÀÔ·Â Çß½À´Ï´Ù."); return false; } } //ÇÏÀÌīŬ¸®´Ð ¿¹¾à´ëÇ༭ºñ½º ÆË¾÷¿¡¼­ »ç¿ëµÊ function ChangeMenu2(form){ LinkUrl =form.menu2.options[form.menu2.selectedIndex].value; location.href = LinkUrl; } /** * ³â¿ùÀÏ¿¡ ¿ùÀ» ´õÇÔ - ÀԷ°ªÀÌ ÇØ´ç¿ùÀÇ ¸»ÀÏÀÌ¸é °á°ú°ªµµ ÇØ´ç¿ùÀÇ ¸»ÀÏÀÌ´Ù!!! * @cdate 2004/01/05 * @param String : ³â¿ùÀÏ * @param String : ¿ù * @return String : ³â¿ùÀÏ * @exception * @version 1.0 * @author * * @see * @csrno * @requestby * @csrno.1 * @requestby.1 * @udate.1 * @modifier.1 * @ucont.1 * @csrno.2 * @requestby.2 * @udate.2 * @modifier.2 * @ucont.2 */ function addMonth2(stDate, amount) { var year = Number(stDate.substring(0,4)); var month = Number(stDate.substring(4,6)); var date = Number(stDate.substring(6,8)); var year2 = Number(stDate.substring(0,4)); var month2 = Number(stDate.substring(4,6)); var date2 = Number(stDate.substring(6,8)); var addMonth = 0; addMonth = Number(month) + Number(amount); var addyear = year; for( ; addMonth > 12 ; ) { addMonth -= 12; addyear += 1; } while ( addMonth <= 0 ) { addMonth = 12 + addMonth; addyear = addyear-1; } var leapyear1 = "N"; var leapyear2 = "N"; month = addMonth; if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { leapyear1 = "Y"; } if (((addyear % 4 == 0) && (addyear % 100 != 0)) || (addyear % 400 == 0)) { leapyear2 = "Y"; } if ((leapyear1 == "N") && (leapyear2 == "Y") && (addMonth == 2) && (date == 28)) { date = 29; } if ((leapyear1 == "Y") && (leapyear2 == "N") && (addMonth == 2) && (date == 29)) { date = 28; } var newYear = addyear.toString(); var newMonth = addMonth.toString(); var newDate = date.toString(); // ÀԷ°ªÀÌ ÇØ´ç¿ùÀÇ ¸»ÀÏÀÌ¸é °á°ú°ªµµ ÇØ´ç¿ùÀÇ ¸»ÀÏÀÌ´Ù!!! if ( getLastday( year2, month2 ) == date2 ) { newDate = getLastday( newYear, newMonth ); } if ( getLastday( newYear, newMonth ) < newDate ) { newDate = getLastday( newYear, newMonth ); } if(month < 10){ newMonth = "0" + newMonth; } if(date < 10){ newDate = "0" + newDate; } var retDate = newYear + newMonth + newDate; return retDate; } /* Ò´°ú êÅÀ» ÆÄ¶ó¸ÞÅÍ·Î ³Ñ°ÜÁÖ¸é ÇØ´çµÇ´Â êÅÀÇ ìí¼ö¸¦ ¸®ÅÏ * @cdate 2004/01/05 * @param String : ³â * @param String : ¿ù * @return String : ³¯Â¥¼ö * @exception * @version 1.0 * @author * * @see * @csrno * @requestby * @csrno.1 * @requestby.1 * @udate.1 * @modifier.1 * @ucont.1 * @csrno.2 * @requestby.2 * @udate.2 * @modifier.2 * @ucont.2 */ function getLastday( year, mon ) { if ( mon == 4 || mon==6 || mon==9 || mon==11 ) { intLastDay=30; } else if ( mon==2 && !(year % 4 == 0) ) { intLastDay=28; } else if ( mon==2 && year % 4 == 0 ) { if ( year % 100 == 0 ) { if (year % 400 == 0) intLastDay=29; else intLastDay=28; } else { intLastDay=29; } } else { intLastDay=31; } return intLastDay } /* ³¯Â¥ +- ¿¬»ê ÇÔ¼ö - njw * @cdate 2004/04/26 * @param String : ³â¿ùÀÏ(YYYYMMDD) * @param int : °ª * @return String : °è»ê°á°ú(YYYYMMDD) * @exception * @version 1.0 * @author * @see * @csrno * @requestby * @csrno.1 * @requestby.1 * @udate.1 * @modifier.1 * @ucont.1 * @csrno.2 * @requestby.2 * @udate.2 * @modifier.2 * @ucont.2 */ function addDateNew(fmdt, addNum) { var year = Number(fmdt.substring(0,4)); var month = Number(fmdt.substring(4,6)); var date = Number(fmdt.substring(6,8)); var monarr = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); date = Number(date) + Number(addNum); for( ;; ) { if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)){ monarr[1] = "29"; }else{ monarr[1] = "28"; } if( monarr[month-1] < date ){ date = Number(date) - Number(monarr[month-1]); month++; if( month > 12 ){ month = 1; year++; } }else{ break; } } var newYear = year.toString(); var newMonth = month.toString(); var newDate = date.toString(); //³¯Â¥ »©±â¿¡¼­ 0ÀÏÀÌ ³ª¿À¸é ¿ùÀ» -1Çϰí ÇØ´ç¿ùÀÇ ¸¶Áö¸·³¯ ¼ÂÆÃ if ( date <= 0 ) { newMonth = (parseInt(newMonth,10)-1).toString(); newDate = monarr[newMonth-1]; } if(newMonth < 10){ newMonth = "0" + newMonth; } if(newDate < 10){ newDate = "0" + newDate; } var retDate = newYear + newMonth + newDate; return retDate; } function openWin(url,winName,intWidth,intHeight) { var winPosLeft = (screen.width - intWidth) / 2; // »õâ X ÁÂÇ¥ var winPosTop = (screen.height - intHeight) / 2 - 10; // »õâ Y ÁÂÇ¥ var winOpt = "width="+intWidth+",height="+intHeight+",top="+winPosTop+",left="+winPosLeft+',location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'; var win = window.open(url, winName, winOpt); win.focus(); } function openWin2(url,winName,intWidth,intHeight) { var winPosLeft = (screen.width - intWidth) / 2; // »õâ X ÁÂÇ¥ var winPosTop = (screen.height - intHeight) / 2; // »õâ Y ÁÂÇ¥ var winOpt = "width="+intWidth+",height="+intHeight+",top="+winPosTop+",left="+winPosLeft+',location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no'; var win = window.open(url, winName, winOpt); win.focus(); } function openWin3(url,winName,intWidth,intHeight, isScroll) { var winPosLeft = (screen.width - intWidth) / 2; // »õâ X ÁÂÇ¥ var winPosTop = (screen.height - intHeight) / 2 - 10; // »õâ Y ÁÂÇ¥ var winOpt = "width="+intWidth+",height="+intHeight+",top="+winPosTop+",left="+winPosLeft+',location=no,directories=no,status=no,menubar=no,scrollbars='+ isScroll + ',resizable=no'; var win = window.open(url, winName, winOpt); win.focus(); } function openWin4(url,winName,intWidth,intHeight, isScroll) { var winPosLeft = (screen.width - intWidth) / 2; // »õâ X ÁÂÇ¥ var winPosTop = (screen.height - intHeight) / 2 - 10; // »õâ Y ÁÂÇ¥ var winOpt = "width="+intWidth+",height="+intHeight+",top="+winPosTop+",left="+winPosLeft+',location=yes,directories=yes,status=yes,menubar=yes,scrollbars='+ isScroll + ',resizable=yes'; var win = window.open(url, winName, winOpt); win.focus(); } function openWin5(url,winName,intWidth,intHeight) { var winPosLeft = (screen.width - intWidth) / 2; // »õâ X ÁÂÇ¥ var winPosTop = (screen.height - intHeight) / 2; // »õâ Y ÁÂÇ¥ var winOpt = "width="+intWidth+",height="+intHeight+",top="+winPosTop+",left="+winPosLeft+',location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no'; var win = window.open(url, winName, winOpt); win.focus(); } function show_churi(key,Width,Height) { var div = eval("document.all.layer_" + key); var intWidth = Width; var intHeight = Height; var winPosLeft = (screen.width - intWidth) / 2; // »õâ X ÁÂÇ¥ var winPosTop = (screen.height - intHeight) / 2 - 10; // »õâ Y ÁÂÇ¥ div.style.top = winPosTop; div.style.left = winPosLeft; div.style.display = "block"; } function disable_churi(key) { var div = eval("document.all.layer_" + key); div.style.display = "none"; } /* 10.4 ÀüÈ­¹øÈ£ üũ ·ÎÁ÷ */ function checkPhoneNo3(obj) { var check = true; if ( trim(obj.value) == '' ) { check = false; } else { var phoneNoLen = trim(obj.value).length; var phoneNo = trim(obj.value); if(phoneNoLen == 3){ //ÀüÈ­¹øÈ£ ÀÚ¸´¼ö°¡ 3ÀÚ¸®Àΰæ¿ì switch(phoneNo){ case "111" : check = false ; break; case "222" : check = false ; break; case "333" : check = false ; break; case "444" : check = false ; break; case "555" : check = false ; break; case "666" : check = false ; break; case "777" : check = false ; break; case "888" : check = false ; break; case "999" : check = false ; break; case "000" : check = false ; break; } }else if (phoneNoLen == 4) { //ÀüÈ­¹øÈ£ÀÚ¸´¼ö°¡ 4ÀÚ¸®Àΰæ¿ì switch(phoneNo){ case "1111" : check = false ; break; case "2222" : check = false ; break; case "3333" : check = false ; break; case "4444" : check = false ; break; case "5555" : check = false ; break; case "6666" : check = false ; break; case "7777" : check = false ; break; case "8888" : check = false ; break; case "9999" : check = false ; break; case "0000" : check = false ; break; } } else if ( phoneNoLen < 3 ) { check = false; } } if(!check){ //obj.value = ''; //obj.focus(); alert('ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØÁÖ¼¼¿ä.'); } return check; } /** * µÎ¹øÅ¬¸¯ ¹æÁö * */ function onSleep(obj) { if(obj==null) return; obj.disabled = true; this.obj = obj; setTimeout("offSleep(this.obj)",3000); } function offSleep(obj) { if(obj==null) return; obj.disabled = false; } function isNumber( inputVal ) { oneDecimal = false; inputStr = inputVal.toString() ; for( var i=0; i "9" ) { return false; } } return true; } function isDate( inputVal ) { var inputStr = inputVal.toString(); var arr = inputStr.split(DATE_SEPARATOR); if( arr.length != 3 ) return false ; for( var i=0; i 1) { if( tmonth.charAt(0) == '0') { tmonth = tmonth.charAt(1) ; } } if( tday.length > 1 ){ if( tday.charAt(0) == '0') { tday = tday.charAt(1) ; } } var year = parseInt(arr[0]) ; var month = parseInt(tmonth) ; var day = parseInt(tday) ; if ( year >= 1900 && year < 2100 && checkMonth( month ) && checkDay( year, month, day ) ) return true; else return false; } function getStrLen(str) { if(str==null || str=='') return 0; var strlen=0; for(var i=0; i= '0' && ch <= '9' ){ sCustNo = sCustNo + ch; } } return sCustNo; } function setCustNo( str ){ var sCustNo =""; for ( var i = 0 ; i < str.length ; i++ ){ var ch = str.substring(i,i+1); if ( ch >= '0' && ch <= '9' ){ sCustNo = sCustNo + ch; } } if ( sCustNo.length == 13 ){ sCustNo = sCustNo.substring(0,6)+"-"+sCustNo.substring(6,13); } else if ( sCustNo.length == 10 ){ sCustNo = sCustNo.substring(0,3)+"-"+sCustNo.substring(3,5)+"-"+sCustNo.substring(5,10); } return sCustNo; } //ƯÁ¤³¯Â¥ÀÇ ¿äÀϱ¸Çϱâ //2006-09-07 function CheckDay(obj) { var splitDate = obj.value.split("-"); var checkDate = new Date(splitDate[0],splitDate[1]-1,splitDate[2]); return checkDate.getDay(); } function isDateAlert(obj,strings) { var year_data = ""; var month_data = ""; var date_data = ""; var i; for(i=0;i<8;i++) { var c = strings.charAt(i); if(c < '0' || c > '9'){ //alert('³¯Â¥Çü½Ä¿¡ ¸Â´ÂÁö È®ÀÎÇϼ¼¿ä!'); alert('³¯Â¥¸¦ È®ÀÎÇϼ¼¿ä!'); obj.focus(); obj.select(); return(false); } if (i<4) year_data += c; else if (i >= 4 && i < 6) month_data += c; else if (i >= 6) date_data += c; } var mnthst = month_data; var mnth = parseInt(mnthst,10); var dy = parseInt(date_data,10); if (mnth < 1 || mnth > 12 || dy < 1 || dy > 31) { alert("³¯Â¥°¡ À߸ø ÀԷµǾú½À´Ï´Ù.") obj.focus(); obj.select(); return(false); } if (mnth != 2) { if (mnth == 4 || mnth == 6 || mnth == 9 || mnth == 11) { if (dy > 30) { alert("³¯Â¥°¡ 30ÀÏÀ» ÃʰúÇÒ¼ö°¡ ¾ø½À´Ï´Ù.") obj.focus(); obj.select(); return(false); } } else if (mnth == 1 || mnth == 3 || mnth == 5 || mnth == 7 || mnth == 8 || mnth == 10 || mnth == 12) { if (dy > 31) { alert("³¯Â¥°¡ 31ÀÏÀ» ÃʰúÇÒ¼ö°¡ ¾ø½À´Ï´Ù.") obj.focus(); obj.select(); return(false); } } } else { var yr1 = parseInt(year_data); var leapYrTest = yr1 % 4; var maxdy; if ((yr1%400== 0) || ((yr1%4==0)&&(yr1%100 !=0))) { maxdy = 29 } else { maxdy = 28 } if (dy > maxdy) { alert("³¯Â¥°¡ " + maxdy +"ÀÏÀ» ÃʰúÇÒ¼ö°¡ ¾ø½À´Ï´Ù.") obj.focus(); obj.select(); return(false); } } return(true); } /** * ³â ´õÇϱ⠰øÅë */ function addYear(stDate, amount) { var year = Number(stDate.substring(0,4)); var month = Number(stDate.substring(4,6)); var date = Number(stDate.substring(6,8)); var addyear = 0; addyear = year + amount; leapyear1 = "N"; leapyear2 = "N"; if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { leapyear1 = "Y"; } if (((addyear % 4 == 0) && (addyear % 100 != 0)) || (addyear % 400 == 0)) { leapyear2 = "Y"; } if ((leapyear1 == "N") && (leapyear2 == "Y") && (month == 2) && (date == 28)) { date = 29; } if ((leapyear1 == "Y") && (leapyear2 == "N") && (month == 2) && (date == 29)) { date = 28; } var newYear = addyear.toString(); var newMonth = month.toString(); var newDate = date.toString(); if(month < 10) { newMonth = "0" + newMonth; } if(date < 10) { newDate = "0" + newDate; } var retDate = newYear + newMonth + newDate; return retDate; } function Add_Comma (obj) { var tmp = Reverse (obj.value); var Acc = ""; if (tmp.indexOf(",") > -1) { return; } for (var i = 0; i < tmp.length; i = i + 3) { Acc += tmp.substr (i, 3); if (i + 3 < obj.value.length) Acc += ","; } obj.value = Reverse(Acc); return; } function Del_Comma (obj) { var tmp = obj.value; while (tmp.indexOf(",") > -1) tmp = tmp.replace(",", ""); obj.value = tmp; return; } function Reverse (str) { var ret = ""; for (var i = 0; i < str.length; i++) ret = str.substr (i, 1) + ret; return ret; } function setSepFormat(obj, format){ obj.value = setDateFormat(obj.value, format); } function setDateFormat( str, format ) { if(format=='') format = '.'; var value = str + ""; if (value.length != 8) { return str; } return value.substring( 0, 4) + format + value.substring( 4, 6) + format + value.substring( 6, 8); }