/*----------------------------------------------------------------- !링크의 포커스 라인 제거 -----------------------------------------------------------------*/ function allblur() { var ln = 0; try { ln = document.links.length; } catch(e) { return; } for (i = 0; i < ln; i++) { document.links[i].onfocus = document.links[i].blur; } } document.onfocusin = allblur; /* document.onfocusin = function() { var tagName = event.srcElement.tagName; if(tagName == "A" || tagName == "IMG") document.body.focus(); } */ /*----------------------------------------------------------------- !페이지 스크롤 업 -----------------------------------------------------------------*/ var scrollUpDelay = 1; var scrollUpSpeed = 70; function scrollUp() { //한번에 이동 scroll(0,0); return; if(document.body.scrollTop<1) { return; } document.body.scrollTop=document.body.scrollTop-scrollUpSpeed; setTimeout('scrollUp()',scrollUpDelay); } /*----------------------------------------------------------------- !로그인 옵션 디스플레이 컨트롤 -----------------------------------------------------------------*/ function showLoginOption() { document.all["loginOptionLayer"].style.visibility='visible'; } function hideLoginOption() { document.all["loginOptionLayer"].style.visibility='hidden'; } /*----------------------------------------------------------------- !검색 옵션 디스플레이 컨트롤 -----------------------------------------------------------------*/ function showSearchOption() { document.all["searchOptionLayer"].style.visibility='visible'; } function hideSearchOption() { document.all["searchOptionLayer"].style.visibility='hidden'; } /*----------------------------------------------------------------- !숫자에 ,를 넣어 금액 형태로 변환함 :: PHP와 동일 -----------------------------------------------------------------*/ function number_format(str) { str+=""; var objRegExp = new RegExp('(-?[0-9]+)([0-9]{3})'); while(objRegExp.test(str)) { str = str.replace(objRegExp, '$1,$2'); } return str; } /*----------------------------------------------------------------- !정규식체크 :: PHP와 동일 -----------------------------------------------------------------*/ function ereg(exp,str) { exp = new RegExp(exp); exp = str.match(exp); return exp; } function eregi(exp,str) { exp = new RegExp(exp,"gi"); exp = str.match(exp); return exp; } /*----------------------------------------------------------------- 치환 -----------------------------------------------------------------*/ function eregi_replace(ereg, dest, str) { ereg = eval("/"+ereg+"/gim"); return str.replace(ereg, dest); } /*----------------------------------------------------------------- !좌우공백제거 :: PHP와 동일 -----------------------------------------------------------------*/ function trim(str) { var exp = new RegExp("^( )+"); str = str.replace(exp,""); exp = new RegExp("( )+$"); str = str.replace(exp,""); return str; } /*----------------------------------------------------------------- !오토포커스 :: 폼의 내용이 있으면 select, 없으면 focus 호출 -----------------------------------------------------------------*/ function focusing(obj) { if(obj.value) { try { obj.select(); obj.focus(); } catch(e){} } else { try { obj.focus(); } catch(e){} } } /*----------------------------------------------------------------- !다이얼로그 띄우기 -----------------------------------------------------------------*/ var mdWindow; function mdOpen(url,width,height,top,left) { if(mdWindow) { try { mdWindow.window.close(); } catch(e){} } var sFeatures = "dialogTop: "+top+"; dialogLeft: "+left+"; dialogWidth: "+width+"px; dialogHeight: "+height+"px; center: yes; help: no; resizable: no; status: no; scroll: no;"; mdWindow = window.showModelessDialog(url, "_blank", sFeatures); } /*----------------------------------------------------------------- !숫자만 허용하기 -----------------------------------------------------------------*/ function setInt(obj) { var start = '0'; var newStr = ''; var str = obj.value; for(var i=0,j=0;inum) { alert(num+'개 까지만 선택 가능 합니다'); return false; } } /*----------------------------------------------------------------- !문자메세지창 -----------------------------------------------------------------*/ function popupSMS() { ok_popup=window.open("/main/popup/sms/popup_smsSend.php","sms_popup","width=550,height=655,top=30,left=30,scrollbars=yes,resizable=no"); ok_popup.focus(); } function popupSMSlist() { ok_popup=window.open("/main/popup/sms/popup_smsList.php","sms_popup","width=550,height=635,top=30,left=30,scrollbars=yes,resizable=no"); ok_popup.focus(); } /*----------------------------------------------------------------- !통보메세지창 -----------------------------------------------------------------*/ function popupMsg() { ok_popup=window.open("/main/popup/msg/popup_msgList.php","msg_popup","width=519,height=635,top=30,left=30,scrollbars=yes,resizable=no"); if(ok_popup) { ok_popup.focus(); } } function popupMsgView(no) { ok_popup=window.open("/main/popup/msg/popup_msgList.php?id="+no,"msg_popup","width=519,height=635,top=30,left=30,scrollbars=yes,resizable=no"); ok_popup.focus(); } /*----------------------------------------------------------------- !메모장 -----------------------------------------------------------------*/ function popupNote() { ok_popup=window.open("/main/popup/note/popup_noteWrite.php","note_popup","width=519,height=635,top=30,left=30,scrollbars=yes,resizable=no"); ok_popup.focus(); } /*----------------------------------------------------------------- !도움말메인 -----------------------------------------------------------------*/ function popupHelp() { var url = "/main/popup/help/popup_helpsMain.php?mode=help"; ok_popup=window.open(url,"help_popup","width=600,height=635,top=30,left=30,scrollbars=yes,resizable=yes"); ok_popup.focus(); } /*----------------------------------------------------------------- !도움말목록 -----------------------------------------------------------------*/ function popupHelpList(s) { var url = "/main/popup/help/popup_helpsList.php?mode=help"; if(s) { url += "&sw=" + s; // URL encode는 하지 않는다. } ok_popup=window.open(url,"help_popup","width=600,height=635,top=30,left=30,scrollbars=yes,resizable=yes"); ok_popup.focus(); } /*----------------------------------------------------------------- !도움말 카테고리 목록 -----------------------------------------------------------------*/ function popupHelpCat(c) { var url = "/main/popup/help/popup_helpsList.php?mode=help"; if(c) { url += "&cat=" + c; // URL encode는 하지 않는다. } ok_popup=window.open(url,"help_popup","width=600,height=635,top=30,left=30,scrollbars=yes,resizable=yes"); ok_popup.focus(); } /*----------------------------------------------------------------- !도움말메인 -----------------------------------------------------------------*/ function popupHelp2() { var url = "/main/popup/help/popup_helpsMain.php?mode=help&ad=1"; ok_popup=window.open(url,"help_popup","width=600,height=635,top=30,left=30,scrollbars=yes,resizable=yes"); ok_popup.focus(); } function popupHelpList2(s) { var url = "/main/popup/help/popup_helpsList.php?mode=help&ad=1"; if(s) { url += "?sw=" + s; // URL encode는 하지 않는다. } ok_popup=window.open(url,"help_popup","width=600,height=635,top=30,left=30,scrollbars=yes,resizable=yes"); ok_popup.focus(); } /*----------------------------------------------------------------- !도움말 및 FAQ바로가기 -----------------------------------------------------------------*/ function popupHelpView(no, templete, mode) { var url = "/main/popup/help/popup_helpsView.php?mode="+mode+"&no=" + no; if(templete) { url += "&templete=" + templete; } ok_popup=window.open(url,"help_popup","width=700,height=635,top=30,left=30,scrollbars=yes,resizable=yes"); ok_popup.focus(); } /*----------------------------------------------------------------- !FAQ메인 -----------------------------------------------------------------*/ function popupFaq() { ok_popup=window.open("/main/popup/help/popup_helpsMain.php?mode=faq","help_popup","width=600,height=635,top=30,left=30,scrollbars=yes,resizable=no"); ok_popup.focus(); } /*----------------------------------------------------------------- 이미지창 띄우기 -----------------------------------------------------------------*/ function popupImageView(url) { ok_popup=window.open("/main/popup/image/popup_imageView.php?url="+url+"&width="+screen.width+"&height="+screen.height,"image_popup","width=330,height=330,top=30,left=30,scrollbars=yes,resizable=yes"); ok_popup.focus(); } /*----------------------------------------------------------------- 카테고리 검색 띄우기 -----------------------------------------------------------------*/ function openKeywordRank(word) { ok_popup=window.open("/main/popup/keyword/popup_keywordRank.php?word="+word,"keyword_popup","width=740,height=450,top=30,left=30,scrollbars=no,resizable=no"); ok_popup.focus(); } /*----------------------------------------------------------------- 카테고리 검색 띄우기 -----------------------------------------------------------------*/ function findCategory(tar) { ok_popup=window.open("/main/popup/category/popup_findCategory.php?tar="+tar,"category_popup","width=740,height=450,top=30,left=30,scrollbars=yes,resizable=yes"); ok_popup.focus(); } /*----------------------------------------------------------------- 참가확인서 출력 -----------------------------------------------------------------*/ function popupSchJoin(no) { ok_popup=window.open("/main/myPage/schedule/my_schPrint.php?no="+no,"sch_popup","width=600,height=500,top=30,left=30,scrollbars=yes,resizable=yes,menubar,status"); ok_popup.focus(); } /*----------------------------------------------------------------- 세금계산서 출력 -----------------------------------------------------------------*/ function popupTax(no) { ok_popup=window.open("/main/myPage/tax/my_taxPrint.php?no="+no,"tax_popup","width=735,height=495,top=30,left=30,scrollbars=yes,resizable=yes,menubar,status"); ok_popup.focus(); } function popupTax2(no) { ok_popup=window.open("/main/myPage/tax/my_taxPrint2.php?no="+no,"tax_popup","width=735,height=495,top=30,left=30,scrollbars=yes,resizable=yes,menubar,status"); ok_popup.focus(); } function popupTax2m(wh, total) { ok_popup2=window.open('/main/myPage/tax/my_taxPrint2m.php?wh=' + wh + '&total=' + total, 'tax_popup_control', 'width=200, height=495, top=30, left=786, scrollbars=yes, resizable=yes, menubar, status'); ok_popup2.focus(); ok_popup=window.open("/main/myPage/tax/my_taxPrint2.php?wh="+wh,"tax_popup","width=735,height=495,top=30,left=30,scrollbars=yes,resizable=yes,menubar,status"); ok_popup.focus(); } function popupRTax(no) { ok_popup=window.open("/main/myPage/tax/my_taxPrint.php?req=1&no="+no,"tax_popup","width=735,height=495,top=30,left=30,scrollbars=yes,resizable=yes,menubar,status"); ok_popup.focus(); } function popupRTax2(no) { ok_popup=window.open("/main/myPage/tax/my_taxPrint2.php?req=1&no="+no,"tax_popup","width=735,height=495,top=30,left=30,scrollbars=yes,resizable=yes,menubar,status"); ok_popup.focus(); } function popupTaxDetail(no) { ok_popup=window.open("/main/myPage/tax/my_taxPrintDetail.php?no="+no,"tax_popup","width=700,height=495,top=30,left=30,scrollbars=yes,resizable=no,menubar,status"); ok_popup.focus(); } // BLUE function popupTaxFreebill(sn, sc) { ok_popup=window.open("http://playauto.manager.freebill.co.kr/?tpf=admin/form/view&sn=" + sn + "&sc=" + sc + "&confirm=Y","tax_popup","width=940,height=730,top=30,left=30,scrollbars=yes,resizable=yes,menubar,status"); ok_popup.focus(); } function popupTaxFreebill2(ai, sc) { ok_popup=window.open("http://naggama.freebill.co.kr/web/api/VIEW/" + ai + "/" + sc,"tax_popup","width=940,height=730,top=30,left=30,scrollbars=yes,resizable=yes,menubar,status"); ok_popup.focus(); } // RED function popupTaxFreebill3(ai) { ok_popup=window.open("http://playauto.manager.freebill.co.kr/?tpf=admin/form/view&form_type=tax&__q=pkc0uvuoaef8ghttrj9c9qvir2&code=" + ai,"tax_popup","width=940,height=730,top=30,left=30,scrollbars=yes,resizable=yes,menubar,status"); ok_popup.focus(); } /*----------------------------------------------------------------- !목록통관 필독사항 (해외오픈마켓) // 한상현 추가 -----------------------------------------------------------------*/ function popupImportInfo() { ok_popup=window.open("/main/popup/seller/popup_importInfo.php","import_popup","width=630,height=450,top=30,left=30,scrollbars=yes,resizable=yes"); ok_popup.focus(); } /*----------------------------------------------------------------- !한글을 포함한 문자열길이 구하기 -----------------------------------------------------------------*/ function strlen(str) { var i, j=0; for(i=0; i 4) return 2; else return 1; } /*----------------------------------------------------------------- !엔터키 입력 방지 -----------------------------------------------------------------*/ function noEnter() { if(event.keyCode == 13) { event.returnValue=false; } } /*----------------------------------------------------------------- !그달의 날짜를 selectBox에 지정하기 :: obj는 지정될 selectBox -----------------------------------------------------------------*/ function setDaysOfMonth(year,month,obj,noUnit,gap) { if(!year) { year=2026; } if(!month) { month='1'; } if(ereg("^0",month)) { month = month.substr(1,1); } month = parseInt(month); if(!gap) gap = 0; lastDay = getLastDay(year,month); for(var i=obj.length-1; i>=gap; i--) { obj.options[i] = null; } for(var i=1,j=gap; i<=lastDay; i++,j++) { i = (i<10)?"0"+i:i; if(!noUnit) { obj.options[j]=new Option(i+"일",i); } else { obj.options[j]=new Option(i,i); } } } /*----------------------------------------------------------------- !그달의 마지막 날자를 구하기 -----------------------------------------------------------------*/ function getLastDay(year,month) { var lastDayArray = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31); lastDay = lastDayArray[month]; if(month==2) { if(year%100 == 0) { if(year%400 == 0) { lastDay = 29; } } else if(year%4 == 0) { lastDay = 29; } } return lastDay; } /*----------------------------------------------------------------- !자동 폼 paste :: obj->시작폼필드, maxStep->paste될 폼갯수 -----------------------------------------------------------------*/ function catchPaste(obj, maxStep) { var step=0,add=0; var sText = clipboardData.getData('Text'); do { if(obj.type == 'text') { obj.value = sText.substr(0,obj.size); add = (sText.substr(obj.size,1).search(/[a-zA-Z0-9]/) != -1) ? 0 : 1; sText = sText.substr(obj.size+add); if(++step == maxStep) break; } } while(obj = obj.nextSibling) return false; } /*----------------------------------------------------------------- !서브메뉴를 표시함 :: id는 서브메뉴가 정의된 레이어 id -----------------------------------------------------------------*/ function showSubMenu(id) { try { subMenuArea.innerHTML=id.innerHTML; } catch(e) {} } /*----------------------------------------------------------------- !body클릭시 기본실행 -----------------------------------------------------------------*/ function defaultBodyOnclick() { try { hide_popupLayer(); } catch(e) {} } /*----------------------------------------------------------------- !회원관리메뉴를 표시함 -----------------------------------------------------------------*/ var memberToolID; function showMemberTool(id) { if(memberToolID) { memberToolID.style.visibility='hidden'; } memberToolID = eval(id); memberToolID.style.visibility='visible'; } function hideMemberTool(id) { memberToolID.style.visibility='hidden'; } /*----------------------------------------------------------------- !숫자를 한글로 읽기 -----------------------------------------------------------------*/ var arrKor1 = new Array('','일','이','삼','사','오','육','칠','팔','구'); var arrKor3 = new Array("","십","백","천"); var arrKor2 = new Array("","만","억","조","경","해","시","양","구","간","정"); function numToKorean(num) { delimiter = ' '; bPos = 0; sPos = 0; digit = 0; szDigit = ''; is_start = false; appendFF = false; len = num.length; szHan = ''; for (i=len-1;i>=0;i--) { szDigit=num.substring(i,i+1); digit=parseInt(szDigit); if (digit!=0) { if (bPos!=0 && sPos==0) { if (is_start==true) szHan += delimiter; szHan += arrKor2[bPos]; appendFF=false; } if (bPos!=0 && appendFF==true) { if (is_start==true) szHan += delimiter; szHan += arrKor2[bPos]; appendFF=false; } if (sPos!=0) szHan += arrKor3[sPos]; szHan += arrKor1[digit]; is_start=true; } else if (sPos==0 && bPos!=0) appendFF=true; sPos++; if (sPos%4==0) { sPos=0; bPos++; if (bPos>=4) return "(범위초과)"; } } if (is_start==false) szHan += "영"; rslt = ''; for(i = szHan.length - 1; i >= 0; i--) { rslt += szHan.substring(i, i + 1); } return rslt; } /*----------------------------------------------------------------- !순서설정 -----------------------------------------------------------------*/ function gou(obj) { //폼지정 formSel = obj; //선택된 항목이 없으면 리턴 if(!formSel.value) { return; } //현재항목 thisIndex = formSel.selectedIndex; //첫번째 항목은 리턴 if(!thisIndex) { return; } //포커스제거 formSel.value=null; //상위항목 prevIndex=thisIndex-1; //상위항목의 내용을 저장 tempText=formSel.options[prevIndex].text; tempValue=formSel.options[prevIndex].value; //상위항목에 선택된 항목의 내용을 삽입 formSel.options[prevIndex] = new Option(formSel.options[thisIndex].text,formSel.options[thisIndex].value); //선택된항목에 상위 항목의 내용을 삽입 formSel.options[thisIndex] = new Option(tempText,tempValue); //포커스를 다시 줌 formSel.options[prevIndex].selected=true; } function god(obj) { //폼지정 formSel = obj; //선택된 항목이 없으면 리턴 if(!formSel.value) { return; } //현재항목 thisIndex = formSel.selectedIndex; //마지막 항목은 리턴 if(thisIndex+1>=formSel.length) { return; } //포커스제거 formSel.value=null; //하위항목 prevIndex=thisIndex+1; //하위항목의 내용을 저장 tempText=formSel.options[prevIndex].text; tempValue=formSel.options[prevIndex].value; //하위항목에 선택된 항목의 내용을 삽입 formSel.options[prevIndex] = new Option(formSel.options[thisIndex].text,formSel.options[thisIndex].value); //선택된항목에 상위 항목의 내용을 삽입 formSel.options[thisIndex] = new Option(tempText,tempValue); //포커스를 다시 줌 formSel.options[prevIndex].selected=true; } function got(obj) { //폼지정 var bufferValue = new Array(); var bufferText = new Array(); var formSel = obj; //선택된 항목이 없으면 리턴 if(!formSel.value) { return; } //현재항목 var thisIndex = formSel.selectedIndex; bufferValue[0] = formSel.options[thisIndex].value; bufferText[0] = formSel.options[thisIndex].text; //첫번째 항목은 리턴 if(!thisIndex) { return; } //포커스제거 formSel.value=null; //모든 항목 로드 for(var i=0, j=1; i=0; i--) { formSel.options[i] = null; } //모든 항목 삽입 for(var i=0; i=0; i--) { formSel.options[i] = null; } //모든 항목 삽입 for(var i=0; i0) { thisObj.style.left=event.clientX+1 - thisObj.adjustX; } if(event.clientY - thisObj.adjustY>0) { thisObj.style.top=event.clientY+1 - thisObj.adjustY; } } } function fnUpdate() { iOffset=parseInt(oOffset.value); } /*----------------------------------------------------------------- 쿠키 컨트롤 -----------------------------------------------------------------*/ function setCookie(name,value,day) { var exp = ''; if(day > 0) { var today= new Date(); today.setDate(today.getDate() + day); exp = " expires=" + today.toGMTString() + ";"; } document.cookie = name + "=" + escape(value) + "; path=/;" + exp + ";" } function getCookie(name) { var re = new RegExp("\\b"+name+"\\=([^;]*)","ig"); document.cookie.match(re) return unescape(RegExp.$1); } function setCookiePack(name, value) { var xmlHTTPReq; var url = '/main/common/object/cookiePack/cookie_proc.php'; var params = 'mode=set&name=' + name + '&value=' + value; if(window.XMLHttpRequest) { try { xmlHTTPReq = new XMLHttpRequest(); } catch(e) { xmlHTTPReq = false; } } else if(window.ActiveXObject) { try { xmlHTTPReq = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHTTPReq = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlHTTPReq = false; } } } if(xmlHTTPReq) { xmlHTTPReq.open("POST", url, true); xmlHTTPReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHTTPReq.setRequestHeader("Content-length", params.length); xmlHTTPReq.setRequestHeader("Connection", "close"); xmlHTTPReq.send(params); xmlHTTPReq.onreadystatechange = function() { if (xmlHTTPReq.readyState == 4 && xmlHTTPReq.status == 200) { } } } } /*----------------------------------------------------------------- !int형으로 변환 -----------------------------------------------------------------*/ function getInt(str) { str = str.toString(); str = eregi_replace("[^0-9]", "", str); str = parseInt(str, 10); if(isNaN(str)) { str = 0; } return str; } /*----------------------------------------------------------------- !float형으로 변환 -----------------------------------------------------------------*/ function getFloat(str) { str = str.toString(); // 숫자와 점(.) 이외의 문자를 모두 제거 str = str.replace(/[^0-9.]/gi, ""); // 첫 번째 점 이후에 나타나는 점(.)은 모두 제거 (즉, 소수점은 하나만 허용) var dotIndex = str.indexOf('.'); if (dotIndex !== -1) { str = str.substring(0, dotIndex + 1) + str.substring(dotIndex + 1).replace(/\./g, ""); } str = parseFloat(str); if (isNaN(str)) { str = 0; } return str; } /*----------------------------------------------------------------- 타이머 discountTimer(일, 시, 분, 초, 결과표시위치, [종료메세지]) -----------------------------------------------------------------*/ function discountTimer(dd, hh, mm, ss, dest, msgEnd) { if(!msgEnd) { msgEnd = '기간이 종료되었습니다'; } ss = ss - 1; if(ss == -1) { ss = 59; mm = mm - 1; } if(mm == -1) { mm = 59; hh = hh - 1; } if(hh == -1) { hh = 23; dd = dd - 1; } if(ss == 0 && mm == 0 && hh == 0 && dd == 0) { document.getElementById(dest).innerHTML = msgEnd; return; } dd += ''; hh += ''; mm += ''; ss += ''; dd = (dd.length==1) ? '0'+dd : dd; hh = (hh.length==1) ? '0'+hh : hh; mm = (mm.length==1) ? '0'+mm : mm; ss = (ss.length==1) ? '0'+ss : ss; document.getElementById(dest).innerHTML = dd + '일 ' + hh + '시간 ' + mm + '분 ' + ss + '초 남음'; window.setTimeout("discountTimer("+dd+","+hh+","+mm+","+ss+",'"+dest+"','"+msgEnd+"')",1000); } function discountTimerMinute(dd, hh, mm, ss, dest, msgEnd, head, foot) { if(!msgEnd) { msgEnd = '기간이 종료되었습니다'; } ss = ss - 1; if(ss == -1) { ss = 59; mm = mm - 1; } if(mm == -1) { mm = 59; hh = hh - 1; } if(hh == -1) { hh = 23; dd = dd - 1; } if(ss == 0 && mm == 0 && hh == 0 && dd == 0) { document.getElementById(dest).innerHTML = msgEnd; return; } dd += ''; hh += ''; mm += ''; ss += ''; dd = (dd.length==1) ? '0'+dd : dd; hh = (hh.length==1) ? '0'+hh : hh; mm = (mm.length==1) ? '0'+mm : mm; ss = (ss.length==1) ? '0'+ss : ss; document.getElementById(dest).innerHTML = head + mm + '분 ' + ss + '초' + foot; window.setTimeout("discountTimerMinute("+dd+","+hh+","+mm+","+ss+",'"+dest+"','"+msgEnd+"','"+head+"','"+foot+"')",1000); } /*----------------------------------------------------------------- context menu열기 -----------------------------------------------------------------*/ function openContextMenu(url,width,height) { var ie=document.all; var ns6=document.getElementById && !document.all; if(typeof(e) == 'undefined') { var e = {}; ns6 = false; } if(document.compatMode!="BackCompat") { var curX=(ns6)?e.pageX : event.x+document.documentElement.scrollLeft; var curY=(ns6)?e.pageY : event.y+document.documentElement.scrollTop; } else { var curX=(ns6)?e.pageX : event.x+document.body.scrollLeft; var curY=(ns6)?e.pageY : event.y+document.body.scrollTop; } var contextMenuLayer = document.getElementById('contextMenu'); var contextMenuIframe = document.getElementById('contextMenuFrame'); contextMenuFrame.location.href = url; contextMenuLayer.style.width = width; contextMenuLayer.style.height = height; contextMenuIframe.style.width = width; contextMenuIframe.style.height = height; contextMenuLayer.style.top = curY + 15; contextMenuLayer.style.left = curX - Math.round(width/2); contextMenuLayer.style.visibility = 'visible'; } /*----------------------------------------------------------------- blink exception 추가 2005.06.24 (금) by 신동규 -----------------------------------------------------------------*/ function doBlink() { try { var blink = document.all.tags("BLINK") } catch(e) { return; } for (var i=0; i < blink.length; i++) { blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""; } } function startBlink() { var blink_speed = 600; if (document.all) { setInterval("doBlink()", blink_speed); } } startBlink(); /*----------------------------------------------------------------- 라디오 버튼의 선택된 인덱스 값 구하기 -----------------------------------------------------------------*/ function getRadioSelectedIndex(obj) { var idx = ''; for(var i=0; i"; preloadQueue[j] = obj[i]; j++; continue; } } document.getElementById('preloadArea').innerHTML = buff; for(var i=0; i = \ 공급가 + \ 세액 \ \ '; obj.innerHTML = buf; obj.style.display = 'inline'; calcVatCalc(id); } function calcVatCalc(id) { var amt = document.getElementById(id + '_1').value; amt = getInt(amt); if(!amt) { try { document.getElementById(id + '_1').focus(); } catch(e) { } return; } else { var vat = Math.floor(amt / 11); var prs = amt - vat; try { document.getElementById(id + '_2').value = prs; document.getElementById(id + '_3').value = vat; } catch(e) { } } } /*----------------------------------------------------------------- 배열검사 -----------------------------------------------------------------*/ function in_array(needle, haystack) { for(key in haystack) { if(haystack[key] == needle) { return true; } } return false; } /*----------------------------------------------------------------- 애니메이션 중지 -----------------------------------------------------------------*/ function stopAnimation() { try { if (top.window.stop !== undefined) { top.window.stop(); } else if (window.stop !== undefined) { window.stop(); } else if (top.document.execCommand !== undefined) { top.document.execCommand("Stop", false); } else if (document.execCommand !== undefined) { document.execCommand("Stop", false); } } catch (ex) { } } function safetyStopAnimation() { try { if (document.readyState == 'undefined') return; if (top.document.readyState == 'complete' && document.readyState == 'complete') { setTimeout("stopAnimation()", 50); } else { setTimeout("safetyStopAnimation()", 50); } } catch (ex) { } } /*----------------------------------------------------------------- 공사중 -----------------------------------------------------------------*/ function underconstruction() { alert('죄송합니다. 곧 오픈예정인 기능입니다'); } /*----------------------------------------------------------------- get scroll position -----------------------------------------------------------------*/ function get_scroll() { var x = 0, y = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant y = window.pageYOffset; x = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant y = document.body.scrollTop; x = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode y = document.documentElement.scrollTop; x = document.documentElement.scrollLeft; } var obj = new Object(); obj.x = x; obj.y = y; return obj; }; function getClientSize() { var obj = new Object(); obj.w = window.innerWidth? window.innerWidth: document.documentElement.clientWidth; obj.h = window.innerHeight? window.innerHeight: document.documentElement.clientHeight; return obj; } /*----------------------------------------------------------------- 주어진 ID의 객체 하위에 포함된 iframe 객체를 찾아, ggook / domeggook 외의 도메인인 경우 객체를 제거 -----------------------------------------------------------------*/ function iframeUrlCheck(id, domain, remove) { if(document.getElementById(id)) { // 둘러싸고 있는 객체 var wrapElm = document.getElementById(id); // 허용도메인 for(x in domain) { domain[x] = '(' + domain[x].replace('.', '\.') + ')'; } domain = domain.join('|'); // 체크할 조건 var checkUrl = new RegExp('^(http([s]*):\/\/){0,1}(www.){0,1}(' + domain + ')', 'g'); var delNo = ''; // 하위에 존재하는 iframe var ifmArr = wrapElm.getElementsByTagName('iframe'); var ifmCnt = ifmArr.length; for(var i=0; i