function iePass(idx){ document.write(document.getElementById(idx).value); } function fileCheck(obj) { // 선택파일의 경로를 분리하여 확장자를 구합니다. pathpoint = obj.lastIndexOf('.'); filepoint = obj.substring(pathpoint+1,obj.length); filetype = filepoint.toLowerCase(); // 확장자가 이미지 파일이면 preview에 보여줍니다. if(filetype=='jpg' || filetype=='gif' || filetype=='png' || filetype=='jpeg' || filetype=='bmp') { regform.preview.src = obj; // obj_src = obj; } else { // 이미지 확장자가 아닐경우 경고를 주며, 원래의 임시 이미지 경로로 바꿔줍니다. alert('이미지 파일만 업로드 하실수 있습니다.'); document.regform.preview.src = '/admin/images/tech/11.jpg'; return false; } // 이미지 확장자이지만 BMP 확장자라면 일단 경고를 준다. // 이 부분은 꼭 필요한 부분은 아니지만 제가 운영자라면 bmp 파일은 용량이 크기때문에 웬지.. -_-; if(filetype=='bmp') { upload = confirm('BMP 파일은 웹상에서 사용하기엔 적절한 이미지 포맷이 아닙니다.\n그래도 계속 하시겠습니까?'); if(!upload) return false; } } function ebook() { window.open('http://lipomee.bizmedia.co.kr/ebook.php', 'popup', 'top=100,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=980,height=669'); } function filetypeCheck(obj) { // 선택파일의 경로를 분리하여 확장자를 구합니다. pathpoint = obj.lastIndexOf('.'); filepoint = obj.substring(pathpoint+1,obj.length); filetype = filepoint.toLowerCase(); // 확장자가 이미지 파일이면 preview에 보여줍니다. if(filetype=='jpg' || filetype=='gif' || filetype=='png' || filetype=='jpeg') { return true; // obj_src = obj; } else { // 이미지 확장자가 아닐경우 경고를 주며, 원래의 임시 이미지 경로로 바꿔줍니다. alert('허용되지 않는 파일 확장자입니다.'); return false; } var imgInfo = new Image(); imgInfo.onload = img_Load(); // 이미지 확장자이지만 BMP 확장자라면 일단 경고를 준다. // 이 부분은 꼭 필요한 부분은 아니지만 제가 운영자라면 bmp 파일은 용량이 크기때문에 웬지.. -_-; } function img_Load(){ var imgSrc, imgWidth, imgHeight, imgFileSize; var maxFileSize; maxFileSize = 1024000; imgSrc = this.src; imgWidth = this.width; imgHeight = this.height; imgFileSize = this.fileSize; if (imgWidth > 100 || imgHeight > 100){ alert('가로 100px 또는 세로 100px을 초과하는 이미지파일을 가져올 수 없습니다.'); return; } if (imgFileSize > maxFileSize){ alert('선택하신 그림 파일은 허용 최대크기인 ' + maxFileSize/1024 + ' KB 를 초과하였습니다.'); return; } } var isNN = (navigator.appName.indexOf("Netscape")!=-1); function autoTab(input,len, e) { var keyCode = (isNN) ? e.which : e.keyCode; var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; if(input.value.length >= 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 CheckAll(f) { var val = f.checkall.checked; var cbox = f.check; len = f["check[]"].length; var j=0; for(j = 0; j < len; j++) { var checkbox_obj = f["check[]"][j]; if(val == false) { checkbox_obj.checked=false; } else { checkbox_obj.checked=true; } } } */ function CheckAjaxAll() { var f = document.all; var val = f.checkall.checked; for (var i=0; i1) { alert(xmlhttp.responseText); // xmlhttp = null; } } else { alert("Error:" + xmlhttp.statusText); } } } function xmlhttp_load(url) { xmlhttp = xmlhttp_create(); if (xmlhttp) { xmlhttp.onreadystatechange = xmlhttp_process; xmlhttp.open("GET", url, true); xmlhttp.send(null); } } function BoardDel(url) { var ref = confirm("정말 삭제하시겠습니까?"); if(ref == true) { location.href=url; } else { return false; } } function iframe_move(iframe_name, url) { eval(iframe_name + ".document.location.href='" + url + "';"); } function BoardDelFrame(frame_name,url, str) { var ref = confirm(str + "\n\n정말 삭제하시겠습니까?"); if(ref == true) { eval(frame_name + ".location.href='" + url + "';"); } else { return false; } } function showImage(img,e,width,height) { var x = e.pageX ? e.pageX : document.body.scrollLeft+event.clientX; var y = e.pageY ? e.pageY : document.body.scrollTop+event.clientY; var l = document.getElementById('img_layer'); l.style.top = y - 10; l.style.left = x + 10; l.style.display = 'block'; l.innerHTML = ""; } function closeImage() { var l = document.getElementById('img_layer'); l.style.display = 'none'; } function ZipSearch(zip, addr, f) { theURL = "/inc/zipsearch.php?zip_field=" + zip + "&addr_field=" + addr + "&form=" + f; winName = ""; features = "width=500, height=180, scrollbars=no"; window.open(theURL,winName,features); } function TakbaeZipSearch(zip1,zip2,addr,f) { theURL = "/mem_auth/takbae_zipsearch.php?zip_field_1=" + zip1 + "&zip_field_2=" + zip2 + "&addr_field=" + addr + "&form=" + f; winName = ""; features = "width=500, height=300, scrollbars=no"; window.open(theURL,winName,features); } function LookVod(url) { theURL = url; winName = "select_vod"; features = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, width=300, height=400, resizable=no,left=100,top=100"; window.open(theURL,winName,features); } //로그인 체크 부분 function verify(f) { var error = ''; if ( !f.login_id.value ) { alert("아이디를 입력해 주십시오."); f.login_id.focus(); return false; }else if ( !f.login_pw.value ) { alert("비밀번호를 입력해 주십시오."); f.login_pw.focus(); return false; }else{ if(f.ssl_check.checked){ f.action = 'https://ssl.daehangosi.net/lib/login.php'; } //아이디 저장이 있으면 if(f.id_check != undefined){ var id_value = f.login_id.value; if(f.id_check.checked){ document.cookie = "id_check=ok ; path=/ ; "; document.cookie = "id_value=" + id_value + " ; path=/ ; "; }else{ document.cookie = "id_check=no ; path=/ ; " ; } } return true; } } function parent_move(url) { parent.document.location.href=url; } function checkSelect(shape, branch) { var f = document.pkg_form; var check_nums = f.elements.length; for(var i = 0; i < check_nums; i++) { var checkbox_obj = eval("f.elements[" + i + "]"); if(checkbox_obj.checked == true) { break; } } if(i == check_nums) { alert("먼저 리스트를 선택하여 주십시오"); return false; } else { switch(shape) { case "basket" : case "m_basket" : var str = "정말 장바구니에 등록하시겠습니까?"; var act_url = "/mall/common/act_process.php?mode=" + shape + "&branch=" + branch; break; /* case "buy" : var str = "정말 바로구입 하시겠습니까?"; f.target = "_top"; var act_url = "./?mall=settle&pg=order_form&mode=" + shape + "&branch=" + branch; break; */ case "buy" : var str = "정말 바로구입 하시겠습니까?"; var act_url = "/mall/settle/order_exist.php?mode=" + shape + "&branch=" + branch; break; case "m_buy" : var str = "정말 바로구입 하시겠습니까?"; f.target = "_top"; var act_url = "/mall/common/act_process.php?mode=" + shape + "&branch=" + branch; break; case "wish" : case "m_wish" : var str = "찜하시겠습니까?"; var act_url = "/mall/common/act_process.php?mode=" + shape + "&branch=" + branch; break; } ref = confirm(str); if(ref == true) { f.action = act_url; f.submit(); } else { return; } } } function checkSubmit(shape, branch) { var f = document.pkg_form; switch(shape) { case "buy" : f.target = "_top"; var act_url = "./?mall=settle&pg=order_form&mode=" + shape + "&branch=" + branch; break; } f.action = act_url; f.submit(); } function LogOut() { common_iframe.document.location.href="/mall/common/login_process.php?mode=logout"; } function PopView(type) { var pkg_pk = document.all.m_select_pkg.value; switch(type) { case "P" : theURL = "/inc/pkg_view.php?pkg_pk=" + pkg_pk; break; case "B" : theURL = "/inc/book_view.php?pkg_pk=" + pkg_pk; break; } winName = ""; features = "width=520, height=600, scrollbars=yes, resizable=yes"; window.open(theURL,winName,features); } function ImgFileView(tbl, col, pk, field, width, height) { theURL = "/inc/imgfile_view.php?tbl=" + tbl + "&col=" + col + "&pk=" + pk + "&field=" + field; winName = ""; if(width >= 800 || height >= 600) { if (width >= 800){ width = 800; } else { width = width; } if (height >= 600) { height = 600; } else { height = height; } features = "width=" + width + ", height=" + height + ", scrollbars=yes"; } else { features = "width=" + width + ", height=" + height + ", scrollbars=no"; } window.open(theURL, winName, features); } function id_check(name){ if(isNaN(name) == false) { alert("영문소문자 또는 영문+숫자 혼합형으로 입력하십시요."); return false; } if(!strLengthCheck(name.length)) { return false; } for (i = 0 ; i < name.length ; i++) { sko = name.charAt(i); if(i == 0) { if(isNaN(sko) == false) { alert("첫문자는 무조건 영문이어야 합니다."); return false; } } if ((sko < '0' || sko > '9') && (sko < 'a' || sko > 'z')) { alert("영문 소문자와 숫자만 입력하세요!"); //숫자 혹은 영소문자가 아닌 글자가 하나라도 있으면 //false를 반환하고 이하는 수행안함. return false; } } return true; } function strLengthCheck(number) { if(number < 3 || number > 20) { alert("3자 이상 20자 이하로 입력하십시요"); return false; } else { return true; } } function get_move(url) { document.location.href=url; } function get_pop_move(url) { window.open(url, 'popWin', ''); } var varSYMBOL = "~!@#$%^&*() -+|.:/,?"; // 공백 검사 function isEmpty(varCk) { if ((varCk == "") || (varCk == null)) { return true; } return false; } // 입력 문자열 검사 (영자/숫자/특수문자) function isString(varCk, charSet) { var chk=true; for (i=0; i<=varCk.length-1; i++) { ch = varCk.substring(i,i+1); if ((ch>="0" && ch<="9") || (ch>="a" && ch<="z") || (ch>="A" && ch<="Z")) { chk = true; } else { chk=false; for (j=0; j<=charSet.length-1; j++) { comp = charSet.substring(j,j+1); if (ch==comp) { chk = true; break; } } if (!chk) break; // 영자/숫자/특수문자외의 문자가 있는 경우만 error 종료 2002.04.08 } } return chk; } // 입력 문자열 검사 (숫자/특수문자) function isInteger(varCk, charSet) { var chk=true; for (i=0; i<=varCk.length-1; i++) { ch = varCk.substring(i,i+1); if (ch>="0" && ch<="9") { chk = true; } else { chk=false; for (j=0; j<=charSet.length-1; j++) { comp = charSet.substring(j,j+1); if (ch==comp) { chk = true; break; } } if (!chk) break; // 숫자+특수문자외의 문자가 있는 경우만 error 종료 2002.04.08 } } return chk; } //onKeyUp시 사용된다. 메시지를 보여준다. function isNumber( InputBox ) { if(InputBox.value == "" ) { return (true); } var checkOK = "0123456789"; var checkStr = InputBox.value; var allValid = true; var decPoints = 0; var allNum = ""; var MinusYN; if( InputBox.value=="NaN") InputBox.value = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) { if (ch == checkOK.charAt(j)) break; } if (j == checkOK.length) { allValid = false; break; } if (ch != ","){ allNum += ch; } } if ( !allValid ) { alert("숫자만 입력하십시오."); InputBox.value = ""; InputBox.focus(); return (false); } } // 입력 문자열 검사 (한글/특수문자) function isKor(varCk, charSet) { var chk=true; for (i=0; i<=varCk.length-1; i++) { ch = varCk.substring(i,i+1); if ((ch == "\n") || ((ch >= "ㅏ") && (ch <= "히")) || ((ch >="ㄱ") && (ch <="ㅎ"))) { chk = true; } else { chk=false; for (j=0; j<=charSet.length-1; j++) { comp = charSet.substring(j,j+1); if (ch==comp) { chk = true; break; } } if (!chk) break; // 한글+특수문자외의 문자가 있는 경우만 error 종료 2002.04.08 } } return chk; } function isEng(varCk, charSet) { var chk=true; for (i=0; i<=varCk.length-1; i++) { ch = varCk.substring(i,i+1); if ((ch>="a" && ch<="z") || (ch>="A" && ch<="Z")) { chk = true; } else { chk=false; for (j=0; j<=charSet.length-1; j++) { comp = charSet.substring(j,j+1); if (ch==comp) { chk = true; break; } } break; } } return chk; } // 입력 문자열 검사 (한글/특수문자) function isHan(varCk, charSet) { var chk=true; for (i=0; i<=varCk.length-1; i++) { ch = varCk.substring(i,i+1); if ((ch >= "가") && (ch <= "힣")) { chk = true; } else { chk = false; for (j=0; j<=charSet.length-1; j++) { comp = charSet.substring(j,j+1); if (ch == comp) { chk = true; break; } } if (!chk) break; // 한글+특수문자외의 문자가 있는 경우만 error 종료 2002.04.08 } } return chk; } // 입력된 데이타의 한글 비정상여부 체크 function isValidValue(varCk, charSet) { var chk=true; for (i=0; i= "가" && ch <= "힣") || (ch>="0" && ch<="9") || (ch>="a" && ch<="z") || (ch>="A" && ch<="Z")) { chk = true; } else { chk = false; for (j=0; j= "ㅏ") && (ch <= "히")) || ((ch >="ㄱ") && (ch <="ㅎ"))) varLen += 2; else varLen += 1; } return (varLen); } function isRegNoCheck(varCk1, varCk2) { //주민등록번호 체크 if ( (isLength(varCk1)==6) && (isLength(varCk2)==7) ) { if ( (isInteger(varCk1,"")) && (isInteger(varCk2,"")) ) { ckValue = new Array(13); var ckLastid,ckMod,ckMinus,ckLast; ckLastid = parseFloat(varCk2.substring(6,7)); ckValue[0] = parseFloat(varCk1.substring(0,1)) * 2; ckValue[1] = parseFloat(varCk1.substring(1,2)) * 3; ckValue[2] = parseFloat(varCk1.substring(2,3)) * 4; ckValue[3] = parseFloat(varCk1.substring(3,4)) * 5; ckValue[4] = parseFloat(varCk1.substring(4,5)) * 6; ckValue[5] = parseFloat(varCk1.substring(5,6)) * 7; ckValue[6] = parseFloat(varCk2.substring(0,1)) * 8; ckValue[7] = parseFloat(varCk2.substring(1,2)) * 9; ckValue[8] = parseFloat(varCk2.substring(2,3)) * 2; ckValue[9] = parseFloat(varCk2.substring(3,4)) * 3; ckValue[10] = parseFloat(varCk2.substring(4,5)) * 4; ckValue[11] = parseFloat(varCk2.substring(5,6)) * 5; ckValue[12] = 0; for (var i = 0; i<12;i++) { ckValue[12] = ckValue[12] + ckValue[i]; } ckMod = ckValue[12] %11; ckMinus = 11 - ckMod; ckLast = ckMinus % 10; if (ckLast != ckLastid) { return false; } else { return true; } } else { return false; } } else { return false; } } function chkForeignNo(number){ //외국인등록번호 체크 var nSum; var odd; var No = number; // var No = '5009186100179'; odd= (parseInt(No.charAt(7))*10)+(parseInt(No.charAt(8))) if((odd%2) != 0){ return false; } if((parseInt(No.charAt(11))!=6) && (parseInt(No.charAt(11))!=7) && (parseInt(No.charAt(11))!=8) && (parseInt(No.charAt(11))!=9)){ return false; } nSum= (parseInt(No.charAt(0))*2)+ (parseInt(No.charAt(1))*3)+ (parseInt(No.charAt(2))*4)+ (parseInt(No.charAt(3))*5)+ (parseInt(No.charAt(4))*6)+ (parseInt(No.charAt(5))*7)+ (parseInt(No.charAt(6))*8)+ (parseInt(No.charAt(7))*9)+ (parseInt(No.charAt(8))*2)+ (parseInt(No.charAt(9))*3)+ (parseInt(No.charAt(10))*4)+ (parseInt(No.charAt(11))*5); nSum = 11 - (nSum % 11); if(nSum >= 10){ nSum = nSum - 10; } nSum = nSum + 2; if(nSum >= 10){ nSum = nSum - 10; } if(nSum != (parseInt(No.charAt(12)))){ return false; } else{ return true; } } var focus_popup = null; var bdown = false; var x, y; function changeInt(num){ var temp = parseInt(num); if(isNaN(temp)){ temp = 0; } return temp; } function popup_set(p){ focus_popup = eval("document.all."+p); } function popup_move(){ if(bdown) { var distX = event.clientX - x; var distY = event.clientY - y; focus_popup.style.left =changeInt(focus_popup.style.left) + distX; focus_popup.style.top = changeInt(focus_popup.style.top) + distY; x = event.clientX; y = event.clientY; return false; } } function popup_down(){ if(event.srcElement.className == "drag") { bdown = true; x = event.clientX; y = event.clientY; } } function popup_up(){ focus_popup = null; bdown =false; } function popup_close(p){ focus_popup = null; bdown =false; eval("document.all." + p + ".style.display='none';"); eval("f = document.all." +p + "_chk;"); if(f.checked){ setCookie(f.value, 'done' , 1); } } function pop_resv_close(p){ focus_popup = null; bdown =false; eval("document.all." + p + ".style.display='none';"); } document.onmousedown = popup_down; document.onmouseup = popup_up; document.onmousemove =popup_move; // flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드) function flashWrite(url,w,h,id,bg,vars,win){ // 플래시 코드 정의 var flashStr= ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""; // 플래시 코드 출력 document.write(flashStr); } function getFileDel(name, pk, fn, field) { var ref = confirm("선택한 파일을 삭제하시겠습니까?"); if(ref == true) { common_iframe.document.location.href= fn + "/process.php?mode=file_delete&pk=" + pk + "&field=" + field; } else { document.getElementById(name).checked = false; return false; } }