function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i 57)) event.returnValue = false; } } function chkMemID(formMemID) { var tmpVal = true; if(formMemID.value.search(/^[a-zA-Z][a-zA-Z0-9]*$/) == -1) { alert("사용자ID는 영문 또는 영문+숫자 조합으로 사용하셔야 합니다."); formMemID.value = ""; formMemID.focus(); tmpRtnVal = false; } return tmpVal; } function chkEmail(tmpMemEmail) { var tmpVal = true; if(tmpMemEmail.value.search(/(\S+)@(\S+)\.(\S+)/) == -1) { alert("이메일 형식이 올바르지 않습니다."); tmpMemEmail.value = ""; tmpMemEmail.focus(); tmpVal = false; } return tmpVal; } function chkPasswdConfirm(formPasswd, formPasswdCf) { var tmpVal = true; if(formPasswd.value != formPasswdCf.value) { alert("비밀번호가 일치하지 않습니다."); formPasswdCf.value = ""; formPasswdCf.focus(); tmpVal = false; } return tmpVal; } function setCheckbox(formName, contName, val) { var tmpCheckName = eval("formName." + contName); for(i = 0; i < tmpCheckName.length; i++) { if(tmpCheckName[i].value == val) tmpCheckName[i].checked = true; else tmpCheckName[i].checked = false; } } function MakeComma(obj) { if (event.keyCode == 9 || event.keyCode == 16) { obj.select();return; } obj.value = UnComma(obj.value); obj.value = Comma(obj.value); } function Comma(input) { var inputString = new String; var outputString = new String; var counter = 0; var decimalPoint = 0; var end = 0; var modval = 0; inputString = input.toString(); outputString = ''; decimalPoint = inputString.indexOf('.', 1); if(decimalPoint == -1) { end = inputString.length - (inputString.charAt(0)=='0' ? 1:0); for (counter=1;counter <=inputString.length; counter++) { var modval =counter - Math.floor(counter/3)*3; outputString = (modval==0 && counter = 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 sugubType(val) { if(val == "01") { document.getElementById("sugub1").style.display = "none"; document.getElementById("sugub2").style.display = "none"; document.getElementById("sugub3").style.display = "none"; document.getElementById("gongdong1").style.display = "none"; document.getElementById("gongdong2").style.display = "none"; document.getElementById("gongdong3").style.display = "none"; document.getElementById("oriDemandCompNm").readOnly = true; document.getElementById("oriDemandCompNm").style.background = "#efefef"; document.getElementById("oriDemandCompNo1").readOnly = true; document.getElementById("oriDemandCompNo2").readOnly = true; document.getElementById("oriDemandCompNo3").readOnly = true; document.getElementById("oriDemandCompNo1").style.background = "#efefef"; document.getElementById("oriDemandCompNo2").style.background = "#efefef"; document.getElementById("oriDemandCompNo3").style.background = "#efefef"; document.getElementById("contCompNm").readOnly = true; document.getElementById("contCompNm").style.background = "#efefef"; document.getElementById("contCompNo1").readOnly = true; document.getElementById("contCompNo2").readOnly = true; document.getElementById("contCompNo3").readOnly = true; document.getElementById("contCompNo1").style.background = "#efefef"; document.getElementById("contCompNo2").style.background = "#efefef"; document.getElementById("contCompNo3").style.background = "#efefef"; document.getElementById("oriBizNm").readOnly = true; document.getElementById("oriBizNm").style.background = "#efefef"; document.getElementById("unionContPrice").readOnly = true; document.getElementById("unionContPrice").style.background = "#efefef"; document.getElementById("unionPerson").readOnly = true; document.getElementById("unionPerson").style.background = "#efefef"; document.getElementById("quotaPer").readOnly = true; document.getElementById("quotaPer").style.background = "#efefef"; } else if(val == "04" || val == "05") { document.getElementById("sugub1").style.display = "none"; document.getElementById("sugub2").style.display = "none"; document.getElementById("sugub3").style.display = "none"; document.getElementById("gongdong1").style.display = ""; document.getElementById("gongdong2").style.display = ""; document.getElementById("gongdong3").style.display = ""; document.getElementById("oriDemandCompNm").readOnly = true; document.getElementById("oriDemandCompNm").style.background = "#efefef"; document.getElementById("oriDemandCompNo1").readOnly = true; document.getElementById("oriDemandCompNo2").readOnly = true; document.getElementById("oriDemandCompNo3").readOnly = true; document.getElementById("oriDemandCompNo1").style.background = "#efefef"; document.getElementById("oriDemandCompNo2").style.background = "#efefef"; document.getElementById("oriDemandCompNo3").style.background = "#efefef"; document.getElementById("contCompNm").readOnly = true; document.getElementById("contCompNm").style.background = "#efefef"; document.getElementById("contCompNo1").readOnly = true; document.getElementById("contCompNo2").readOnly = true; document.getElementById("contCompNo3").readOnly = true; document.getElementById("contCompNo1").style.background = "#efefef"; document.getElementById("contCompNo2").style.background = "#efefef"; document.getElementById("contCompNo3").style.background = "#efefef"; document.getElementById("oriBizNm").readOnly = true; document.getElementById("oriBizNm").style.background = "#efefef"; document.getElementById("unionContPrice").readOnly = false; document.getElementById("unionContPrice").style.background = "#e9f4f3"; document.getElementById("unionPerson").readOnly = false; document.getElementById("unionPerson").style.background = "#e9f4f3"; document.getElementById("quotaPer").readOnly = false; document.getElementById("quotaPer").style.background = "#e9f4f3"; } else { document.getElementById("sugub1").style.display = ""; document.getElementById("sugub2").style.display = ""; document.getElementById("sugub3").style.display = ""; document.getElementById("gongdong1").style.display = "none"; document.getElementById("gongdong2").style.display = "none"; document.getElementById("gongdong3").style.display = "none"; document.getElementById("oriDemandCompNm").readOnly = false; document.getElementById("oriDemandCompNm").style.background = "#e9f4f3"; document.getElementById("oriDemandCompNo1").readOnly = false; document.getElementById("oriDemandCompNo2").readOnly = false; document.getElementById("oriDemandCompNo3").readOnly = false; document.getElementById("oriDemandCompNo1").style.background = "#e9f4f3"; document.getElementById("oriDemandCompNo2").style.background = "#e9f4f3"; document.getElementById("oriDemandCompNo3").style.background = "#e9f4f3"; document.getElementById("contCompNm").readOnly = false; document.getElementById("contCompNm").style.background = "#e9f4f3"; document.getElementById("contCompNo1").readOnly = false; document.getElementById("contCompNo2").readOnly = false; document.getElementById("contCompNo3").readOnly = false; document.getElementById("contCompNo1").style.background = "#e9f4f3"; document.getElementById("contCompNo2").style.background = "#e9f4f3"; document.getElementById("contCompNo3").style.background = "#e9f4f3"; document.getElementById("oriBizNm").readOnly = false; document.getElementById("oriBizNm").style.background = "#e9f4f3"; document.getElementById("unionContPrice").readOnly = true; document.getElementById("unionContPrice").style.background = "#efefef"; document.getElementById("unionPerson").readOnly = true; document.getElementById("unionPerson").style.background = "#efefef"; document.getElementById("quotaPer").readOnly = true; document.getElementById("quotaPer").style.background = "#efefef"; } } function chkSiljukInput(obj, name) { if(obj.value == "" || obj.value == "0") { alert(name + " 필수입력 항목입니다."); obj.focus(); return 0; } else return 1; } function chkCertForm(val) { if(val == "01") { document.getElementById("baljuName").style.background = "#e9f4f3"; document.getElementById("baljuTel1").style.background = "#e9f4f3"; document.getElementById("baljuTel2").style.background = "#e9f4f3"; document.getElementById("baljuTel3").style.background = "#e9f4f3"; document.getElementById("baljuMobno1").style.background = "#e9f4f3"; document.getElementById("baljuMobno2").style.background = "#e9f4f3"; document.getElementById("baljuMobno3").style.background = "#e9f4f3"; document.getElementById("baljuEmail").style.background = "#e9f4f3"; } else { document.getElementById("baljuName").style.background = "#efefef"; document.getElementById("baljuTel1").style.background = "#efefef"; document.getElementById("baljuTel2").style.background = "#efefef"; document.getElementById("baljuTel3").style.background = "#efefef"; document.getElementById("baljuMobno1").style.background = "#efefef"; document.getElementById("baljuMobno2").style.background = "#efefef"; document.getElementById("baljuMobno3").style.background = "#efefef"; document.getElementById("baljuEmail").style.background = "#efefef"; document.getElementById("baljuName").value = ""; document.getElementById("baljuTel1").value = ""; document.getElementById("baljuTel2").value = ""; document.getElementById("baljuTel3").value = ""; document.getElementById("baljuMobno1").value = ""; document.getElementById("baljuMobno2").value = ""; document.getElementById("baljuMobno3").value = ""; document.getElementById("baljuEmail").value = ""; } } function doSiljuckDelete() { if(confirm("해당 실적정보를 완전히 삭제하시겠습니까?")) { document.form1.action = "prrSiljuckDelProc.jsp"; document.form1.submit(); } } function openWinBalju(searQueryStr) { for(i = 0; i < document.form1.pubKind.length; i++) { if(document.form1.pubKind[i].checked == true) { searQueryStr += "&fgcd=" + document.form1.pubKind[i].value; } } openWin(searQueryStr, "발주업체검색", "620", "580", "no"); } function oriDemandCompNmOpen() { for(i=0; i < document.form1.incomeForm.length; i++) { if(document.form1.incomeForm[i].checked == true) { tmpIncomeVal = document.form1.incomeForm[i].value; } } if(tmpIncomeVal == "03") { openWin('/RR/common/schComp.jsp?ddl1=form1&ddl2=oriDemandCompNm&ddl3=oriDemandCompNo1&ddl4=oriDemandCompNo2&ddl5=oriDemandCompNo3','원수급자조회','520','620', 'no'); } } function baljuOpen() { for(i=0; i < document.form1.certMethod.length; i++) { if(document.form1.certMethod[i].checked == true) { tmpCertMethod = document.form1.certMethod[i].value; } } if(tmpCertMethod == "01") { // 발주자를 직접 입력한 경우 if(document.form1.pubNm.value != "" && document.form1.pubCompSeq.value == "") { alert("발주 기관을 직접입력하신 경우는 발주 담당자를 입력하실 수 없습니다."); setCheckbox(document.form1, 'certMethod', '02'); chkCertForm('02'); } else if(document.form1.pubCompSeq.value) { var tmpUrl = "/RR/common/prmSchBaljuID.jsp?baljuSq=" + document.form1.pubCompSeq.value; openWin(tmpUrl,'발주담당자검색','520','630', 'no'); } else alert("발주 기관명을 먼저 조회 해 주시기 바랍니다."); } else alert("승인 주체가 발주자 확인일 경우만 조회가 가능합니다."); } function chkCompNo(strNo) { var sum = 0; var getlist =new Array(10); var chkvalue =new Array("1","3","7","1","3","7","1","3","5"); for (var i=0;i<10;i++) { getlist[i] = strNo.substring(i,i+1); } for (var i=0;i<9;i++) { sum += getlist[i]*chkvalue[i]; } sum = sum + parseInt((getlist[8]*5)/10) ; sidliy = sum%10; sidchk = 0; if ( sidliy != 0 ) { sidchk = 10 - sidliy; } else { sidchk = 0; } if ( sidchk != getlist[9] ) { return false; } return true; } // Add : AmosRune function chkMsIE() { var ua = window.navigator.userAgent var msie = ua.indexOf ("MSIE") if (msie > 0) {// If Internet Explorer, return version number return parseInt (ua.substring (msie+5, ua.indexOf (".", msie))); } else { return 0; } } // 숫자 체크 function nr_num(this_s, type) { /* type -> 'int' : 양의 정수 -> 'float' : 양의 실수 -> '-int' : 음의 정수 포함 -> '-float' : 음의 실수 포함 */ temp_value = this_s.value.toString(); regexp = /[^-\.0-9]/g; repexp = ''; temp_value = temp_value.replace(regexp,repexp); regexp = ''; repexp = ''; switch(type) { case 'int' : regexp = /[^0-9]/g; break; case 'float' : regexp = /^(-?)([0-9]*)(\.?)([^0-9]*)([0-9]*)([^0-9]*)/; break; case '-int' : regexp = /^(-?)([0-9]*)([^0-9]*)([0-9]*)([^0-9]*)/;break; case '-float' : regexp = /^(-?)([0-9]*)(\.?)([^0-9]*)([0-9]*)([^0-9]*)/; break; default : regexp = /[^0-9]/g; break; } switch(type) { case 'int' : repexp = '';break; case 'float' : repexp = '$2$3$5';break; case '-int' : repexp = '$1$2$4';break; case '-float' : repexp = '$1$2$3$5'; break; default : regexp = /[^0-9]/g; break; } temp_value = temp_value.replace(regexp,repexp); this_s.value = temp_value; } // 문자 입력 수 제한 function chkTextLen(textID, textTitle, maxLen) { var cntID = textID + "_cnt"; var msgtext = document.getElementById(textID).value; var msglen = document.getElementById(cntID).value; var i=0, l=0; var temp, lastl; //길이를 구한다. while(i < msgtext.length) { temp = msgtext.charAt(i); if (escape(temp).length > 4) { l+=2; } else if (temp != '\r') { l++; } // OverFlow if(l > maxLen) { alert("[" + textTitle + "]에는 한글 " + (maxLen/2) + "자, 영문 " + maxLen + "자까지만 쓰실 수 있습니다."); document.getElementById(textID).value = msgtext.substr(0, i); l = lastl; break; } lastl = l; i++; } document.getElementById(cntID).value = l; } // 업로드 파일 확장자 체크 function chkFileType(objID) { var obj = document.getElementById(objID); var tmpIdx = obj.value.lastIndexOf("."); var tmpKind = obj.value.substring(tmpIdx + 1).toLowerCase(); if (tmpKind.length <= 0) return true; file_type = new Array("txt", "zip", "hwp", "pdf", "doc", "ppt", "xls", "docx", "pptx", "xlsx"); var bAllow = false; for (var i = 0; i < file_type.length; i++) { if (file_type[i] == tmpKind) { bAllow = true; break; } } if (bAllow) return true; else { alert("첨부파일은 TXT, ZIP, HWP, PDF, DOC, PPT, XLS, DOCX, PPTX, XLSX 형식 만 가능합니다."); return false; } } // 엘리먼트 입력값 체크 function chkElement(objID, msg) { var tmp = eval(document.getElementById(objID)); // Debug-------------------------------------------------- if (tmp == null || tmp == 'undefined') { alert(objID + "인 Element ID를 찾을 수 없습니다."); return false; } // End if (tmp.value.length <= 0) { alert(msg + " 입력하십시오."); tmp.focus(); return false; } return true; } // 입력 중 문자의 한글과 영문자 체크 function keyString(input) { var tmpValue = input.value.toString(); var regexp = /[^A-Za-zㄱ-ㅎ|ㅏ-ㅣ|가-힣]/g; var repexp = ''; if(regexp.test(tmpValue)) { alert("입력가능한 문자는 한글과 영문자 만 가능합니다."); tmpValue = tmpValue.replace(regexp, repexp); input.value = tmpValue; } } // 입력 중 문자의 숫자 체크 function keyNumber(input) { var tmpValue = input.value.toString(); var regexp = /[^0-9]/g; var repexp = ''; if(regexp.test(tmpValue)) { alert("입력가능한 문자는 숫자 만 가능합니다."); tmpValue = tmpValue.replace(regexp, repexp); input.value = tmpValue; } } // 입력 중 문자의 숫자 체크 function keyNumEng(input) { var tmpValue = input.value.toString(); var regexp = /[^0-9A-Za-z]/g; var repexp = ''; if(regexp.test(tmpValue)) { alert("입력가능한 문자는 숫자와 영문자 만 가능합니다."); tmpValue = tmpValue.replace(regexp, repexp); input.value = tmpValue; } } // 입력된 문자의 한글과 영문자 체크 function checkString(input, msg) { var tmpValue = input.value.toString(); var regexp = /[^A-Za-z가-힣]/g; var repexp = ''; if(regexp.test(tmpValue)) { alert(msg + "에 입력가능한 문자는 한글과 영문자 만 가능합니다."); input.value = ''; input.focus(); return false; } return true; } // 입력된 문자의 숫자와 영문자 체크 function checkNumEng(input, msg) { var tmpValue = input.value.toString(); var regexp = /[^0-9A-Za-z]/g; var repexp = ''; if(regexp.test(tmpValue)) { alert(msg + "에 입력가능한 문자는 숫자와 영문자 만 가능합니다."); input.value = ''; input.focus(); return false; } return true; }