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(); tmpVal = 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; } // 숫자를 한글로 표시하는 함수 // obj : 숫자 , target : 한글로 변환된 숫자를 표시하는 object function changeNumToHan(obj, target) { string = UnComma(obj).toString(); // 콤마 제거 var hn = new Array("영","일","이","삼","사","오","육","칠","팔","구"); var hj = new Array("","만","억","조","경","해","시","양","구","간","정","재","극","항하사","아승지","나유타","불가사의","무량대수"); var ul = new Array("영천","영백","영십","영"); var tm = new Array(); var result = ""; if (string.charAt(0) == "-") { result = "- "; string = string.substr(1, string.length - 1); } loop_size = Math.ceil(string.length/4); string2 = ""; for (var count = string.length; count >= 0; count--) { string2 += string.substring(count,count-1); } string = string2; for (var A = 0; A < loop_size; A++) { sum = hj[A] + " "; tm[A] = string.substr(A*4,4); tm2 = ""; for (var count=tm[A].length; count >= 0; count--) tm2 += tm[A].substring(count,count-1); tm[A] = tm2; part_jari = tm[A].length; for (var D=0;D<10;D++) { for (var B=0;B<10;B++) { tm[A] = tm[A].replace(B,hn[B]); } } if (part_jari == 4) { tm[A] = tm[A].charAt(0) + "천" + tm[A].charAt(1) + "백" + tm[A].charAt(2) + "십" + tm[A].charAt(3); } else if ( part_jari == 3){tm[A] = tm[A].charAt(0) + "백" + tm[A].charAt(1) + "십" + tm[A].charAt(2); } else if (part_jari == 2) { tm[A] = tm[A].charAt(0) + "십" + tm[A].charAt(1); } else { tm[A] = tm[A].charAt(0); } for (var C=0; C < 4; C++) { if (tm[A].match(ul[C])) { part_jari--; tm[A] = tm[A].replace(ul[C],""); } } if (part_jari != 0) { tm[A] += sum; } } for (loop_size;loop_size>-1;loop_size--) { result += tm[loop_size]; } result = result.replace("undefined",""); if(result != 0) document.getElementById(target).innerText = "[ " + result + " 원" + " ]"; } // CheckBox or Radio 컨트롤 선택 체크 function chkCheckboxCnt(obj) { var rtnCnt = 0; obj = document.getElementById(obj); alert(obj.length); for(i=0; i < obj.length; i++) { if(obj[i].checked == true) rtnCnt += 1; } return rtnCnt; } // CheckBox or Radio 값 (단일 선택 시) function getCheckedValue(obj) { for(i = 0; i < obj.length; i++) { if(obj[i].checked == true) { return obj[i].value; break; } } } // Validate 함수 // 기본 Str 체크 function validate_required(obj, str, focus) { if(obj.value == "" || obj.value == "0") { alert(str + " 필수입력 항목입니다."); if(focus) obj.focus(); return 1; } else return 0; } // 다중으로 선언된 컨트롤 체크 (checkbox, radiobox) function validate_multi(obj, str, isMoreMsg) { var tmpCnt = 0; for(i = 0; i < obj.length; i++) { if(obj[i].checked == true) tmpCnt += 1; } if(tmpCnt <= 0) { if(isMoreMsg) alert(str + " 하나 이상 선택하셔야 합니다."); else alert(str + " 필수입력 항목입니다."); return 1; } else return 0; } // 사업자 등록 번호 체크 function validate_ent_regno(obj1, obj2, obj3, str) { var tmpEntRegno = obj1.value + obj2.value + obj3.value; if(validate_required(obj1, str, 1)) return 1; else if(validate_required(obj2, str, 1)) return 1; else if(validate_required(obj3, str, 1)) return 1; else if(!chkCompNo(tmpEntRegno)) { alert(tmpEntRegno + " 는 정상적인 사업자 등록번호가 아닙니다.\r\n재 입력 하시기 바랍니다."); obj1.focus(); return 1; } else return 0; } // 이메일 체크 function validate_email(obj) { if(obj.value.search(/^[-A-Za-z0-9_]+[-A-Za-z0-9_.]*[@]{1}[-A-Za-z0-9_]+[-A-Za-z0-9_.]*[.]{1}[A-Za-z]{2,5}$/) == -1) { alert("이메일 형식이 올바르지 않습니다."); obj.focus(); return 1; } else return 0; }