/** * Copyright (c) 2000 by LG-EDS Systems Inc * All rights reserved. * * ÀÚ¹Ù½ºÅ©¸³Æ® °øÅëÇÔ¼ö * * ÁÖÀÇ: ¾Æ·¡ÀÇ ¸ðµç ¸Þ¼Òµå´Â ÀÔ·ÂÆûÀÇ ÇʵåÀ̸§(myform.myfield)À» * ÆÄ¶ó¹ÌÅÍ·Î ¹Þ´Â´Ù. ÇʵåÀÇ °ª(myform.myfield.value)ÀÌ ¾Æ´ÔÀ» * À¯³äÇÒ °Í. */ //var contextPath = "/neo-ebiz"; var contextPath = ""; var n4 = (document.layers)?true:false; var e4 = (document.all)?true:false; var layer = (e4)?document.all:document.layers; /** * ÀԷ°ªÀÌ NULLÀÎÁö üũ */ function isNull(input) { if (input.value == null || input.value == "") { return true; } return false; } function ErrorMsg(obj,msg){ alert(msg); obj.select(); obj.focus(); } /** * ÀԷ°ª¿¡ ½ºÆäÀ̽º ÀÌ¿ÜÀÇ ÀǹÌÀÖ´Â °ªÀÌ ÀÖ´ÂÁö üũ */ function isEmpty(input) { if (input.value == null || input.value.replace(/ /gi,"") == "") { return true; } return false; } /** * ÀԷ°ª¿¡ ƯÁ¤ ¹®ÀÚ(chars)°¡ ÀÖ´ÂÁö üũ * ƯÁ¤ ¹®ÀÚ¸¦ Çã¿ëÇÏÁö ¾ÊÀ¸·Á ÇÒ ¶§ »ç¿ë * ex) if (containsChars(form.name,"!,*&^%$#@~;")) { * alert("À̸§ Çʵ忡´Â Ư¼ö ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù."); * } */ function containsChars(input,chars) { for (var inx = 0; inx < input.value.length; inx++) { if (chars.indexOf(input.value.charAt(inx)) != -1) return true; } return false; } /** * ÀԷ°ªÀÌ Æ¯Á¤ ¹®ÀÚ(chars)¸¸À¸·Î µÇ¾îÀÖ´ÂÁö üũ (String°ªÀ» üũÇÑ´Ù.) * ƯÁ¤ ¹®ÀÚ¸¸ Çã¿ëÇÏ·Á ÇÒ ¶§ »ç¿ë * ex) if (!containsCharsOnly(form.blood.value ,"ABO")) { * alert("Ç÷¾×Çü Çʵ忡´Â A,B,O ¹®ÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù."); * } */ function containsCharsOnly(inputValue,chars) { for (var inx = 0; inx < inputValue.length; inx++) { if (chars.indexOf(inputValue.charAt(inx)) == -1) return false; } return true; } function containsCharsOnlyValue(inputValue,chars) { for (var inx = 0; inx < inputValue.length; inx++) { if (chars.indexOf(inputValue.charAt(inx)) == -1) return false; } return true; } /** * ÀԷ°ªÀÌ ¾ËÆÄºªÀÎÁö üũ * ¾Æ·¡ isAlphabet() ºÎÅÍ isNumComma()±îÁöÀÇ ¸Þ¼Òµå°¡ * ÀÚÁÖ ¾²ÀÌ´Â °æ¿ì¿¡´Â var chars º¯¼ö¸¦ * global º¯¼ö·Î ¼±¾ðÇÏ°í »ç¿ëÇϵµ·Ï ÇÑ´Ù. * ex) var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; * var lowercase = "abcdefghijklmnopqrstuvwxyz"; * var number = "0123456789"; * function isAlphaNum(input) { * var chars = uppercase + lowercase + number; * return containsCharsOnly(input,chars); * } */ function isAlphabet(input) { var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; return containsCharsOnly(input,chars); } /** * ÀԷ°ªÀÌ ¾ËÆÄºª ´ë¹®ÀÚÀÎÁö üũ */ function isUpperCase(input) { var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; return containsCharsOnly(input,chars); } /** * ÀԷ°ªÀÌ ¾ËÆÄºª ¼Ò¹®ÀÚÀÎÁö üũ */ function isLowerCase(input) { var chars = "abcdefghijklmnopqrstuvwxyz"; return containsCharsOnly(input,chars); } /** * ÀԷ°ª¿¡ ¼ýÀÚ¸¸ ÀÖ´ÂÁö üũ */ function isNumber(input) { var chars = "0123456789"; return containsCharsOnly(input,chars); } /** * ÀԷ°ªÀÌ ¾ËÆÄºª,¼ýÀÚ·Î µÇ¾îÀÖ´ÂÁö üũ */ function isAlphaNum(input) { var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; return containsCharsOnly(input,chars); } /** * ÀԷ°ªÀÌ ¼ýÀÚ,´ë½Ã(-)·Î µÇ¾îÀÖ´ÂÁö üũ */ function isNumDash(input) { var chars = "-0123456789"; return containsCharsOnly(input,chars); } /** * ÀԷ°ªÀÌ ¼ýÀÚ,´ë½Ã(-),Á¡À¸·Î µÇ¾îÀÖ´ÂÁö üũ * Á¡¼ö °è»ê½Ã »ç¿ë */ function isPoint(input) { var chars = "-0123456789."; return containsCharsOnly(input,chars); } /** * ÀԷ°ªÀÌ ¼ýÀÚ,,Á¡À¸·Î µÇ¾îÀÖ´ÂÁö üũ * Á¡¼ö °è»ê½Ã »ç¿ë */ function isyega(input) { var chars = "0123456789."; return containsCharsOnly(input,chars); } /** * ÀԷ°ªÀÌ ¼ýÀÚ,ÄÞ¸¶(,)·Î µÇ¾îÀÖ´ÂÁö üũ */ function isNumComma(input) { var chars = ",0123456789"; return containsCharsOnly(input,chars); } /** * ÀԷ°ª¿¡¼­ ÄÞ¸¶¸¦ ¾ø¾Ø´Ù. */ function removeComma(input) { return input.value.replace(/,/gi,""); } /** * ÀԷ°ªÀÌ »ç¿ëÀÚ°¡ Á¤ÀÇÇÑ Æ÷¸Ë Çü½ÄÀÎÁö üũ * ÀÚ¼¼ÇÑ format Çü½ÄÀº ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ 'regular expression'À» ÂüÁ¶ */ function isValidFormat(input,format) { if (input.value.search(format) != -1) { return true; //¿Ã¹Ù¸¥ Æ÷¸Ë Çü½Ä } return false; } /** * ÀԷ°ªÀÌ À̸ÞÀÏ Çü½ÄÀÎÁö üũ */ function isValidEmail(input) { // var format = /^(\S+)@(\S+)\.([A-Za-z]+)$/; var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/; return isValidFormat(input,format); } /** * ÀԷ°ªÀÌ ÀüÈ­¹øÈ£ Çü½Ä(¼ýÀÚ-¼ýÀÚ-¼ýÀÚ)ÀÎÁö üũ */ function isValidPhone(input) { var format = /^(\d+)-(\d+)-(\d+)$/; return isValidFormat(input,format); } /** * ¼±ÅÃµÈ ¶óµð¿À¹öưÀÌ ÀÖ´ÂÁö üũ */ function hasCheckedRadio(input) { if (input.length > 1) { for (var inx = 0; inx < input.length; inx++) { if (input[inx].checked) return true; } } else { if (input.checked) return true; } return false; } /** * ¼±ÅÃµÈ Ã¼Å©¹Ú½º°¡ ÀÖ´ÂÁö üũ */ function hasCheckedBox(input) { return hasCheckedRadio(input); } /** * ÀԷ°ªÀÇ ¹ÙÀÌÆ® ±æÀ̸¦ ¸®ÅÏ * Author : Wonyoung Lee */ 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; } /** * À¯È¿ÇÑ(Á¸ÀçÇÏ´Â) ¿ù(êÅ)ÀÎÁö üũ */ function isValidMonth(mm) { var m = parseInt(mm,10); return (m >= 1 && m <= 12); } function isValidDay_1(dd) { var m = parseInt(dd,10); return (dd >= 1 && dd <= 31); } /** * À¯È¿ÇÑ(Á¸ÀçÇÏ´Â) ÀÏ(ìí)ÀÎÁö üũ */ function isValidDay(yyyy, mm, dd) { var m = parseInt(mm,10) - 1; var d = parseInt(dd,10); var end = new Array(31,28,31,30,31,30,31,31,30,31,30,31); if ((yyyy % 4 == 0 && yyyy % 100 != 0) || yyyy % 400 == 0) { end[1] = 29; } return (d >= 1 && d <= end[m]); } /** * À¯È¿ÇÑ(Á¸ÀçÇÏ´Â) ½Ã(ãÁ)ÀÎÁö üũ */ function isValidHour(hh) { var h = parseInt(hh,10); return (h >= 1 && h <= 24); } /** * À¯È¿ÇÑ(Á¸ÀçÇÏ´Â) ºÐ(ÝÂ)ÀÎÁö üũ */ function isValidMin(mi) { var m = parseInt(mi,10); return (m >= 0 && m < 60); } /** * Time Çü½ÄÀÎÁö üũ(´À½¼ÇÑ Ã¼Å©) */ function isValidTimeFormat(time) { return (!isNaN(time) && time.length == 12); } /** * À¯È¿ÇÏ´Â(Á¸ÀçÇÏ´Â) Time ÀÎÁö üũ * ex) var time = form.time.value; //'200102310000' * if (!isValidTime(time)) { * alert("¿Ã¹Ù¸¥ ³¯Â¥°¡ ¾Æ´Õ´Ï´Ù."); * } */ function isValidTime(time) { var year = time.substring(0,4); var month = time.substring(4,6); var day = time.substring(6,8); var hour = time.substring(8,10); var min = time.substring(10,12); if (parseInt(year,10) >= 1900 && isValidMonth(month) && isValidDay(year,month,day) && isValidHour(hour) && isValidMin(min)) { return true; } return false; } /** * Time ½ºÆ®¸µÀ» ÀÚ¹Ù½ºÅ©¸³Æ® Date °´Ã¼·Î º¯È¯ * parameter time: Time Çü½ÄÀÇ String */ function toTimeObject(time) { //parseTime(time) var year = time.substr(0,4); var month = time.substr(4,2) - 1; // 1¿ù=0,12¿ù=11 var day = time.substr(6,2); var hour = time.substr(8,2); var min = time.substr(10,2); return new Date(year,month,day,hour,min); } /** * ÀÚ¹Ù½ºÅ©¸³Æ® Date °´Ã¼¸¦ Time ½ºÆ®¸µÀ¸·Î º¯È¯ * parameter date: JavaScript Date Object */ function toTimeString(date) { //formatTime(date) var year = date.getFullYear(); var month = date.getMonth() + 1; // 1¿ù=0,12¿ù=11À̹ǷΠ1 ´õÇÔ var day = date.getDate(); var hour = date.getHours(); var min = date.getMinutes(); if (("" + month).length == 1) { month = "0" + month; } if (("" + day).length == 1) { day = "0" + day; } if (("" + hour).length == 1) { hour = "0" + hour; } if (("" + min).length == 1) { min = "0" + min; } return ("" + year + month + day + hour + min) } /** * TimeÀÌ ÇöÀç½Ã°¢ ÀÌÈÄ(¹Ì·¡)ÀÎÁö üũ */ function isFutureTime(time) { return (toTimeObject(time) > new Date()); } /** * TimeÀÌ ÇöÀç½Ã°¢ ÀÌÀü(°ú°Å)ÀÎÁö üũ */ function isPastTime(time) { return (toTimeObject(time) < new Date()); } /** * ÁÖ¾îÁø Time °ú y³â m¿ù dÀÏ h½Ã Â÷À̳ª´Â TimeÀ» ¸®ÅÏ * ex) var time = form.time.value; //'20000101000' * alert(shiftTime(time,0,0,-100,0)); * => 2000/01/01 00:00 À¸·ÎºÎÅÍ 100ÀÏ Àü Time */ function shiftTime(time,y,m,d,h) { //moveTime(time,y,m,d,h) var date = toTimeObject(time); date.setFullYear(date.getFullYear() + y); //y³âÀ» ´õÇÔ date.setMonth(date.getMonth() + m); //m¿ùÀ» ´õÇÔ date.setDate(date.getDate() + d); //dÀÏÀ» ´õÇÔ date.setHours(date.getHours() + h); //h½Ã¸¦ ´õÇÔ return toTimeString(date); } /** * ÇöÀ糯¥¿Í m¿ù dÀÏ Â÷À̳ª´Â Date¸¦ ¸®ÅÏ * ex) alert(shiftDate(document,0,-7,'yes')); // ÇöÀ糯¥ 20021002 * => 2002-09-25,2002-10-01 * alert(shiftDate(document,-1,1)); // ÇöÀ糯¥ 20021002 * => 2002-09-03,2002-10-02 */ function shiftDate(doc,m,d,before) { //moveTime(doc,m,d) var date = new Date(); var today = new Date(); var year1, month1, day1; var year2, month2, day2; date.setMonth(date.getMonth() + m); //m¿ùÀ» ´õÇÔ date.setDate(date.getDate() + d); //dÀÏÀ» ´õÇÔ if ( before == "yes") { today.setDate(today.getDate() - 1); } year1 = date.getYear() + "-"; month1 = (date.getMonth() + 1) + "-"; if ( month1.length != 3 ) month1 = "0" + month1; day1 = date.getDate() + ""; if ( day1.length != 2 ) day1 = "0" + day1; year2 = today.getYear() + "-"; month2 = (today.getMonth() + 1) + "-"; if ( month2.length != 3 ) month2 = "0" + month2; day2 = today.getDate() + ""; if ( day2.length != 2 ) day2 = "0" + day2; if(doc!=condition){ doc.date3.value = year1 + month1 + day1; doc.date4.value = year2 + month2 + day2; }else{ doc.date1.value = year1 + month1 + day1; doc.date2.value = year2 + month2 + day2; } } /** * µÎ TimeÀÌ ¸î °³¿ù Â÷À̳ª´ÂÁö ±¸ÇÔ * time1ÀÌ time2º¸´Ù Å©¸é(¹Ì·¡¸é) minus(-) */ function getMonthInterval(time1,time2) { //measureMonthInterval(time1,time2) var date1 = toTimeObject(time1); var date2 = toTimeObject(time2); var years = date2.getFullYear() - date1.getFullYear(); var months = date2.getMonth() - date1.getMonth(); var days = date2.getDate() - date1.getDate(); return (years * 12 + months + (days >= 0 ? 0 : -1) ); } /** * µÎ TimeÀÌ ¸çÄ¥ Â÷À̳ª´ÂÁö ±¸ÇÔ * time1ÀÌ time2º¸´Ù Å©¸é(¹Ì·¡¸é) minus(-) */ function getDayInterval(time1,time2) { var date1 = toTimeObject(time1); var date2 = toTimeObject(time2); var day = 1000 * 3600 * 24; //24½Ã°£ return parseInt((date2 - date1) / day, 10); } /** * µÎ TimeÀÌ ¸î ½Ã°£ Â÷À̳ª´ÂÁö ±¸ÇÔ * time1ÀÌ time2º¸´Ù Å©¸é(¹Ì·¡¸é) minus(-) */ function getHourInterval(time1,time2) { var date1 = toTimeObject(time1); var date2 = toTimeObject(time2); var hour = 1000 * 3600; //1½Ã°£ return parseInt((date2 - date1) / hour, 10); } /** * ÇöÀç ½Ã°¢À» Time Çü½ÄÀ¸·Î ¸®ÅÏ */ function getCurrentTime() { return toTimeString(new Date()); } /** * ÇöÀç ½Ã°¢°ú y³â m¿ù dÀÏ h½Ã Â÷À̳ª´Â TimeÀ» ¸®ÅÏ */ function getRelativeTime(y,m,d,h) { /* var date = new Date(); date.setFullYear(date.getFullYear() + y); //y³âÀ» ´õÇÔ date.setMonth(date.getMonth() + m); //m¿ùÀ» ´õÇÔ date.setDate(date.getDate() + d); //dÀÏÀ» ´õÇÔ date.setHours(date.getHours() + h); //h½Ã¸¦ ´õÇÔ return toTimeString(date); */ return shiftTime(getCurrentTime(),y,m,d,h); } /** * ÇöÀç Ò´À» YYYYÇü½ÄÀ¸·Î ¸®ÅÏ */ function getYear() { /* var now = new Date(); return now.getFullYear(); */ return getCurrentTime().substr(0,4); } /** * ÇöÀç êÅÀ» MMÇü½ÄÀ¸·Î ¸®ÅÏ */ function getMonth() { /* var now = new Date(); var month = now.getMonth() + 1; // 1¿ù=0,12¿ù=11À̹ǷΠ1 ´õÇÔ if (("" + month).length == 1) { month = "0" + month; } return month; */ return getCurrentTime().substr(4,2); } /** * ÇöÀç ìíÀ» DDÇü½ÄÀ¸·Î ¸®ÅÏ */ function getDay() { /* var now = new Date(); var day = now.getDate(); if (("" + day).length == 1) { day = "0" + day; } return day; */ return getCurrentTime().substr(6,2); } /** * ÇöÀç ãÁ¸¦ HHÇü½ÄÀ¸·Î ¸®ÅÏ */ function getHour() { /* var now = new Date(); var hour = now.getHours(); if (("" + hour).length == 1) { hour = "0" + hour; } return hour; */ return getCurrentTime().substr(8,2); } /** * ¿À´ÃÀÌ ¹«½¼ ¿äÀÏÀ̾ß? * ex) alert('¿À´ÃÀº ' + getDayOfWeek() + '¿äÀÏÀÔ´Ï´Ù.'); * ƯÁ¤ ³¯Â¥ÀÇ ¿äÀÏÀ» ±¸ÇÏ·Á¸é? => ¿©·¯ºÐÀÌ Á÷Á¢ ¸¸µé¾î º¸¼¼¿ä. */ function getDayOfWeek() { var now = new Date(); var day = now.getDay(); //ÀÏ¿äÀÏ=0,¿ù¿äÀÏ=1,...,Åä¿äÀÏ=6 var week = new Array('ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä'); return week[day]; } /* ¾Æ¶óºñ¾Æ¼ýÀÚÀÇ ±Ý¾×À» Çѱ۷Πº¯È­½ÃÄÑÁØ´Ù.*/ function changeMoney(input) { var index=0; var i=0; var result=""; var newResult=""; var money = commaDel(input); su = new Array("0","1","2","3","4","5","6","7","8","9"); km = new Array("¿µ","ÀÏ","ÀÌ","»ï","»ç","¿À","À°","Ä¥","ÆÈ","±¸"); danwi = new Array("","½Ê","¹é","õ","¸¸","½Ê","¹é","õ","¾ï","½Ê","¹é","õ","Á¶"); for(j=1;j<=money.length;j++) { for(index=0;index<10;index++) { money = money.replace(su[index],km[index]); } } for(index = money.length;index>0;index=index-1) { result = money.substring(index-1,index); if(result=="¿µ"){ if(i<4 || i>8){ result = ""; } else if(i>=4 && i<8 && newResult.indexOf("¸¸")<0){ result = "¸¸"; } else if(i>=8 && i<12 && newResult.indexOf("¾ï")<0){ result = "¾ï"; } } else { result = result + danwi[i]; //alert("result="+result); } i++; newResult = result + newResult; //alert("newResult="+newResult); } for(j=1;j0;index=index-1) { result = money.substring(index-1,index); if(result=="¿µ"){ if(i<4 || i>8){ result = ""; } else if(i>=4 && i<8 && newResult.indexOf("¸¸")<0){ result = "¸¸"; } else if(i>=8 && i<12 && newResult.indexOf("¾ï")<0){ result = "¾ï"; } } else { result = result + danwi[i]; //alert("result="+result); } i++; newResult = result + newResult; //alert("newResult="+newResult); } for(j=1;j 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; } } /*Äĸ¶·Î Ç¥½ÃµÈ ±Ý¾×À» Äĸ¶¸¦ Á¦°ÅÇØ ÁÝ´Ï´Ù.*/ function commaDel(input) { var num = input.value; var len=num.length; var i; var buffer=""; for(i=0;i 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; } } //=======»ç¾÷ÀÚµî·Ï¹øÈ£ Check========== function checkBizNo(obj){ var BizNo=trim(obj.value); bizValue=0; comStr="13713713"; bizValue=0; for( i=0; i < 8 ; i++){ bizValue=bizValue + ( parseFloat(BizNo.substring(i,i+1)) * parseFloat(comStr.substring(i,i+1))) % 10; } tempCom= parseFloat(BizNo.substring(8,9)) * 5 + "0"; checkValue=parseFloat(tempCom.substring(0,1)) +parseFloat(tempCom.substring(1,2)); checkDigit=( 10 - (bizValue + checkValue ) % 10 ) %10 ; if( BizNo.substring(9,10) != checkDigit){ return false; }else{ return true; } } //========input °ªÀÌ ¸ðµÎ ¼ýÀÚÀÎÁö check=========== function isDigit(obj){ if(isNull(obj)){ return false; }else{ var checkString="0123456789"; return checkContains(obj,checkString); } } //=========ÀÔ·ÂµÈ °ªÀÇ ¾çÂÊ °ø¹é¾ø¾Ö±â========================= function trim(inputValue){ //leading space while(''+inputValue.charAt(0)==' '){ inputValue = inputValue.substring(1,inputValue.length) } //trailing space while(''+inputValue.charAt(inputValue.length-1)==' '){ inputValue = inputValue.substring(0,inputValue.length-1); } return inputValue; } //============inputÀÇ °ªÀÌ checkString¿¡ Æ÷ÇÔµÈ charÀÎÁö üũ=================== function checkContains(obj, checkString){ var inputValue=trim(obj.value); for(var index=0; index < inputValue.length; index++){ if(checkString.indexOf(inputValue.charAt(index))== -1 ){//-1:ã´Â ¹®ÀÚ¿­ÀÌ ¾ø´Â°æ¿ì return false; } } return true; } //=====Áֹεî·Ï¹øÈ£°¡ ÇüÅ check ( 761111 - 1213456ó·³ ÅØ½ºÆ®Çʵ尡 2°³·Î µé¾î¿Ã¶§ ) )====== function checkResidentNo2(objNo1, objNo2){ //¾ÕÀÚ¸® üũ if( isNull(objNo1)){ ErrorMsg(objNo1,"Áֹεî·Ï¹øÈ£ ¾Õ 6ÀÚ¸®¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇϽʽÿä."); return; } var No1=trim(objNo1.value); //Áֹεî·Ï ¾ÕÀÚ¸® if( !isDigit(objNo1) || (No1.length != 6 )){ ErrorMsg(objNo1,"Áֹεî·Ï¹øÈ£ ¾Õ 6ÀÚ¸®¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇϽʽÿä."); return; } //µÞÀÚ¸® üũ if( isNull(objNo2)){ ErrorMsg(objNo2,"Áֹεî·Ï¹øÈ£ µÞ 7ÀÚ¸®¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇϽʽÿä."); return; } var No2=trim(objNo2.value); //Áֹεî·Ï µÞÀÚ¸® if( !isDigit(objNo2) || (No2.length != 7 )){ ErrorMsg(objNo2,"Áֹεî·Ï¹øÈ£ µÞ 7ÀÚ¸®¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇϽʽÿä."); return; } //¼ºº°±¸º°ÇÏ´ÂÀÚ¸®´Â 1,2,3,4¿©¾ßÇÑ´Ù. var check= No2.charAt(0); if(check != '1' && check !='2' && check !='3' && check !='4'){ ErrorMsg(objNo2,"Áֹεî·Ï¹øÈ£ µÞ 7ÀÚ¸®¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇϽʽÿä."); return; } //Àüü Áֹεî·Ï¹øÈ£°¡ validÇÑÁö check if(!validResident(''+No1+No2)){ ErrorMsg(objNo1,"ÁֹιøÈ£¸¦ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. \n\n ¿Ã¹Ù¸¥ ¹øÈ£¸¦ ÀÔ·ÂÇϽʽÿä."); return; } return true; } //=======Áֹεî·Ï¹øÈ£°¡ valid ÇÑÁö check=========== function validResident(no){ no=trim(no); var year = no.substring(0,2); var month = no.substring(2,4); var day = no.substring(4,6); var sex = no.substring(6,7); var result=false; if(sex=="1" || sex=="2"){ year="19"+year; }else if(sex=="3" || sex=="4"){ year="20"+year; } if( isValidMonth( month ) && isValidDay(year, month, day )){ //Àüü Áֹεî·Ï¹øÈ£ valid Check var check=0; var frontNo=no.substring(0,6); var rearNo=no.substring(6,13); for(var i=0 ; i<=5 ; i++){ check = check + (( i % 8 + 2 )* parseInt(frontNo.substring(i,i+1))); } for(var i=6 ; i<=11 ; i++){ check = check + (( i % 8 + 2 )* parseInt(rearNo.substring(i-6,i-5))); } check = 11 - (check % 11); check = check % 10; if(check == parseInt(no.substring(12,13))){ result=true; } } return result; } //»óǰ¸í À§Ä¡. var fieldLocation; var fieldLocation2; var fieldLocation3; var fieldLocation4; var fieldLocation5; /** *
 * Scroll ÀÌ ¾ø´Â »õ âÀ» ¶ç¿î´Ù
 * 
* @param theURL : »õ·Î ¶ç¿ï ÆÄÀÏ À̸§ÀÌ´Ù * @param winName : »õâ À̸§ * @param winTitle : »õâ title * @param width : »õâ °¡·Î Å©±â * @param height : »õâ ¼¼·Î Å©±â * @param param : Ãß°¡ÀûÀÎ È­¸é argument */ var splashWin; function openScrollWin(contentType, contentString, _width, _height, left, top, param) { clearPopUp() //var win = window.open(theURL + "?popupTitle=" + winTitle + "&tableWidth=" + _width + "&" + param, winName, "menubar=no, scrollbars=yes, resizable=no, width="+_width+", height="+_height) ; var w = window.screen.width; var h = window.screen.height; var l = (left != null) ? left : (w-_width)/2; var t = (top != null) ? top : (h-_height)/2; var uri = (contentType.toLowerCase() == "uri") ? contentString : ""; splashWin = window.open(uri + "?" + param, '', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+_width+',height='+_height ); // Ç® ½ºÅ©¸°À» ÁöÁ¤(0=ÇØÁ¦ 1=ÁöÁ¤)ÇÏ´Â ºÎºÐÀÌ´Ù. ¿©±â¼­ Ç® ½ºÅ©¸°À» ÇØÁ¦ÇÏ¸é º¸ÅëÀÇ ÆË¾÷ À©µµ¿ì¿Í °°´Ù. // splashWin.blur(); // window.focus(); // splashWin.resizeTo(_width,_height); splashWin.moveTo(l, t); // splashWin.focus(); } //»óǰ¼±Åà Popup function popUpProduct(code_field, name_field, gage_field) { fieldLocation = code_field; fieldLocation2 = name_field; fieldLocation3 = gage_field; param = "productCode=" + fieldLocation.value + "&productName=" + fieldLocation2.value; //openScrollWin("/mega_mart/jsp/popup/pp_cr002.jsp", "ItemInfo", "»óǰ¼±ÅÃ", "700", "700", param) openScrollWin("uri", contextPath + "/popup/pp_cr002.jsp",500,370,null,null, param) } //»óǰ °Ë»ö °á°ú ¼ÂÆÃ function setProduct(product_code, product_name, product_gage) { // alert(product_code+"/"+ product_name); // document.frmSRCH.formtext1.value = item_name; // if (fieldLocation != null) fieldLocation.value = product_code; // if (fieldLocation2 != null) fieldLocation2.value = product_name; fieldLocation3.value = product_gage; fieldLocation = null; fieldLocation2 = null; fieldLocation3 = null; } //»óǰ»ó¼¼ PopUp function popUpProductDetail(product_id) { param = "product_id=" + product_id; openScrollWin("uri",contextPath + "/popup/pp_cr003.jsp",600,580,null,null, param) } //ÆÇ¸ÅÁ¡¼±Åà Popup function popUpStore(code_field,name_field, places) { fieldLocation = code_field; fieldLocation2 = name_field; param = "places=" + places; openScrollWin("uri","/popup/pp_cr004.jsp",300,298,null,null, param) } //ÆÇ¸ÅÁ¡ multi¼±Åà Popup function popUpStoreMulti(code_field,name_field, places) { fieldLocation = code_field; fieldLocation2 = name_field; param = "places=" + places; //openScrollWin("uri",contextPath + "/neo-ebiz/popup/pp_cr004.jsp",300,298,null,null, param) openScrollWin("uri","/popup/multi_pp_cr004.jsp",350,320,null,null, param) } //ÁÖ¼Òmulti¼±Åà Popup- ÀÔ·ÂÈ­¸é function popUpStore2Multi(code_field, name_field, address_field, places) { fieldLocation = code_field; fieldLocation2 = name_field; fieldLocation3 = address_field; param = "places=" + places; openScrollWin("uri","/popup/multi_pp_contract.jsp",530,298,null,null, param) } //ÁÖ¼Òmulti¼±Åà Popup- Á¶È¸È­¸é function popUpStore2Multi2(code_add,location, pyoung, identify) { fieldLocation = code_add; fieldLocation2 = location; fieldLocation3 = pyoung; param = "places=" + places; openScrollWin("uri",contextPath + "/popup/multi_pp_contract.jsp?identify=default",530,298,null,null, param) } function popUpStore2(code_field, name_field, address_field, places) { fieldLocation = code_field; fieldLocation2 = name_field; fieldLocation3 = address_field; param = "places=" + places; openScrollWin("uri",contextPath + "/popup/pp_contract.jsp",480,298,null,null, param) } //°Å·¡Ã³¼±Åà Popup function popUpVendor(code_field,name_field, taxNo_field) { fieldLocation = code_field; fieldLocation2 = name_field; fieldLocation3 = taxNo_field; param = "vendor_id=" + code_field.value; //openScrollWin("/mega_mart/jsp/popup/pp_cr004.jsp", "ItemInfo", "»óǰ¼±ÅÃ", "700", "700", param) openScrollWin("uri",contextPath + "/popup/pp_cr006.jsp",431,369,null,null, param) } function popUpVendor1(code_field,name_field, taxNo_field, post_field,address_field) { fieldLocation = code_field; fieldLocation2 = name_field; fieldLocation3 = taxNo_field; fieldLocation4 = post_field; fieldLocation5 = address_field; param = "vendor_id=" + code_field.value; //openScrollWin("/mega_mart/jsp/popup/pp_cr004.jsp", "ItemInfo", "»óǰ¼±ÅÃ", "700", "700", param) openScrollWin("uri",contextPath + "/popup/pp_cr0061.jsp",431,369,null,null, param) } //ÆÇ¸ÅÁ¡ °Ë»ö °á°ú ¼ÂÆÃ function setStore(store_code, store_name, store_taxNo) { // document.frmSRCH.formtext1.value = item_name; // if (fieldLocation != null) fieldLocation.value = store_code; // if (fieldLocation2 != null) fieldLocation2.value = store_name; if (fieldLocation3 != null) fieldLocation3.value = store_taxNo; eval(fieldLocation); eval(fieldLocation2); fieldLocation = null; fieldLocation2 = null; fieldLocation3 = null; } function setStore_new(store_code, store_name, address) { // document.frmSRCH.formtext1.value = item_name; // if (fieldLocation != null) fieldLocation.value = store_code; // if (fieldLocation2 != null) fieldLocation2.value = store_name; if (fieldLocation3 != null) fieldLocation3.value = address; eval(fieldLocation); eval(fieldLocation2); fieldLocation = null; fieldLocation2 = null; fieldLocation3 = null; } //ÆÇ¸ÅÁ¡ °Ë»ö °á°ú ¼ÂÆÃ function setStore1(store_code, store_name, store_taxNo, postid, address) { fieldLocation.value = store_code; fieldLocation2.value = store_name; if (fieldLocation3 != null) fieldLocation3.value = store_taxNo; eval(fieldLocation); eval(fieldLocation2); if (fieldLocation4 != null) fieldLocation4.value = postid; eval(fieldLocation); eval(fieldLocation2); if (fieldLocation5 != null) fieldLocation5.value = address; eval(fieldLocation); eval(fieldLocation2); fieldLocation = null; fieldLocation2 = null; fieldLocation3 = null; fieldLocation4 = null; fieldLocation5 = null; } //PopUpâ¿¡ focusÁÖ±â. function setFocusPopUP() { if(splashWin != null){ splashWin.focus(); } } function setPopUpNull() { // window.focus(); if(splashWin != null){ // splashWin.setNullOpener(); // splashWin.close(); splashWin=null; } } function clearPopUp() { if(splashWin != null){ splashWin.close(); splashWin=null; } } var IE = document.all ? true:false; function IE_Ver(){ if(navigator.appName.match(/Explorer/i)) { return navigator.appVersion.match(/MSIE \d+.\d+/)[0].split(" ")[1]; } else return 0; } //¸¶¿ì½º ¸ð¾ç º¯°æ. function inProcess() { //alert("¿ÓÀ½"); if(IE && IE_Ver()>=5.5) { // IEÀÇ ºê¶ó¿ìÀú¸¦ Àû´Â ºÎºÐ // IE ¹öÁ¯ÀÌ 5.5 ÀÌ»óÀ϶§ document.body.style.cursor="wait" ; }else{ // IE ¹öÁ¯ÀÌ 5.5 ÀÌÇÏ È¤Àº NS°°Àº ´Ù¸¥ ºê¶ó¿ìÀúÀ϶§ // ÀÚµ¿À¸·Î ¸ð·¡½Ã°è¸¦ ³ªÅ¸³¿. } } function outProcess() { document.body.style.cursor = "default"; } //¸ÞÀÏ ÆË¾÷ function mailPopup(mail_field,mailList_field) { fieldLocation = mail_field; fieldLocation2 = mailList_field; openScrollWin("uri",contextPath + "/popup/pp_ar001.jsp",300,385,null,null,"") } //À̸ÞÀÏ ¼ö½Å function setEmail(name,mailList){ fieldLocation.value = name; fieldLocation2.value = mailList; eval(fieldLocation); eval(fieldLocation2); fieldLocation = null; fieldLocation2 = null; } //url redirection function goTarget(url, target) { if (typeof target == 'undefined') window.location.href = url; else if (target == '_blank') window.open(url); else target.window.location.href = url; } //confirm box open, after url redirection function confirmGoTarget(url, msg, target) { if (!confirm(msg)) return; goTarget; } //message box open, after url redirection function msgGoTarget(url, msg, target) { alert(msg); goTarget; } //¿ìÆí¹øÈ£ °Ë»ö ÆË¾÷¿¡¼­ »ç¿ë µÇ´Â ½ºÅ©¸³Æ® function openAddrSearch(url) { var height = 280; var width = 480; var title = 30; var winx = (screen.availWidth - width) / 2; var winy = (screen.availHeight - height - title) / 2; if (winx < 0) winx = 0; if (winy < 0) winy = 0; var wStyle = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes ,resizable=0, width=" + width + ", height=" + height + ", top=" + winy + ", left=" + winx; email = window.open(url,"searchadd", wStyle); } //ÆË¾÷ ¿ÀÇ ½ºÅ©¸³Æ® function openPopup(url, title, vwidth, vheight) { var height = vheight; var width = vwidth; var _title = 30; var winx = (screen.availWidth - width) / 2; var winy = (screen.availHeight - height - _title) / 2; if (winx < 0) winx = 0; if (winy < 0) winy = 0; var wStyle = "scrollbars=1,resizable=0, status=0, copyhistory=no, width=" + width + ", height=" + height + ", top=" + winy + ", left=" + winx; window.open(url, title, wStyle); } var window_width = 450; // À©µµ¿ìÀÇ °¡·Î var window_height = 500; // À©µµ¿ìÀÇ ³ôÀÌ var h = 200; function resizeself(){ firstrun(); } function firstrun(){ self.focus(); if(h < window_height) { h = h + 5; setTimeout ("secondrun(h)",50); } } function secondrun(h){ self.resizeTo (window_width,h); firstrun(); } /************************************************************************************ * * Function Name : LengthCheck() * Description : ¹®ÀÚ¿­ÀÇ ±æÀ̸¦ üũÇÏ¿© Á¤ÇÕ¼º ¿©ºÎ¸¦ ÆÇ´ÜÇÏ¿©ÁØ´Ù * Return Value : True * False * usage : if(!LengthCheck(1,100,"MESSAGE",f.ar_tel_no)) return; * if(!LengthCheck(1,100,"Message", null )) return; * if(!LengthCheck(1,100,null, null )) return; ************************************************************************************/ function LengthCheck(min, max, data, strErrMessage, focus) { var count = 0; for ( var i=0; i < data.length; i++ ) { if( data.charCodeAt(i) < 127 ) count++; else count = count + 2; } if ( (count >= min) && (count <= max) ) return true; if ( strErrMessage != null ) alert( strErrMessage ); if ( focus != null ) focus.focus(); return false; } /************************************************************************************ * * Function Name : IsTypeCheck() * Description : DataÀÇ TypeÀ» üũÇÏ¿©ÁØ´Ù * Return Value : Yes * usage : if(!IsTypeCheck("AN",f.ar_tel_no.value,"MESSAGE",f.ar_tel_no)) return; * if(!IsTypeCheck("AN",f.ar_tel_no.value,"Message", null )) return; * if(!IsTypeCheck("AN",f.ar_tel_no.value,null, null )) return; ************************************************************************************/ function IsTypeCheck(type, data, strErrMessage, focus) { var count=0; var bSwitch = true; switch (type.toUpperCase()) { case 'F' : //½Ç¼öüũ... var Dotcount = 0; for ( var i=0; i < data.length; i++ ) { if ( data.charCodeAt(i) == 46 ) { Dotcount++; if ( Dotcount > 1 ){ //µµÆ®°¡ µÎ¹øÀÌ»ó Ç¥±â µÇ¾ú´ÂÁöÈ®ÀÎÇÏ´Ù. bSwitch = false; break; } if(i == 0 ) { //µµÆ®°¡ ¸Ç¾Õ¿¡ ¿ÀÁö ¾Ê¾Ò´ÂÁö È®ÀÎÇÑ´Ù. bSwitch = false; break; } } else { if ( data.charCodeAt(i) < 48 || data.charCodeAt(i) > 57) { bSwitch = false; break; } } } break; case 'FLOAT' : //Return number value ¼ýÀÚ,µµÆ® ÀÌ¿Ü ¹®ÀÚ´Â ÀÚ¸§ var nRtn=""; var sData = data.value; var Dotcount = 0; for ( var i=0; i < sData.length; i++ ) { if ( (sData.charCodeAt(i) > 47 && sData.charCodeAt(i) < 58) || sData.charCodeAt(i) == 46) { if ( sData.charCodeAt(i) == 46 ) { Dotcount++; if ( Dotcount > 1 ){ //µµÆ®°¡ µÎ¹øÀÌ»ó Ç¥±â µÇ¾ú´ÂÁöÈ®ÀÎÇÏ´Ù. break; } if(i == 0 ) { //µµÆ®°¡ ¸Ç¾Õ¿¡ ¿ÀÁö ¾Ê¾Ò´ÂÁö È®ÀÎÇÑ´Ù. break; } } nRtn = nRtn+sData.charAt(i); } } data.value = nRtn; return; break; case 'N' : //Number ASCII Code 48 ~ 57 for ( var i=0; i < data.length; i++ ) { if ( data.charCodeAt(i) < 48 || data.charCodeAt(i) > 57) { bSwitch = false; break; } } break; case 'NUM' : //Return number value ¼ýÀÚÀÌ¿Ü ¹®ÀÚ´Â ÀÚ¸§ var nRtn=""; var sData = data.value; for ( var i=0; i < sData.length; i++ ) { if ( sData.charCodeAt(i) > 47 && sData.charCodeAt(i) < 58) { nRtn = nRtn+sData.charAt(i); } } data.value = nRtn; return; break; case 'NH' : //Number(48~57) + Hippen( 45 ) for ( var i=0; i < data.length; i++ ) { if ( data.charCodeAt(i) != 45 ) { if ( data.charCodeAt(i) < 48 || data.charCodeAt(i) > 57){ bSwitch = false; break; } } } break; case 'A' : //Alphabetic( 65~90) data = data.toUpperCase() for ( var i=0; i < data.length; i++ ) { if (( data.charCodeAt(i) < 65 || data.charCodeAt(i) > 90 )&& ( data.charCodeAt(i) != 32)) { bSwitch = false; break; } } break; case 'AN' : //AlphaNumeric data = data.toUpperCase() for ( var i=0; i < data.length; i++ ) { if (( data.charCodeAt(i) < 48 || data.charCodeAt(i) > 57)&& ( data.charCodeAt(i) != 32)) { if ( data.charCodeAt(i) < 65 || data.charCodeAt(i) > 90 ) { bSwitch = false; break; } } } break; case 'ADH' : //Alphabetic( 65~90) + µµÆ®(46) + Hippen(45) + °ø¹é(32) data = data.toUpperCase() for ( var i=0; i < data.length; i++ ) { if ( (data.charCodeAt(i) < 65 && data.charCodeAt(i) != 45 && data.charCodeAt(i) != 46 && data.charCodeAt(i) != 32) || (data.charCodeAt(i) > 90 && data.charCodeAt(i) != 45 && data.charCodeAt(i) != 46 && data.charCodeAt(i) != 32) ) { bSwitch = false; break; } } break; case 'ENG' : //Only English ¼ýÀÚ Æ÷ÇÔ for ( var i=0; i < data.length; i++ ) { if ( data.charCodeAt(i) > 127 ) { bSwitch = false; break; } } break; case 'KOR' : //Only Korean for ( var i=0; i < data.length; i++ ) { if ( data.charCodeAt(i) < 0xAC00 || data.charCodeAt(i) > 0xD7A3){ if (( data.charCodeAt(i) < 12593 || data.charCodeAt(i) > 12643 ) && ( data.charCodeAt(i) != 32)) { bSwitch = false; break; } } } break; case 'B' : //Blank ¹®ÀÚ¿­Áß ºó°ø¹é üũ ¸¶Áö¸·ÀÌ °ø¹éÀÌ¶óµµ false for( var i=0; i 12)) { bSwitch = false; break; } if ((strDay > LastDay[strMonth-1]) || (strDay <= 0)) { bSwitch = false; } break; case 'TEL' : // Phone Number Check for ( var i=0; i < data.length; i++ ) { if ( data.charCodeAt(i) != 45 ) { if ( data.charCodeAt(i) < 48 || data.charCodeAt(i) > 57) { bSwitch = false; break; } } } if( bSwitch ) { if( data.length < 7 || data.length > 13 ) bSwitch = false; } break; case 'SQ' : // Single Quotation Check for ( var i=0; i < data.length; i++ ) { if ( data.charAt(i) == "'" ) { bSwitch = false; break; } } break; } //Á¤»óÀûÀ̸é if (bSwitch) return true; //ºñÁ¤»óÀûÀÎ °æ¿ì ¸Þ¼¼Áö°¡ ÀÖ´Â °æ¿ì if ( strErrMessage != null ) alert( strErrMessage ); if ( focus != null ) { focus.focus(); focus.select(); } return false; } ///////////////////////////////////////////////////////////////////// // 2004.01.26 ÀÓ¼ºÈ£ Ãß°¡ ½ÃÀÛ //=========== ","°¡ Æ÷ÇÔµÈ ¼ýÀÚ¸¦ "," Á¦°Å ================================ function replace_num(str) { while (str.indexOf(",") > -1) str = str.replace(",", ""); return str; } //=========== ÀԷ¹ÞÀº ¼ýÀÚ¸¦ "," Ç¥½Ã ´Ü, Á¤¼öÇüÅÂÀÇ ¼ýÀÚ¸¸ Çã¿ëµÊ, ======= //=========== ¸¶À̳ʽº ±Ý¾×Àº üũ ¾ÈÇÔ... isDigit()ÇÔ¼ö¿¡¼­ ¸¶À̳ʽº °É·¯Áü ==== function replace_str(num) { while (num.indexOf(",") > -1) num = num.replace(",", ""); var obj = new String(parseFloat(num)); var len = obj.length; if (len <= 3) num = obj; else { var i = parseInt(len / 3); // alert(i); var j = len % 3; // alert(j); num = ""; if (j != 0) { num = obj.substring(0, j) + ","; obj = obj.substring(j); } if (i == 1) num += obj else { for (t = 1 ; t < i ; t++) { num += obj.substring(0,3) + ","; obj = obj.substring(3); } num += obj; } } return num; } // 2004.01.26 ÀÓ¼ºÈ£ Ãß°¡ ³¡ ///////////////////////////////////////////////////////////////////// //¸µÅ©/À̹ÌÁö Ŭ¸¯½Ã »ý±â´Â Á¡¼± Å׵θ® Á¦°Å function bluring(){ if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); } document.onfocusin=bluring; //ÆË¾÷¿ÀÇ SET Cookie function setCookie( name, value, expiredays ) { var today = new Date(); today.setDate( today.getDate() + expiredays ); document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";"; } //ÆË¾÷¿ÀÇ GET Cookie function getCookie(strName) { var strArg = new String(strName + "="); var nArgLen, nCookieLen, nEnd; var i = 0, j; nArgLen = strArg.length; nCookieLen = document.cookie.length; if(nCookieLen > 0) { while(i < nCookieLen) { j = i + nArgLen; if(document.cookie.substring(i, j) == strArg) { nEnd = document.cookie.indexOf (";", j); if(nEnd == -1) nEnd = document.cookie.length; return unescape(document.cookie.substring(j, nEnd)); } i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } } return(""); } //Á÷¿øÀÎÁõ âÀ» ¿ÀÇÂÇÑ´Ù. function pop_secu_card() { top.window.open(contextPath + '/popup/popSecuCard.jsp','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=479,height=280'); } function secuAlert() { var msg = "Á÷¿øÀÎÁõÀÌ ÇÊ¿äÇÑ ¸Þ´ºÀÔ´Ï´Ù. \n\nÁ÷¿øÀÎÁõÀ» ÁøÇàÇϽðڽÀ´Ï±î?"; if (confirm(msg)) { pop_secu_card(); } return; } function authAlert() { alert('ÇöÀç ±ÇÇÑÀÌ ¾ø½À´Ï´Ù. °ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇϼ¼¿ä.'); } //ȸ¿øÁ¤º¸¸¦ ¿ÀÇÂÇÑ´Ù function go_userInfo(path) { var url = contextPath + "/vendor/member/mm_au201.jsp?user_set="+path; window.open(url,'','scrollbars=yes,width=805,height=700,top=0,left=100'); //parent.document.location.href="/vendor/index_new.jsp?path="+"/vendor/member/mm_au201.jsp?user_set="+path; } //ȸ¿øÁ¤º¸¸¦ ¿ÀÇÂÇÑ´Ù function go_topmenu(path) { var url = contextPath + "/vendor/member/mm_au201.jsp?user_set="+path; window.open(url,'','scrollbars=yes,width=805,height=700,top=0,left=100'); //parent.document.location.href="/vendor/index_new.jsp?path="+"/vendor/member/mm_au201.jsp?user_set="+path; } //========input check=========== function isDigit(obj) { if(isNull(obj)) { return false; } else { var checkString="0123456789"; return checkContains(obj,checkString); } } //========input ","=========== function isDigit2(obj) { if(isNull(obj)) { return false; } else { var checkString="0123456789,"; return checkContains(obj,checkString); } } //========input "."=========== function isDigit3(obj) { if(isNull(obj)) { return false; } else { var checkString="0123456789."; return checkContains(obj,checkString); } } /*////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////[200612¿ù Ãß°¡ lyho]///////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////*/ //====================================================================================== // Description : function //====================================================================================== function setFocus(field) { try { field.focus(); if (field.tagName == "INPUT" || field.tagName == "SELECT" ) { field.select(); } } catch (e) { field.focus(); } } //====================================================================================== // Description : function //====================================================================================== function checkDate(strDate){ if(_trim(strDate).length != 8) return false; var maxdate = Array(12); maxdate[0] = 31; maxdate[ 1] = 28; maxdate[ 2] = 31; maxdate[3] = 30; maxdate[ 4] = 31; maxdate[ 5] = 30; maxdate[6] = 31; maxdate[ 7] = 31; maxdate[ 8] = 30; maxdate[9] = 31; maxdate[10] = 30; maxdate[11] = 31; var iYear = parseInt(strDate.substr(0,4),10); // YYYY) var iMonth = parseInt(strDate.substr(4,2),10); //(MM) var iDay = parseInt(strDate.substr(6,2),10); //(DD) if(parseInt(iYear) < 1900) return false; if(_LeapYear(iYear)) maxdate[ 1] = 29; if((parseInt(iMonth) < 1) ||(parseInt(iMonth) >12)) { return false; } if(parseInt(iDay) > maxdate[parseInt(iMonth) - 1] || parseInt(iDay) < 1) return false; return true; } //====================================================================================== // Description : function //====================================================================================== function _trim(str) { return (str.replace(/^\s+|\s+$/g,'')); } //====================================================================================== // Description : function //====================================================================================== function _LeapYear(year){ year = parseInt(year); return (year % 4 == 0) && ( (year % 100 != 0) || (year % 400 == 0) ); } function setFocus(field) { try { field.focus(); if (field.tagName == "INPUT") { field.select(); } } catch (e) { field.focus(); } } function checkLength(field) { if (typeof(field.maxLen) ==' undefined') return true var val = field.value; if(lenB(val) > field.maxLen){ throw new Error( getDescription(field) + "´Â(Àº) ÃÖ´ë "+ field.maxLen + " ±ÛÀÚ(Byte)±îÁö¸¸ À¯È¿ÇÕ´Ï´Ù."); } return true; } function checkMandatory(field) { if(!isMandatory(field) || lenB(field.value)!=0) return; throw new Error( getDescription(field) + "´Â(Àº) ÇʼöÀÔ·ÂÇ׸ñÀÔ´Ï´Ù."); } function isMandatory(field) { return eval(field.mandatory); } function isBlank(field) { var value = field.value; for (; value.indexOf(" ") != -1 ;) { value = value.replace(" ","") } return value.length == 0; } function checkDataType(field) { var desc =""; if(isBlank(field)) return; if (field.datatype=="Date") { desc = "ÀÏÀÚ(YYYMMDD)"; if(checkDate(field.value)) return; } else if(field.datatype=="Boolean") { desc = "Y ¶Ç´Â N °ª"; if(field.value =="Y" || field.value =="N") return; } else if (field.datatype=="Number") { desc = "¼ýÀÚ"; if(!isNaN(field.value)) return; } else if (field.datatype=="Integer") { desc = "Á¤¼ö"; if(isInteger(field.value)) return; } else if (field.datatype=="Email") { desc = "¸ÞÀÏÁÖ¼ÒÇüÅÂ"; if(checkEmailID(field.value)) return; } else { return; } throw new Error( getDescription(field) + "´Â(Àº) " + desc + "¸¸ À¯È¿ÇÕ´Ï´Ù."); } function isInteger(val) { if(isNaN(val)) return false; for (var j=0; j= 0 && k <= 255){ sum += 1; }else{ sum += 2; } } return sum; } /////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////lyho 20061227ÀÏ ¾÷µ¥ÀÌÆ®ÇÔ. //str À» ¼Ò¼öÁ¡ sosoonum ° ÀÚ¸®±îÁö °ªÀ» ¸®ÅÏ ÇÔ. function sosoojum(str, sosoonum){ var return_str = ""; var k; var lyho_count = 0; var count = 0; var temp_count =0; for(var i=0; i