function CheckID() { var form = document.RegistForm; if(!form.UserID.value) { alert("Á¶È¸ÇÏ½Ç ID¸¦ ÀÔ·ÂÇϼ¼¿ä"); form.UserID.focus(); return false; } for (var k=0; k <= (form.UserID.value.length - 1); k++) { if (form.UserID.value.indexOf(" ") >= 0) { alert("ID¸¦ ºóÄ­¾øÀÌ ºÙ¿©½á Áֽʽÿä"); form.UserID.focus(); return false; } } if (form.UserID.value.length < 4 || form.UserID.value.length > 12) { alert("¾ÆÀ̵ð´Â 4±ÛÀÚ ÀÌ»ó, 12±ÛÀÚ ÀÌÇÏÀÔ´Ï´Ù."); form.UserID.focus(); return false; } for (i = 0; i < form.UserID.value.length; i++) { if (form.UserID.value.charAt(i) >= '0' && form.UserID.value.charAt(i) <= '9') continue; else if (form.UserID.value.charAt(i) >= 'a' && form.UserID.value.charAt(i) <= 'z') continue; else if (form.UserID.value.charAt(i) >= 'A' && form.UserID.value.charAt(i) <= 'Z') continue; else { alert("ȸ¿ø ¾ÆÀ̵𿡴 ¿µ¹®ÀÚ, ¼ýÀÚ¸¸ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù."); form.UserID.value = "" ; form.UserID.focus(); return false; } } return true; } function CheckID_Form(file,table,width,height) { var form = document.RegistForm; var UserID = form.UserID.value; var ReturnValue = CheckID(); if(ReturnValue == true) window.open(file+"?member="+table+"&UserID="+UserID,"order","width="+width+",height="+height+",left=100,top=100"); } function CheckPW(VALUE,ErrMsg) { if(!VALUE) { alert(ErrMsg); form.UserID.focus(); return false; } for (var k=0; k <= (form.UserID.value.length - 1); k++) { if (form.UserID.value.indexOf(" ") >= 0) { alert("ID¸¦ ºóÄ­¾øÀÌ ºÙ¿©½á Áֽʽÿä"); form.UserID.focus(); return false; } } if (form.UserID.value.length < 4 || form.UserID.value.length > 12) { alert("¾ÆÀ̵ð´Â 4±ÛÀÚ ÀÌ»ó, 12±ÛÀÚ ÀÌÇÏÀÔ´Ï´Ù."); form.UserID.focus(); return false; } for (i = 0; i < form.UserID.value.length; i++) { if (form.UserID.value.charAt(i) >= '0' && form.UserID.value.charAt(i) <= '9') continue; else if (form.UserID.value.charAt(i) >= 'a' && form.UserID.value.charAt(i) <= 'z') continue; else if (form.UserID.value.charAt(i) >= 'A' && form.UserID.value.charAt(i) <= 'Z') continue; else { alert("ȸ¿ø ¾ÆÀ̵𿡴 ¿µ¹®ÀÚ, ¼ýÀÚ¸¸ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù."); form.UserID.value = "" ; form.UserID.focus(); return false; } } return true; } function NullCheck(Element,ErrMsg,focuss){ if(!Element.value){ alert(ErrMsg); if(focuss == "focuss") Element.focus(); return false; } else return true; } function CheckFile(fileOBJ){ var ImageFile = fileOBJ; var extFile = ImageFile.split("\\"); var ImgInfo = extFile[extFile.length-1]; var ext = ImgInfo.split("."); if (ext[1].toUpperCase() == "JPG" || ext[1].toUpperCase() == "GIF"){ CheckImageFile(fileOBJ); if(!isKorean(ext[0])) { alert("À̹ÌÁöÆÄÀÏÀº Çѱ۸íÀ» »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù."); } } } function isKorean(ch){ var numUnicode = ch.charCodeAt(0); if ( 44032 <= numUnicode && numUnicode <= 55203 ) return false; return true; } function CheckImageFile(fileOBJ) { var tmpImage = new Image; tmpImage.src = fileOBJ; if(tmpImage.fileSize > 512*1024){ alert("À̹ÌÁöÀÇ »çÀÌÁî´Â 500Kb·Î Á¦ÇÑÇÕ´Ï´Ù."); return false; } } function checkJuminNumber(juminNumber) { // ÁֹιøÈ£ÀÇ ÇüÅÂ¿Í 7¹ø° ÀÚ¸®(¼ºº°) À¯È¿¼º °Ë»ç fmt = /^\d{6}[1234]\d{6}$/; if( !fmt.test(juminNumber)){ alert("À߸øµÈ Áֹεî·Ï¹øÈ£ÀÔ´Ï´Ù."); document.all.jumin1.focus(); return false; } // ³¯Â¥ À¯È¿¼º °Ë»ç birthYear = ( juminNumber.charAt(6) <= "2" ) ? "19" : "20"; birthYear += juminNumber.substr( 0, 2 ); birthMonth = juminNumber.substr( 2, 2 ) - 1; birthDate = juminNumber.substr( 4, 2 ); birth = new Date( birthYear, birthMonth, birthDate ); if( birth.getYear() % 100 != juminNumber.substr( 0, 2 ) || birth.getMonth() != birthMonth || birth.getDate() != birthDate ){ alert("À߸øµÈ Áֹεî·Ï¹øÈ£ÀÔ´Ï´Ù."); return false; } // Check Sum ÄÚµåÀÇ À¯È¿¼º °Ë»ç buf = new Array( 13 ); for( i = 0; i < 6; i++ ) buf[i] = parseInt( juminNumber.charAt( i ) ); for( i = 6; i < 13; i++ ) buf[i] = parseInt( juminNumber.charAt( i ) ); multipliers = [ 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5 ]; for( i = 0, sum = 0; i < 12; i++ ) sum += ( buf[i] *= multipliers[i] ); if( ( 11 - ( sum % 11 ) ) % 10 != buf[12] ) { alert("À߸øµÈ Áֹεî·Ï¹øÈ£ÀÔ´Ï´Ù."); return false; } //¸¸ 14¼¼ üũ dday = new Date(); NowYear = dday.getYear(); NowMonth = dday.getMonth(); age = NowYear - birthYear; if(NowMonth > birthMonth){ age++; } if(age < 19){ // alert("¸¸ 19¼¼ ÀÌ»ó¸¸ °¡ÀÔ°¡´ÉÇÕ´Ï´Ù."); // return false; } return true; } function checkBizNumber(num) { var reg = /([0-9]{3})-?([0-9]{2})-?([0-9]{5})/; if (!reg.test(num)) return false; num = RegExp.$1 + RegExp.$2 + RegExp.$3; var cVal = 0; for (var i=0; i<8; i++) { var cKeyNum = parseInt(((_tmp = i % 3) == 0) ? 1 : ( _tmp == 1 ) ? 3 : 7); cVal += (parseFloat(num.substring(i,i+1)) * cKeyNum) % 10; } var li_temp = parseFloat(num.substring(i,i+1)) * 5 + '0'; cVal += parseFloat(li_temp.substring(0,1)) + parseFloat(li_temp.substring(1,2)); return (parseInt(num.substring(9,10)) == 10-(cVal % 10)%10); } //alert(checkBizNumber('123-45-67891') ? "¸ÂÀ½" : "Ʋ¸²"); //alert(checkBizNumber('1234567891') ? "¸ÂÀ½" : "Ʋ¸²"); // Àç¿Ü±¹ÀÎ ¹øÈ£ üũ function check_fgnno(fgnno) { var sum=0; var odd=0; buf = new Array(13); for(i=0; i<13; i++) { buf[i]=parseInt(fgnno.charAt(i)); } odd = buf[7]*10 + buf[8]; if(odd%2 != 0) { alert("À߸øµÈ ¿Ü±¹Àεî·Ï¹øÈ£ÀÔ´Ï´Ù."); return false; } if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) { alert("À߸øµÈ ¿Ü±¹Àεî·Ï¹øÈ£ÀÔ´Ï´Ù."); return false; } multipliers = [2,3,4,5,6,7,8,9,2,3,4,5]; for(i=0, sum=0; i<12; i++) { sum += (buf[i] *= multipliers[i]); } sum = 11 - (sum%11); if(sum >= 10) { sum -= 10; } sum += 2; if(sum >= 10) { sum -= 10; } if(sum != buf[12]) { alert("À߸øµÈ ¿Ü±¹Àεî·Ï¹øÈ£ÀÔ´Ï´Ù."); return false; } return true; } function chkKey(keyword,data){ en=(keyword.match(/(en)|(eng)|(¿µ)/))?1:0; kr=(keyword.match(/(han)|(kr)|(kor)|(ÇÑ)/))?1:0; no=(keyword.match(/(no)|(num)|(1)/))?1:0; bar=(keyword.match(/(bar)|(-)|(line)|(minus)/))?1:0; un=(keyword.match(/(un)|(_)|(under)|(ubar)/))?1:0; dot=(keyword.match(/(dot)|(.)/))?1:0; a = "/["+((((en)?"|(a-z)|(A-Z)":"")+((kr)?"|(°¡-ÆR)":"")+((no)?"|(0-9)":"")+((bar)?"|-":"")+((dot)?"|(.)":"")+((un)?"|_":"")).substring(1))+"]/g"; return ((String.fromCharCode(data)).match(eval(a)))?true:false; } function chkPaste(obj) { for (i = 0; i < obj.value.length; i++) { if (obj.value.charAt(i) >= '0' && obj.value.charAt(i) <= '9') continue; // else if (obj.value.charAt(i) >= 'a' && obj.value.charAt(i) <= 'z') continue; // else if (obj.value.charAt(i) >= 'A' && obj.value.charAt(i) <= 'Z') continue; else { alert("¼ýÀÚ¸¸ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù."); obj.focus(); return false; } } } function radioFieldCheck(field) { if(field.length > 1) { for(i=0;i= len && !containsElement(filter,keyCode)) { input.value = input.value.slice(0, len); input.form[(getIndex(input)+1) % input.form.length].focus(); } function containsElement(arr, ele) { var found = false, index = 0; while(!found && index < arr.length) if(arr[index] == ele) found = true; else index++; return found; } function getIndex(input) { var index = -1, i = 0, found = false; while (i < input.form.length && index == -1) if (input.form[i] == input)index = i; else i++; return index; } return true; } function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) { toolbar_str = toolbar ? 'yes' : 'no'; menubar_str = menubar ? 'yes' : 'no'; statusbar_str = statusbar ? 'yes' : 'no'; scrollbar_str = scrollbar ? 'yes' : 'no'; resizable_str = resizable ? 'yes' : 'no'; window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str); } function setCookieDomain (name, value, expiredays, domain) { var argLen = arguments.length; var path = argLen[4]; var secure = argLen[5]; var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + expiredays ); document.cookie = name + "=" + escape (value) + ((expiredays) ? "; expires=" + todayDate.toGMTString() : "") + ((path) ? "; path=" + path : "/") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "0"); } function setCookie( name, value, expiredays ){ var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + expiredays ); document.cookie = name+"="+escape( value )+"; path=/;expires="+todayDate.toGMTString()+";" } function getCookie(Name) { var search = Name + "="; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(offset, end)); } else return false; } else return false; } function resize(resize_img) { original = new Image(); original.src = (resize_img.src); fix_w = 80; // °íÁ¤ÇÒ Å©±â (Çȼ¿ ´ÜÀ§) if (resize_img.width > fix_w) resize_img.width = fix_w; resize_img.onclick = function() { margin_Top = 0; // »ó¿©¹é margin_Left = 0; // Á¿©¹é margin_Right = 0; // ¿ì¿©¹é margin_Bottom = 0; // ÇÏ¿©¹é winW = original.width + margin_Left + margin_Right; // »õ âÀÇ °¡·Î Å©±â winH = original.height + margin_Top + margin_Bottom; // »õ âÀÇ ¼¼·Î Å©±â ZoomImage = window.open('','','width='+winW+',height='+winH+',left=0,top=0'); var htmlTag = "\ \n \n \n È®´ë º¸±â\n \ \n \ \n \ \n \ \n \ \n \ \n
\ \n \ \n
\ \n \ \n \ "; ZoomImage.document.write(htmlTag); } }