PageSourceSearch

https://xn--9z2b29scmby6u.kr/comm/js/function.js?v=1.1

js xn--9z2b29scmby6u.kr collected 2026-10-06 03:43:54 UTC 12,782 bytes, 420 lines download raw bytes

1function newWin(file,width,height,scroll,resize,leftPoint){
2
3    var topPoint = (screen.height/2)-(height/2);
4    var leftPoint = (screen.width/2)-(width/2);
5
6    scroll = (scroll =='' )? 'no' : scroll;
7    resize = (resize =='' )? 'no' : resize;
8    
9    window.open (file,"","scrollbars="+scroll+",resizable="+resize+",width="+width+",height="+height+",top="+topPoint+",left="+leftPoint);
10}
11
12function newWin2(file,width,height,scroll,resize,title){
13
14    var topPoint = (screen.height/2)-(height/2);
15    var leftPoint = (screen.width/2)-(width/2);
16
17    scroll = (scroll =='' )? 'no' : scroll;
18    resize = (resize =='' )? 'no' : resize;
19    
20    var pop = window.open (file,title,"scrollbars="+scroll+",resizable="+resize+",width="+width+",height="+height+",top="+topPoint+",left="+leftPoint);
21    //try { pop.focus(); } catch(e){ alert( "팝업이 차단되어 있습니다." );}
22}
23
24function newWin3(file,width,height,title){
25
26    var topPoint = (screen.height/2)-(height/2);
27    var leftPoint = (screen.width/2)-(width/2);
28
29    scroll = 'no';
30    resize = 'no';
31    
32    window.open (file,title,"scrollbars="+scroll+",resizable="+resize+",width="+width+",height="+height+",top="+topPoint+",left="+leftPoint);
33}
34
35
36
37function number_format(number,decimals ){
38    var number_str = String(number);
39    var new_number_str = '';
40    number_info = number_str.split('.');
41    number_info_int = number_info[0];
42    if (decimals != null ) {
43    if (decimals > 0) new_number_str ='.' + ((decimals > 0) ?Math.round(Number('0.' +number_info[1]) * Math.pow(10, decimals)):'');
44    else if (decimals < 0) number_info_int = String(Math.round(Number(number_info[0]) / Math.pow(10, decimals *(-1))) *Math.pow(10, decimals*(-1)));
45    }
46    len = number_info_int.length;
47    for (i = len; i >= 0; i--) {
48    if ( (len - i) > 1 && (len - i) % 3 == 1) new_number_str = ',' + new_number_str;
49    new_number_str = number_info_int.substring(i, i+1) + new_number_str;
50    }
51    return new_number_str;
52
53    /*
54    alert(number_format(123446.234 ,-2)); // 100 단위에서 반올림
55    alert(number_format(123446.234 ,2)); // 소수점 2자리 까지만 표시
56    alert(number_format(123446.234)); // 가장 일반적인 형태
57    */
58}
59
60
61//관리자 메뉴의 메뉴의 마우스 이벤트 반응 함수
62function menuC(fm,assort){
63    if(assort==1){
64        bgColor = "#EEEEFF";
65        fontColor = "#9900FF";
66    }else{
67        bgColor = "#FFFFFF";
68        fontColor = "#000000";
69    }
70
71    fm.style.backgroundColor=bgColor;
72    fm.style.color=fontColor;
73}
74
75//입력 자릿수가 차면 다음 항목으로 이동 
76function next_col(obj,lng,next_id){
77    let str=obj.value;
78    if(str.length>=parseInt(lng) && next_id!=""){
79        document.getElementById(next_id).focus();
80    }
81}
82
83
84//엔터치면 다음으로 
85function nextCol(fm){
86    if(event.keyCode==13){
87        event.keyCode=8
88        fm.focus();
89    }
90}
91
92
93//브라우저 판별
94function chk_bw(){
95    var bw =  navigator.appName;
96    var result;
97    if(bw=='Microsoft Internet Explorer'){
98        result = 'ms';
99    }else{
100        result = 'other';
101    }
102    return result;
103}
104
105
106//문자열 치환
107function str_replace(str,src,dest){
108    var reg = new RegExp(src,"gi");
109    return str.replace(reg,dest);
110}
111
112
113//한글 검증
114function check_kor(fm){
115 var str = fm.value;
116 for(i=0; i<str.length; i++)
117 {
118  if(!((str.charCodeAt(i) > 0x3130 && str.charCodeAt(i) < 0x318F) || (str.charCodeAt(i) >= 0xAC00 && str.charCodeAt(i) <= 0xD7A3)))
119  {
120   alert("반드시 한글만 입력하세요");
121   fm.value = "";
122   return false;
123  }
124  else; // 처리
125 }
126}
127
128function cancel(str){
129    let url = str;
130    if(str=="" || str ==undefined) url = "index.html";
131    if(confirm('취소하시겠습니까?')){
132        if(str=='close') self.close();
133        else location.href=url;
134    }
135}
136
137function back(){
138    history.back(-1);
139}
140
141function url(url){
142    location.href=url;
143}
144
145function chk_pwd(pwd){
146
147    if(!pwd.match(/([a-z0-9].*[\{\}\[\]\/?.,;:|)*~`!^\-_+\<>@#\$%&'"\\(=])|([\{\}\[\]\/?.,;:|)*~`!^\-_+\<>@#\$%&'"\\(=].*[a-z0-9])/)) {
148        alert("비밀번호는 영문,숫자,특수문자를 모두 사용하셔야 합니다. \n\n영문은 대소문자를 구분합니다.");
149        return false;
150    }else{
151        return true;
152    }
153 
154}
155
156function comma(no){
157    var num = no.toString().replace(/,/g, '');
158    return num.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
159}
160// 목적: 숫자 + 소수점 입력에 대해 콤마 적용, 마지막 문자가 '.' 이어도 유지
161function comma2(no){
162    var raw = no.toString();
163    var keep_dot = raw.slice(-1) === '.';   // 마지막 문자가 '.' 인지 여부
164
165    var str = raw.replace(/,/g, '');
166    var parts = str.split('.');
167
168    var int_part = parts[0];
169    var dec_part = parts.length > 1 ? parts[1] : '';
170
171    int_part = int_part.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
172
173    var result = dec_part ? int_part + '.' + dec_part : int_part;
174
175    // 마지막이 '.' 이었으면 그대로 유지
176    if (keep_dot && dec_part === '') {
177        result = int_part + '.';
178    }
179
180    return result;
181}
182function strip_comma(no) { 
183    return no.replace(/,/g, "");
184}
185
186
187
188function top_scroll(){
189    var offset = $("#wrap").offset();
190    $('html, body').animate({scrollTop : offset.top}, 400);
191}
192
193function print_preview(){
194
195  var browser = navigator.userAgent.toLowerCase();
196  if ( -1 != browser.indexOf('chrome') ){
197             window.print();
198  }else if ( -1 != browser.indexOf('trident') ){
199     try{
200          //웹 브라우저 컨트롤 생성
201          var webBrowser = '<OBJECT ID="previewWeb" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
202
203          //웹 페이지에 객체 삽입
204          document.body.insertAdjacentHTML('beforeEnd', webBrowser);
205
206          //ExexWB 메쏘드 실행 (7 : 미리보기 , 8 : 페이지 설정 , 6 : 인쇄하기(대화상자))
207          previewWeb.ExecWB(7, 1);
208
209          //객체 해제
210          previewWeb.outerHTML = "";
211     }catch (e) {
212          alert("- 도구 > 인터넷 옵션 > 보안 탭 > 신뢰할 수 있는 사이트 선택\n   1. 사이트 버튼 클릭 > 사이트 추가\n   2. 사용자 지정 수준 클릭 > 스크립팅하기 안전하지 않은 것으로 표시된 ActiveX 컨트롤 (사용)으로 체크\n\n※ 위 설정은 프린트 기능을 사용하기 위함임");
213     }
214            
215  }
216  
217}
218
219function checked_all(class_name,obj){
220    $("."+class_name).attr("checked",obj.checked);
221}
222
223   
224function ftc(str){
225    var wrkr_no = numbersOnly = str.replace(/\D/g, "")
226    var url ="https://www.ftc.go.kr/info/bizinfo/communicationViewPopup.jsp?wrkr_no="+wrkr_no;
227    window.open(url, "communicationViewPopup", "width=750, height=700;");
228}
229
230function sns_share(sns) {
231    var thisUrl = document.URL;
232    var snsTitle = "<?=$rs2[subject]?>";
233    if( sns == 'facebook' ) {
234        var url = "http://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(thisUrl);
235        window.open(url, "", "width=486, height=286");
236    }
237    else if( sns == 'twitter' ) {
238        var url = "http://twitter.com/share?url="+encodeURIComponent(thisUrl)+"&text="+encodeURIComponent(snsTitle);
239        window.open(url, "tweetPop", "width=486, height=286,scrollbars=yes");
240    }
241    else if( sns == 'band' ) {
242        var url = "http://www.band.us/plugin/share?body="+encodeURIComponent(snsTitle)+"&route="+encodeURIComponent(thisUrl);
243        window.open(url, "shareBand", "width=400, height=500, resizable=yes");
244    } 
245}
246
247/*빈값 체크*/
248function is_empty(str){    
249    if(typeof str == "undefined" || str == null || str == "")
250        return true;
251    else
252        return false ;
253}
254
255
256function phone_type(input) {
257    const cleaned = input.replace(/\D/g, '');
258
259    if (cleaned.length === 8) {
260        return cleaned.replace(/(\d{4})(\d{4})/, '$1-$2');
261    }
262    else if (cleaned.length === 10) {
263        if (cleaned.startsWith('02')) {
264            return cleaned.replace(/(\d{2})(\d{4})(\d{4})/, '$1-$2-$3');
265        }
266        return cleaned.replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3');
267    }
268    else if (cleaned.length === 11) {
269        return cleaned.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3');
270    } else {
271        return input;
272    }
273}
274
275
276/*캡차이미지 새로고침*/
277function reload_captcha(){
278    $("#img_captcha").attr("src","/comm/script/captcha.php");
279}
280
281
282$(function(){
283
284    $(".numberic,.numberic_m").on("focus",function(){this.select();});
285    $(".numberic").keyup(function() {
286        var val = $(this).val();
287        val = val.replace(/(?!^)-/g, '');
288        val = val.replace(/[^0-9-]/g, '');
289        $(this).val(val);
290    });
291    $(".numberic_m").keyup(function() {
292        var val = $(this).val();
293        // 맨 앞의 - 만 허용
294        val = val.replace(/(?!^)-/g, '');
295        // 첫 번째 . 만 남기고 나머지 . 제거
296        val = val.replace(/(\..*)\./g, '$1');
297        // 숫자, ., - 만 허용
298        val = val.replace(/[^0-9\.-]/g, '');
299        $(this).val(val);
300    });
301
302
303    $('.comma').on('keyup', function(e) {
304        $(this).val(comma(this.value));
305        if (e.keyCode === 9) {
306            var $this = $(this);
307            setTimeout(function() {
308                $this.select();
309            }, 0);
310        }
311    });
312    $('.comma2').on('keyup', function() {
313        $(this).val(comma2(this.value));
314    });
315    $('.comma').on('mouseup', function() {
316        $(this).select();
317    });
318
319
320    $("#keyword").on('focus',function(){
321        if($(this).val()=="검색어를 입력해주세요.") $(this).val('');
322    });
323    $("#keyword").on('blur',function(){
324        if($(this).val()=="") $(this).val('');
325    });
326
327
328    $(".dateinput").datepicker({
329        dateFormat: "yy/mm/dd",
330        numberOfMonths: 1,
331        showMonthAfterYear: true,
332        showButtonPanel: true,
333        changeMonth: true,
334        changeYear: true,        
335        closeText: '닫기',
336        prevText: '이전',
337        nextText: '다음',
338        currentText: '오늘',
339        monthNames: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
340        monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
341        dayNames: ['일','월', '화', '수', '목', '금', '토'],
342        dayNamesShort: ['일','월', '화', '수', '목', '금', '토'],
343        dayNamesMin: ['일','월', '화', '수', '목', '금', '토'],
344        weekHeader: '일',
345    });
346
347
348    $(".biz_no,#biz_no").mask("000-00-00000");
349    $(".birth,.dateinput").mask("0000/00/00");
350    $('.birth6').mask('000000');
351    $('.birth8').mask('000000-0');
352    $('#cell,.cell').mask('000-0000-0000');
353    /*
354    $(".cell").on("keyup",function(){ 
355        $(this).val( $(this).val().replace(/[^0-9]/g, "").replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3").replace("--", "-") );
356    });
357    */    
358    $('#cell1').mask('000');
359    $('#cell2').mask('0000');
360    $('#cell3').mask('0000');
361    $('#phone1').mask('0000');
362    $('#phone2').mask('0000');
363    $('#phone3').mask('0000');  
364    $('.ip').mask('0ZZ.0ZZ.0ZZ.0ZZ', {
365        translation: {
366          'Z': {
367            pattern: /[0-9]/, optional: true
368          }
369        }
370      });   
371
372    $("#cell1").on("keyup",function(){next_col(this,3,'cell2');});
373    $("#cell2").on("keyup",function(){next_col(this,4,'cell3');});
374    $("#cell3").on("keyup",function(){next_col(this,4,'');});
375
376    // 실제여행자 휴대폰 분리 입력 필드: 붙여넣기·빠른연타 시 maxlength 강제
377    // paste 직후 input 이벤트에서 숫자만 추출 후 자리수 제한
378    $(document).on('input', '[id^="tourist_cell1_"]', function() {
379        var val = $(this).val().replace(/[^0-9]/g, '');
380        $(this).val(val.slice(0, 3));
381    });
382    $(document).on('input', '[id^="tourist_cell2_"],[id^="tourist_cell3_"]', function() {
383        var val = $(this).val().replace(/[^0-9]/g, '');
384        $(this).val(val.slice(0, 4));
385    });
386    $("#phone1").on("keyup",function(){next_col(this,3,'phone2');});
387    $("#phone2").on("keyup",function(){next_col(this,4,'phone3');});
388    $("#phone3").on("keyup",function(){next_col(this,4,'');});
389    $(".phone").on("keyup",function(){
390        console.log($(this).val());
391        let phone = $(this).val();
392        phone = phone_type(phone);
393        $(this).val(phone);
394    });    
395
396    $(".img_resize").imgLiquid();
397
398
399    $(".airport").autocomplete({
400        source: "/comm/script/data_airport.php",
401        minLength: 1,
402        focus: function(event, ui) {
403            return false;
404        }
405    });
406
407
408    $("#keyword").autocomplete({
409        source: "/comm/script/data_keyword.php",
410        minLength: 1,
411        focus: function(event, ui) {
412            return false;
413        }
414    });
415
416    $(".draggable").draggable();
417
418    $('input').attr('autocomplete', 'off');
419
420});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.