PageSourceSearch

https://www.3917majung.com/common/js/common.js?1791410221

js 3917majung.com collected 2026-10-07 21:57:22 UTC 44,133 bytes, 1,509 lines download raw bytes

1if (typeof(COMMON_JS) == 'undefined')
2{
3	//if (typeof rt_path == 'undefined')
4  // alert('rt_path 변수가 선언되지 않았습니다.');
5
6  var COMMON_JS = true;
7
8  function win_close()
9  {
10    self.opener=self;
11    window.close();
12  }
13
14  function win_open(url, name, option)
15  {
16    var popup = window.open(url, name, option);
17    popup.focus();
18  }
19
20  // 쪽지 창
21  function win_memo(url)
22  {
23    if (!url)
24    {
25      url = "/memo";
26    }
27    win_open(url, "winMemo", "left=50,top=50,width=616,height=460,scrollbars=1");
28  }
29
30  // 자기소개 창
31  function win_profile(mb_id)
32  {
33     win_open("/mb_profile/qry/"+mb_id, 'winProfile', 'left=50,top=50,width=400,height=500,scrollbars=1');
34  }
35
36  // 우편번호 창
37  function win_zip(frm_name, frm_zip1, frm_zip2, frm_addr1, frm_addr2)
38  {
39    url = "/zip/qry/"+frm_name+"/"+frm_zip1+"/"+frm_zip2+"/"+frm_addr1+"/"+frm_addr2;
40    win_open(url, "winZip", "left=50,top=50,width=616,height=460,scrollbars=1");
41  }
42
43	// POST 전송, 결과값 리턴
44  function post_del(href, parm, del)
45  {
46    if (!del || confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n정말 삭제하시겠습니까?"))
47    {
48      $.post(href, parm, function(req)
49      {
50        document.write(req);
51      });
52    }
53  }
54
55	// url 이동
56  function goto_url(href)
57  {
58    document.location.href = href;
59  }
60
61
62	// POST 전송, 결과값 리턴
63  function post_send(href, parm, del)
64  {
65    if (!del || confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n정말 삭제하시겠습니까?"))
66    {
67      $.post( href, parm, function(req)
68      {
69        document.write(req);
70      });
71    }
72  }
73
74  // POST 이동
75  function post_goto(url, parm, target)
76  {
77    $('#tmp_from').remove();
78    var f = document.createElement('form');
79
80    var objs, value;
81    for (var key in parm)
82    {
83      value = parm[key];
84      objs = document.createElement('input');
85      objs.setAttribute('type', 'hidden');
86      objs.setAttribute('name', key);
87      objs.setAttribute('value', value);
88      f.appendChild(objs);
89    }
90
91    if (target)
92    {
93      f.setAttribute('target', target);
94    }
95
96    f.setAttribute('method', 'post');
97    f.setAttribute('action', url);
98    f.setAttribute('id', 'tmp_from');
99    document.body.appendChild(f);
100    f.submit();
101    $('#tmp_from').remove();
102  }
103
104  // get 이동
105  function get_goto(url, parm, target)
106  {
107    $('#tmp_from').remove();
108    var f = document.createElement('form');
109
110    var objs, value;
111    for (var key in parm)
112    {
113      value = parm[key];
114      objs = document.createElement('input');
115      objs.setAttribute('type', 'hidden');
116      objs.setAttribute('name', key);
117      objs.setAttribute('value', value);
118      f.appendChild(objs);
119    }
120
121    if (target)
122    {
123      f.setAttribute('target', target);
124    }
125
126    f.setAttribute('method', 'get');
127    f.setAttribute('action', url);
128    f.setAttribute('id', 'tmp_from');
129    document.body.appendChild(f);
130    f.submit();
131    $('#tmp_from').remove();
132  }
133
134  // POST ì°½
135  function post_win(name, url, parm, opt)
136  {
137    var temp_win = window.open('', name, opt);
138    post_goto(url, parm, name);
139  }
140
141	// 일반 삭제 검사 확인
142  function del(href)
143  {
144    if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n정말 삭제하시겠습니까?"))
145    {
146      document.location.href = href;
147    }
148  }
149
150	// 플래시에 변수 추가 fh
151	function flash_movie(src, ids, width, height, wmode, fh)
152  {
153    var wh = "";
154    if (parseInt(width) && parseInt(height))
155    {
156      wh = " width='"+width+"' height='"+height+"' ";
157    }
158    return "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' "+wh+" id="+ids+"><param name=wmode value="+wmode+"><param name=movie value="+src+"><param name=quality value=high><param name=flashvars value="+fh+"><embed src="+src+" quality=high wmode="+wmode+" flashvars="+fh+" type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash' "+wh+"></embed></object>";
159  }
160
161	// 동영상 파일
162  function obj_movie(src, ids, width, height, autostart)
163  {
164    var wh = "";
165    if (parseInt(width) && parseInt(height))
166    {
167      wh = " width='"+width+"' height='"+height+"' ";
168    }
169    if (!autostart) autostart = false;
170    return "<embed src='"+src+"' "+wh+" autostart='"+autostart+"'></embed>";
171  }
172
173	// 아이프레임 높이 자동조절
174	function reSize(obj)
175  {
176		try
177    {
178			var objBody = frames[obj].document.body;
179			var objFrame = document.getElementById(obj);
180			ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
181			objFrame.style.height = ifrmHeight;
182		}
183		catch(e) {}
184	}
185
186  // url encodeing
187	function sEncode(val)
188  {
189		return encodeURIComponent(val).replace(/%/g, '.');
190	}
191
192  // trim
193  function trim(s)
194  {
195    var t = "";
196    var from_pos = to_pos = 0;
197
198    for (i=0; i<s.length; i++)
199    {
200      if (s.charAt(i) == ' ')
201      {
202        continue;
203      }
204      else
205      {
206        from_pos = i;
207        break;
208      }
209    }
210
211    for (i=s.length; i>=0; i--)
212    {
213      if (s.charAt(i-1) == ' ')
214      {
215        continue;
216      }
217      else
218      {
219        to_pos = i;
220        break;
221      }
222    }
223
224    t = s.substring(from_pos, to_pos);
225    return t;
226  }
227
228  // trim
229  function sTrim(str)
230  {
231    str = str.replace(/(^\s*)|(\s*$)/gi, "");
232    return str;
233  }
234
235  // rtrim
236  function srTrim(str)
237  {
238    str = str.replace(/\s+$/, "");
239    return str;
240  }
241
242  // ltrim
243  function slTrim(str)
244  {
245    str = str.replace(/^\s+/, "");
246    return str;
247  }
248
249  // script 에서 js 파일 로드
250  function importScript(FILES)
251  {
252    var _importScript = function(filename)
253    {
254      if (filename)
255      {
256        document.write('<script type="text/javascript" src="'+rt_path+'/js/'+filename+'.js"></s'+'cript>');
257      }
258    };
259
260    for (var i=0; i<FILES.length; i++)
261    {
262      _importScript(FILES[i]);
263    }
264  }
265
266  // jQuery textarea
267  function txresize(tx, type, size) {
268      var tx = $('#'+tx);
269      if (type == 1)
270          tx.animate({'height':'-='+size+'px'}, 'fast');
271      else if (type == 2)
272          tx.animate({'height':size}, 'fast');
273      else if (type == 3)
274          tx.animate({'height':'+='+size+'px'}, 'fast');
275  }
276
277	// 팝업 닫기
278	function popup_close(id, onday)
279  {
280		if (onday)
281    {
282			var today = new Date();
283			today.setTime(today.getTime() + (60*60*1000*24));
284			document.cookie = id + "=" + escape( true ) + "; path=/; expires=" + today.toGMTString() + ";";
285		}
286
287		if (window.parent.name.indexOf(id) != -1)
288			window.close();
289		else
290			document.getElementById(id).style.display = 'none';
291	}
292
293  // 일반팝업창닫기 2013-10-30 강대인
294  function win_pop_close()
295  {
296    // 팝업창이 아닐경우 닫기
297    //if(typeof(window.opener) != "object" || window.opener == null)
298    //{
299    //  window.open('about:blank','_self').close();
300    //}
301
302    var nvua = navigator.userAgent;
303    if (nvua.indexOf('MSIE') >= 0)
304    {
305      if(nvua.indexOf('MSIE 5.0') == -1)
306      {
307        top.opener = '';
308      }
309    }
310    else if (nvua.indexOf('Gecko') >= 0)
311    {
312      top.name = 'CLOSE_WINDOW';
313      wid = window.open('','CLOSE_WINDOW');
314    }
315
316    top.close();
317
318  }
319
320
321  // md5 incodeing
322  function md5 (str) {
323    // http://kevin.vanzonneveld.net
324    // +   original by: Webtoolkit.info (http://www.webtoolkit.info/)
325    // + namespaced by: Michael White (http://getsprink.com)
326    // +    tweaked by: Jack
327    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
328    // +      input by: Brett Zamir (http://brett-zamir.me)
329    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
330    // -    depends on: utf8_encode
331    // *     example 1: md5('Kevin van Zonneveld');
332    // *     returns 1: '6e658d4bfcb59cc13f96c14450ac40b9'
333    var xl;
334
335    var rotateLeft = function (lValue, iShiftBits) {
336      return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
337    };
338
339    var addUnsigned = function (lX, lY) {
340      var lX4, lY4, lX8, lY8, lResult;
341      lX8 = (lX & 0x80000000);
342      lY8 = (lY & 0x80000000);
343      lX4 = (lX & 0x40000000);
344      lY4 = (lY & 0x40000000);
345      lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
346      if (lX4 & lY4) {
347        return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
348      }
349      if (lX4 | lY4) {
350        if (lResult & 0x40000000) {
351          return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
352        } else {
353          return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
354        }
355      } else {
356        return (lResult ^ lX8 ^ lY8);
357      }
358    };
359
360    var _F = function (x, y, z) {
361      return (x & y) | ((~x) & z);
362    };
363    var _G = function (x, y, z) {
364      return (x & z) | (y & (~z));
365    };
366    var _H = function (x, y, z) {
367      return (x ^ y ^ z);
368    };
369    var _I = function (x, y, z) {
370      return (y ^ (x | (~z)));
371    };
372
373    var _FF = function (a, b, c, d, x, s, ac) {
374      a = addUnsigned(a, addUnsigned(addUnsigned(_F(b, c, d), x), ac));
375      return addUnsigned(rotateLeft(a, s), b);
376    };
377
378    var _GG = function (a, b, c, d, x, s, ac) {
379      a = addUnsigned(a, addUnsigned(addUnsigned(_G(b, c, d), x), ac));
380      return addUnsigned(rotateLeft(a, s), b);
381    };
382
383    var _HH = function (a, b, c, d, x, s, ac) {
384      a = addUnsigned(a, addUnsigned(addUnsigned(_H(b, c, d), x), ac));
385      return addUnsigned(rotateLeft(a, s), b);
386    };
387
388    var _II = function (a, b, c, d, x, s, ac) {
389      a = addUnsigned(a, addUnsigned(addUnsigned(_I(b, c, d), x), ac));
390      return addUnsigned(rotateLeft(a, s), b);
391    };
392
393    var convertToWordArray = function (str) {
394      var lWordCount;
395      var lMessageLength = str.length;
396      var lNumberOfWords_temp1 = lMessageLength + 8;
397      var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
398      var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
399      var lWordArray = new Array(lNumberOfWords - 1);
400      var lBytePosition = 0;
401      var lByteCount = 0;
402      while (lByteCount < lMessageLength) {
403        lWordCount = (lByteCount - (lByteCount % 4)) / 4;
404        lBytePosition = (lByteCount % 4) * 8;
405        lWordArray[lWordCount] = (lWordArray[lWordCount] | (str.charCodeAt(lByteCount) << lBytePosition));
406        lByteCount++;
407      }
408      lWordCount = (lByteCount - (lByteCount % 4)) / 4;
409      lBytePosition = (lByteCount % 4) * 8;
410      lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
411      lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
412      lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
413      return lWordArray;
414    };
415
416    var wordToHex = function (lValue) {
417      var wordToHexValue = "",
418        wordToHexValue_temp = "",
419        lByte, lCount;
420      for (lCount = 0; lCount <= 3; lCount++) {
421        lByte = (lValue >>> (lCount * 8)) & 255;
422        wordToHexValue_temp = "0" + lByte.toString(16);
423        wordToHexValue = wordToHexValue + wordToHexValue_temp.substr(wordToHexValue_temp.length - 2, 2);
424      }
425      return wordToHexValue;
426    };
427
428    var x = [],
429      k, AA, BB, CC, DD, a, b, c, d, S11 = 7,
430      S12 = 12,
431      S13 = 17,
432      S14 = 22,
433      S21 = 5,
434      S22 = 9,
435      S23 = 14,
436      S24 = 20,
437      S31 = 4,
438      S32 = 11,
439      S33 = 16,
440      S34 = 23,
441      S41 = 6,
442      S42 = 10,
443      S43 = 15,
444      S44 = 21;
445
446    str = this.utf8_encode(str);
447    x = convertToWordArray(str);
448    a = 0x67452301;
449    b = 0xEFCDAB89;
450    c = 0x98BADCFE;
451    d = 0x10325476;
452
453    xl = x.length;
454    for (k = 0; k < xl; k += 16) {
455      AA = a;
456      BB = b;
457      CC = c;
458      DD = d;
459      a = _FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
460      d = _FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
461      c = _FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
462      b = _FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
463      a = _FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
464      d = _FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
465      c = _FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
466      b = _FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
467      a = _FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
468      d = _FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
469      c = _FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
470      b = _FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
471      a = _FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
472      d = _FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
473      c = _FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
474      b = _FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
475      a = _GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
476      d = _GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
477      c = _GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
478      b = _GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
479      a = _GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
480      d = _GG(d, a, b, c, x[k + 10], S22, 0x2441453);
481      c = _GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
482      b = _GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
483      a = _GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
484      d = _GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
485      c = _GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
486      b = _GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
487      a = _GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
488      d = _GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
489      c = _GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
490      b = _GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
491      a = _HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
492      d = _HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
493      c = _HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
494      b = _HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
495      a = _HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
496      d = _HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
497      c = _HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
498      b = _HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
499      a = _HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
500      d = _HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
501      c = _HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
502      b = _HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
503      a = _HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
504      d = _HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
505      c = _HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
506      b = _HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
507      a = _II(a, b, c, d, x[k + 0], S41, 0xF4292244);
508      d = _II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
509      c = _II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
510      b = _II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
511      a = _II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
512      d = _II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
513      c = _II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
514      b = _II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
515      a = _II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
516      d = _II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
517      c = _II(c, d, a, b, x[k + 6], S43, 0xA3014314);
518      b = _II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
519      a = _II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
520      d = _II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
521      c = _II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
522      b = _II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
523      a = addUnsigned(a, AA);
524      b = addUnsigned(b, BB);
525      c = addUnsigned(c, CC);
526      d = addUnsigned(d, DD);
527    }
528
529    var temp = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
530
531    return temp.toLowerCase();
532  }
533
534  function utf8_encode (argString) {
535    // http://kevin.vanzonneveld.net
536    // +   original by: Webtoolkit.info (http://www.webtoolkit.info/)
537    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
538    // +   improved by: sowberry
539    // +    tweaked by: Jack
540    // +   bugfixed by: Onno Marsman
541    // +   improved by: Yves Sucaet
542    // +   bugfixed by: Onno Marsman
543    // +   bugfixed by: Ulrich
544    // +   bugfixed by: Rafal Kukawski
545    // +   improved by: kirilloid
546    // *     example 1: utf8_encode('Kevin van Zonneveld');
547    // *     returns 1: 'Kevin van Zonneveld'
548
549    if (argString === null || typeof argString === "undefined") {
550      return "";
551    }
552
553    var string = (argString + ''); // .replace(/\r\n/g, "\n").replace(/\r/g, "\n");
554    var utftext = '',
555      start, end, stringl = 0;
556
557    start = end = 0;
558    stringl = string.length;
559    for (var n = 0; n < stringl; n++) {
560      var c1 = string.charCodeAt(n);
561      var enc = null;
562
563      if (c1 < 128) {
564        end++;
565      } else if (c1 > 127 && c1 < 2048) {
566        enc = String.fromCharCode((c1 >> 6) | 192, (c1 & 63) | 128);
567      } else {
568        enc = String.fromCharCode((c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128);
569      }
570      if (enc !== null) {
571        if (end > start) {
572          utftext += string.slice(start, end);
573        }
574        utftext += enc;
575        start = end = n + 1;
576      }
577    }
578
579    if (end > start) {
580      utftext += string.slice(start, stringl);
581    }
582
583    return utftext;
584  }
585
586  // 모바일용 이미지크게보기 2021-05-29 강대인
587  function image_window_mobile(img)
588  {
589    var title_tx = "이미지보기";
590
591    $.colorbox(
592    {
593      href:$(img).attr('src'),
594      scalePhotos:false,
595      //iframe:true,
596      fixed:true,
597      top:0,
598      title:title_tx,
599      initialWidth:0,
600      initialHeight:$(window).height(),
601      width:$(window).width(),
602      height:$(window).height(),
603      data:{},
604      closeButton:true,
605      overlayClose:false,
606      scrolling:true,
607      onOpen:function()
608      {
609        //$("#diCon").css("display", "none");
610        $("html").css({"height":"100%", "overflow":"hidden"});
611        history.pushState(null, document.title + '[colorbox-active_img]', window.location.pathname + window.location.search + '#colorbox-active_img');
612        window.onpopstate = function(event) { $.colorbox.close(); };
613      },
614      onClosed:function()
615      {
616        //$("#diCon").css("display", "");
617        $("html").css({"height":"", "overflow":""});
618        history.replaceState(null, document.title, window.location.pathname + window.location.search);
619      }
620      //onComplete : function() { $(this).colorbox.resize({width:$(window).width(), height:$(window).height()}); }
621    });
622  }
623
624  function image_window(img)
625  {
626    var UserAgent = navigator.userAgent;
627    if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null)
628    {
629      // Mobile
630      var title_tx = "";
631      /*
632      $.colorbox(
633      {
634        href:$(img).attr('src'),
635        scalePhotos:false,
636        //iframe:true,
637        fixed:true,
638        top:0,
639        title:title_tx,
640        initialWidth:0,
641        initialHeight:$(window).height(),
642        width:$(window).width(),
643        height:$(window).height(),
644        data:{},
645        closeButton:true,
646        overlayClose:false,
647        scrolling:true,
648        onOpen:function()
649        {
650          //$("#diCon").css("display", "none");
651          $("html").css({"height":"100%", "overflow":"hidden"});
652          history.pushState(null, document.title + '[colorbox-active_img]', window.location.pathname + window.location.search + '#colorbox-active_img');
653          window.onpopstate = function(event) { $.colorbox.close(); };
654        },
655        onClosed:function()
656        {
657          //$("#diCon").css("display", "");
658          $("html").css({"height":"", "overflow":""});
659          history.replaceState(null, document.title, window.location.pathname + window.location.search);
660        }
661        //onComplete : function() { $(this).colorbox.resize({width:$(window).width(), height:$(window).height()}); }
662      });
663      */
664
665      if($(img).data('title'))
666      {
667        title_tx = $(img).data('title');
668      }
669
670      $.colorbox(
671      {
672        iframe:true,
673        href:"/"+rt_module+"/board/img_view?img_url="+ $(img).attr('src'),
674        fixed:true,
675        top:0,
676        title:title_tx,
677        initialWidth:0,
678        initialHeight:$(window).height(),
679        width:$(window).width()-10,
680        height:$(window).height()-10,
681        data:{},
682        closeButton:true,
683        overlayClose:true,
684        scrolling:true,
685        onOpen:function()
686        {
687          $("html").css({"height":"100%", "overflow":"hidden"});
688          history.pushState(null, document.title + '[colorbox-active_img]', window.location.pathname + window.location.search + '#colorbox-active_img');
689          window.onpopstate = function(event) { $.colorbox.close(); };
690        },
691        onClosed:function()
692        {
693          //$("#diCon").css("display", "");
694          $("html").css({"height":"", "overflow":""});
695          history.replaceState(null, document.title, window.location.pathname + window.location.search);
696        }
697      });
698
699    }
700    else
701    {
702      //PC
703      //$.colorbox({href:$(img).attr('src'),scalePhotos:false,maxWidth:'90%',maxHeight:'90%',title:false,closeButton:true});
704
705      $.colorbox(
706      {
707        iframe:true,
708        href:"/"+rt_module+"/board/img_view?img_url="+ $(img).attr('src'),
709        width:'1200',
710        height:'800',
711        maxWidth:"98%",
712        maxHeight:'90%',
713        data:{},
714        closeButton:true,
715        overlayClose:true,
716        scrolling:true
717        //onOpen:function() { $("body").css("overflow", "hidden"); },
718        //onClosed:function() { $("body").css("overflow", "auto"); }
719      });
720    }
721
722
723
724    /*
725    var newImg = new Image();
726    newImg.src = img.src
727
728    newImg.onload = function()
729    {
730      w = this.width;
731      h = this.height;
732
733      var winl = (screen.width-w)/2;
734      var wint = (screen.height-h)/3;
735      var g4_is_gecko  = navigator.userAgent.toLowerCase().indexOf("gecko") != -1;
736
737      if (w >= screen.width) {
738          winl = 0;
739          h = (parseInt)(w * (h / w));
740      }
741
742      if (h >= screen.height) {
743          wint = 0;
744          w = (parseInt)(h * (w / h));
745      }
746
747      var js_url = "<script type='text/javascript'> \n";
748          js_url += "<!-- \n";
749          js_url += "var ie=document.all; \n";
750          js_url += "var nn6=document.getElementById&&!document.all; \n";
751          js_url += "var isdrag=false;
751 \n";
752          js_url += "var x,y; \n";
753          js_url += "var dobj; \n";
754          js_url += "function movemouse(e) \n";
755          js_url += "{ \n";
756          js_url += "  if (isdrag) \n";
757          js_url += "  { \n";
758          js_url += "    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n";
759          js_url += "    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n";
760          js_url += "    return false; \n";
761          js_url += "  } \n";
762          js_url += "} \n";
763          js_url += "function selectmouse(e) \n";
764          js_url += "{ \n";
765          js_url += "  var fobj      = nn6 ? e.target : event.srcElement; \n";
766          js_url += "  var topelement = nn6 ? 'HTML' : 'BODY'; \n";
767          js_url += "  while (fobj.tagName != topelement && fobj.className != 'dragme') \n";
768          js_url += "  { \n";
769          js_url += "    fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n";
770          js_url += "  } \n";
771          js_url += "  if (fobj.className=='dragme') \n";
772          js_url += "  { \n";
773          js_url += "    isdrag = true; \n";
774          js_url += "    dobj = fobj; \n";
775          js_url += "    tx = parseInt(dobj.style.left+0); \n";
776          js_url += "    ty = parseInt(dobj.style.top+0); \n";
777          js_url += "    x = nn6 ? e.clientX : event.clientX; \n";
778          js_url += "    y = nn6 ? e.clientY : event.clientY; \n";
779          js_url += "    document.onmousemove=movemouse; \n";
780          js_url += "    return false; \n";
781          js_url += "  } \n";
782          js_url += "} \n";
783          js_url += "document.onmousedown=selectmouse; \n";
784          js_url += "document.onmouseup=new Function('isdrag=false'); \n";
785          js_url += "//--> \n";
786          js_url += "</"+"script> \n";
787
788      var settings;
789
790      if (g4_is_gecko) {
791          settings  ='width='+(w+50)+',';
792          settings +='height='+(h+10)+',';
793      } else {
794          settings  ='width='+(w+50)+',';
795          settings +='height='+(h+10)+',';
796      }
797      settings +='top='+wint+',';
798      settings +='left='+winl+',';
799      settings +='scrollbars=no,';
800      settings +='resizable=yes,';
801      settings +='status=no';
802
803
804      win=window.open("","image_window",settings);
805      win.document.open();
806      win.document.write ("<html><head> \n<meta http-equiv='imagetoolbar' CONTENT='no'> \n<meta http-equiv='content-type' content='text/html; charset=utf-8'>\n");
807      var size = "이미지 사이즈 : "+w+" x "+h;
808      win.document.write ("<title>"+size+"</title> \n");
809      if(w >= screen.width || h >= screen.height) {
810          win.document.write (js_url);
811          var click = "ondblclick='window.close();
811' style='cursor:move' title=' "+size+" \n 이미지 사이즈가 화면보다 큽니다. \n 왼쪽 버튼을 클릭한 후 마우스를 움직여서 보세요. \n 더블 클릭하면 닫혀요. '";
812      }
813      else
814          var click = "onclick='window.close();' style='cursor:pointer' title='클릭하면 닫혀요. '";
815          //var click = "onclick='window.close();' style='cursor:pointer' title=' "+size+" \n 클릭하면 닫혀요. '";
816      win.document.write ("<style>.dragme{position:relative;}</style> \n");
817      win.document.write ("</head> \n");
818      win.document.write ("<body leftmargin=0 topmargin=0 bgcolor=#dddddd style='cursor:arrow;'> \n");
819      win.document.write ("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img src='"+img.src+"' width='"+w+"' height='"+h+"' border=0 class='dragme' "+click+"></td></tr></table>");
820      win.document.write ("</body></html>");
821      win.document.close();
822
823      if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
824    }
825    */
826  }
827
828  // object 내용보기 2013-05-23 강대인
829  function dump(arr,level)
830  {
831    var dumped_text = "";
832    if(!level) level = 0;
833
834    //The padding given at the beginning of the line.
835    var level_padding = "";
836    for(var j=0; j < level+1; j++) level_padding += "    ";
837
838    if(typeof(arr) == 'object') { //Array/Hashes/Objects
839      for(var item in arr) {
840        var value = arr[item];
841
842        if(typeof(value) == 'object') { //If it is an array,
843          dumped_text += level_padding + "'" + item + "' ...\n";
844          dumped_text += this.dump(value,level+1);
845        } else {
846          dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
847        }
848      }
849    } else { //Stings/Chars/Numbers etc.
850      dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
851    }
852    return dumped_text;
853  }
854
855  // 배열 출력 2014-02-17 강대인
856  function dump_arr(obj, doAlert)
857  {
858    var s = '';
859
860    for (var i in obj)
861      s += i+': '+obj[i]+"\n";
862
863    if (doAlert)
864      alert(s);
865    else
866      return s;
867  }
868
869  // 페이스북 등록
870  function goFaceBook()
871  {
872    FB.init({appId:'205036782280', cookie:true, status:true, xfbml:true});
873    FB.ui({
874      method:"feed",
875      name:"[전국] 아웃백립과 CGV 예매권 2매를 한방에 할인!",
876      caption:"http://tmon.co.kr/deal/22006285/101088",
877      description:"아웃백 립+CGV예매권 2매 ",
878      message:"아웃백 립+CGV예매권 2매 ",
879      link:"http://tmon.co.kr/deal/22006285/101088"
880    });
881  }
882
883  function goTwitter()
884  {
885    var href = 'http://twitter.com/share?text=' + encodeURIComponent("[전국] 아웃백립과 CGV 예매권 2매를 한방에 할인!") + ' ' + encodeURIComponent("http://tmon.co.kr/deal/22006285/101088");
886    var a = window.open(href, 'twitter', 'width=466, height=356');
887    if (a)
888    {
889      a.focus();
890    }
891  }
892
893  function goMe2Day()
894  {
895    var href = 'http://me2day.net/posts/new?new_post[body]=' + encodeURIComponent("[전국] 아웃백립과 CGV 예매권 2매를 한방에 할인!") + ' ' + encodeURIComponent("http://tmon.co.kr/deal/22006285/101088") + '&new_post[tags]=' + encodeURIComponent("티몬, 티켓몬스터, TICKET MONSTER");
896    var a = window.open(href, 'me2Day', '');
897    if (a)
898    {
899      a.focus();
900    }
901  }
902
903  function goYozmDaum()
904  {
905    var href = 'http://yozm.daum.net/api/popup/prePost?sourceid=54&link=' + encodeURIComponent("http://tmon.co.kr/deal/22006285/101088") + '&prefix=' + encodeURIComponent("티켓몬스터 > 아웃백+CGV ") + '&parameter=' + encodeURIComponent("아웃백 립+CGV예매권 2매 ");
906    var a = window.open(href, 'yozmSend', 'width=466, height=356');
907    if (a)
908    {
909      a.focus();
910    }
911  }
912
913  // 전화번호 자동 하이픈 입력
914  function isPhoneBox(obj)
915  {
916    obj.value = obj.value.replace(/\-/g,"");
917    obj.select();
918
919    if(!obj.onblur)
920    {
921      obj.onblur = function()
922      {
923        this.value = this.value.replace(/\-/g,"");
924        var str= this.value;
925        var l = str.length;
926        if(l>2)
927        {
928          if(l==11)
929          {
930           str = str.substr(0,(k=(str.substr(0,4)=='0504')?4:3))+'-'+str.substr(k,l-3-k)+'-'+str.substr(l-4);
931          }
932          else if(l>7)
933          {
934           str = str.substr(0,(k=(str.substr(0,2)=='02')?2:3))+'-'+str.substr(k,l-4-k)+'-'+str.substr(l-4);
935          }
936          else
937          {
938           str=str.substr(0,3)+'-'+str.substr(3);
939          }
940        }
941        this.value = str;
942      }
943    }
944  }
945
946  // 전화번호 자동 하이픈 입력 2016-10-31 강대인
947  function autoHypenPhone(str)
948  {
949    str = str.replace(/[^0-9]/g, '');
950    var tmp = '';
951    if( str.length < 4){
952      return str;
953    }else if(str.length < 7){
954      tmp += str.substr(0, 3);
955      tmp += '-';
956      tmp += str.substr(3);
957      return tmp;
958    }else if(str.length < 9){
959      tmp += str.substr(0, 4);
960      tmp += '-';
961      tmp += str.substr(4);
962      return tmp;
963    }else if(str.length == 9 && str.substr(0, 2) == "02"){
964      tmp += str.substr(0, 2);
965      tmp += '-';
966      tmp += str.substr(2, 3);
967      tmp += '-';
968      tmp += str.substr(5);
969      return tmp;
970    }else if(str.length == 10 && str.substr(0, 2) == "02"){
971      tmp += str.substr(0, 2);
972      tmp += '-';
973      tmp += str.substr(2, 4);
974      tmp += '-';
975      tmp += str.substr(6);
976      return tmp;
977    }else if(str.length == 11 && (str.substr(0, 4) == "0504" || str.substr(0, 4) == "0507" || str.substr(0, 4) == "0303")){
978      tmp += str.substr(0, 4);
979      tmp += '-';
980      tmp += str.substr(4, 3);
981      tmp += '-';
982      tmp += str.substr(7);
983      return tmp;
984    }else if(str.length < 11){
985      tmp += str.substr(0, 3);
986      tmp += '-';
987      tmp += str.substr(3, 3);
988      tmp += '-';
989      tmp += str.substr(6);
990      return tmp;
991    }else if(str.length < 12){
992      tmp += str.substr(0, 3);
993      tmp += '-';
994      tmp += str.substr(3, 4);
995      tmp += '-';
996      tmp += str.substr(7);
997      return tmp;
998    }else{
999      tmp += str.substr(0, 4);
1000      tmp += '-';
1001      tmp += str.substr(4, 4);
1002      tmp += '-';
1003      tmp += str.substr(8);
1004      return tmp;
1005    }
1006    return str;
1007  }
1008
1009  // 휴대폰번호를 입력시 올바른 휴대폰 번호인지 체크  2013-11-26 강대인
1010  function hp_chk(pVal)
1011  {
1012    var rtn_val = false;
1013
1014    hp_str = pVal;
1015    //hp_str = pVal.replace(/-/gi,"");
1016    //alert(hp_str);
1017    if(hp_str != "")
1018    {
1019      var rgEx = /(01[016789])[-](\d{4}|\d{3})[-]\d{4}$/g;
1020      var chkFlg = rgEx.test(hp_str);
1021      if(chkFlg)
1022      {
1023        rtn_val = true;
1024      }
1025    }
1026    return rtn_val;
1027  }
1028
1029  // 전화번호를 입력시 올바른 번호인지 체크  2013-11-26 강대인
1030  function tel_chk(pVal)
1031  {
1032    var rtn_val = false;
1033
1034    hp_str = pVal.replace(/-/gi,"");
1035    //alert(hp_str);
1036    if(hp_str != "")
1037    {
1038      var rgEx = /\d{8}$/g;
1039
1040      if(hp_str.length > 8)
1041      {
1042        rgEx = /(\d{2}|\d{3}|\d{4})(\d{4}|\d{3})\d{4}$/g;
1043      }
1044      var chkFlg = rgEx.test(hp_str);
1045      if(chkFlg)
1046      {
1047        rtn_val = true;
1048      }
1049    }
1050    return rtn_val;
1051  }
1052
1053  // 테이블의 마지막행 추가 2014-02-17 강대인
1054  function table_add_row(table_id, insert_tag)
1055  {
1056    $("#"+table_id).append(insert_tag);
1057  }
1058
1059  // 테이블 현재행 삭제 2014-02-17 강대인
1060  function table_delete_row(obj)
1061  {
1062    $(obj).parent().remove();
1063  }
1064
1065
1066  //
1067  function familySite()
1068  {
1069  // Common
1070    var select_root = $('div.select');
1071    var select_value = $('.myValue');
1072    var select_a = $('div.select>ul>li>a');
1073    var select_input = $('div.select>ul>li>input[type=radio]');
1074    var select_label = $('div.select>ul>li>label');
1075
1076    // Radio Default Value
1077    $('div.myValue').each(function(){
1078      var default_value = $(this).next('.iList').find('input[checked]').next('label').text();
1079      $(this).append(default_value);
1080    });
1081
1082    // Line
1083    select_value.bind('focusin',function(){$(this).addClass('outLine');});
1084    select_value.bind('focusout',function(){$(this).removeClass('outLine');});
1085    select_input.bind('focusin',function(){$(this).parents('div.select').children('div.myValue').addClass('outLine');});
1086    select_input.bind('focusout',function(){$(this).parents('div.select').children('div.myValue').removeClass('outLine');});
1087
1088    // Show
1089    function show_option(){
1090      $(this).parents('div.select:first').toggleClass('open');
1091    }
1092
1093    // Hover
1094    function i_hover(){
1095      $(this).parents('ul:first').children('li').removeClass('hover');
1096      $(this).parents('li:first').toggleClass('hover');
1097    }
1098
1099    // Hide
1100    function hide_option(){
1101      var t = $(this);
1102      setTimeout(function(){
1103        t.parents('div.select:first').removeClass('open');
1104      }, 1);
1105    }
1106
1107    // Set Input
1108    function set_label(){
1109      var v = $(this).next('label').text();
1110      $(this).parents('ul:first').prev('.myValue').text('').append(v);
1111      $(this).parents('ul:first').prev('.myValue').addClass('selected');
1112    }
1113
1114    // Set Anchor
1115    function set_anchor(){
1116      var v = $(this).text();
1117      $(this).parents('ul:first').prev('.myValue').text('').append(v);
1118      $(this).parents('ul:first').prev('.myValue').addClass('selected');
1119    }
1120
1121    // Anchor Focus Out
1122    $('*:not("div.select a")').focus(function(){
1123      $('.aList').parent('.select').removeClass('open');
1124    });
1125
1126    select_value.click(show_option);
1127    select_root.find('ul').css('position','absolute');
1128    select_root.removeClass('open');
1129    select_root.mouseleave(function(){$(this).removeClass('open');});
1130    select_a.click(set_anchor).click(hide_option).focus(i_hover).hover(i_hover);
1131    select_input.change(set_label).focus(set_label);
1132    select_label.hover(i_hover).click(hide_option);
1133
1134    // Form Reset
1135    $('input[type="reset"], button[type="reset"]').click(function(){
1136      $(this).parents('form:first').find('.myValue').each(function(){
1137        var origin = $(this).next('ul:first').find('li:first label').text();
1138        $(this).text(origin).removeClass('selected');
1139      });
1140    });
1141
1142  }
1143
1144  // 비밀번호체크 함수 1 2015-09-01
1145  function f_chk_pwd1(uid, upw)
1146  {
1147    if(!/^[a-zA-Z0-9]{8,30}$/.test(upw))
1148    {
1149      alert('비밀번호는 숫자와 영문자 조합으로 8~16자리를 사용해야 합니다.');
1150      return false;
1151    }
1152
1153    var chk_num = upw.search(/[0-9]/g);
1154    var chk_eng = upw.search(/[a-z]/ig);
1155
1156    if(chk_num < 0 || chk_eng < 0)
1157    {
1158      alert('비밀번호는 숫자와 영문자를 혼용하여야 합니다.');
1159      return false;
1160    }
1161
1162    if(/(\w)\1\1\1/.test(upw))
1163    {
1164      alert('비밀번호에 같은 문자를 4번 이상 사용하실 수 없습니다.');
1165      return false;
1166    }
1167
1168    if(upw.search(uid)>-1)
1169    {
1170      alert('ID가 포함된 비밀번호는 사용하실 수 없습니다.');
1171      return false;
1172    }
1173
1174    return true;
1175  }
1176
1177  // 비밀번호체크 2 2015-09-01
1178  function f_chk_pwd2(uid, upw)
1179  {
1180    if(upw.value.length < 8)
1181    {
1182      alert("비밀번호는 문자, 숫자, 특수문자의 조합으로 8~16자리로 입력해주세요.");
1183      return false;
1184    }
1185
1186    if(!upw.value.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/))
1187    {
1188      alert("비밀번호는 문자, 숫자, 특수문자의 조합으로 8~16자리로 입력해주세요.");
1189      return false;
1190    }
1191
1192    if(uid.value.indexOf(upw) > -1)
1193    {
1194      alert("비밀번호에 아이디를 사용할 수 없습니다.");
1195      return false;
1196    }
1197
1198    var SamePass_0 = 0; //동일문자 카운트
1199    var SamePass_1 = 0; //연속성(+) 카운드
1200    var SamePass_2 = 0; //연속성(-) 카운드
1201
1202    var chr_pass_0;
1203    var chr_pass_1;
1204
1205    for(var i=0; i < upw.value.length; i++)
1206    {
1207      chr_pass_0 = upw.value.charAt(i);
1208      chr_pass_1 = upw.value.charAt(i+1);
1209
1210      //동일문자 카운트
1211      if(chr_pass_0 == chr_pass_1)
1212      {
1213        SamePass_0 = SamePass_0 + 1
1214      }
1215
1216
1217      //연속성(+) 카운드
1218      if(chr_pass_0.charCodeAt(0) - chr_pass_1.charCodeAt(0) == 1)
1219      {
1220        SamePass_1 = SamePass_1 + 1
1221      }
1222
1223      //연속성(-) 카운드
1224      if(chr_pass_0.charCodeAt(0) - chr_pass_1.charCodeAt(0) == -1)
1225      {
1226        SamePass_2 = SamePass_2 + 1
1227      }
1228    }
1229
1230    if(SamePass_0 > 1)
1231    {
1232      alert("동일문자를 3번 이상 사용할 수 없습니다.");
1233      return false;
1234    }
1235
1236    if(SamePass_1 > 1 || SamePass_2 > 1 )
1237    {
1238      alert("연속된 문자열(123 또는 321, abc, cba 등)을\n 3자 이상 사용 할 수 없습니다.");
1239      return false;
1240    }
1241
1242    return true;
1243  }
1244
1245  // 팝업차단체크 2017-06-06 강대인
1246  function f_popup_chk()
1247  {
1248    var win_pop_chk = window.open('', 'win', 'width=1, height=1, scrollbars=yes, resizable=yes');
1249
1250    if (win_pop_chk == null || typeof(win_pop_chk) == "undefined" || (win_pop_chk == null && win_pop_chk.outerWidth == 0) || (win_pop_chk != null && win_pop_chk.outerHeight == 0) || win_pop_chk.test == "undefined")
1251    {
1252      alert("팝업 차단 기능이 설정되어있습니다\n차단 기능을 해제(팝업허용) 한 후 다시 이용해 주십시오.");
1253      if(win_pop_chk) {win_pop_chk.close();}
1254      return false;
1255    }
1256
1257    if(win_pop_chk) {win_pop_chk.close();}
1258    return true;
1259  }
1260
1261  // 사업자번호 자동하이픈 입력
1262  function autoHypenBizNo(str)
1263  {
1264    str = str.replace(/[^0-9]/g, '');
1265    var tmp = '';
1266    if(str.length < 4){
1267        return str;
1268    }else if(str.length < 7){
1269        tmp += str.substr(0, 3);
1270        tmp += '-';
1271        tmp += str.substr(3);
1272        return tmp;
1273    }else{
1274        tmp += str.substr(0, 3);
1275        tmp += '-';
1276        tmp += str.substr(3, 2);
1277        tmp += '-';
1278        tmp += str.substr(5);
1279        return tmp;
1280    }
1281    return str;
1282  }
1283
1284  // 법인등록 자동하이픈 입력
1285  function autoHypenBizNo2(str)
1286  {
1287    str = str.replace(/[^0-9]/g, '');
1288    var tmp = '';
1289    if(str.length < 6){
1290        return str;
1291    }else{
1292        tmp += str.substr(0, 6);
1293        tmp += '-';
1294        tmp += str.substr(6,str.length-6);
1295        return tmp;
1296    }
1297    return str;
1298  }
1299
1300  // 날짜입력용 자동하이픈넣기
1301  function autoHypenDate(str)
1302  {
1303    if( str.length > 10)
1304    {
1305      str = str.substr(0, 10);
1306    }
1307
1308    var val         = str.replace(/\D/g, '');
1309    var original    = str.replace(/\D/g, '').length;
1310    var conversion  = '';
1311
1312    for(i=0;i<2;i++)
1313    {
1314      if (val.length > 4 && i===0)
1315      {
1316        conversion += val.substr(0, 4) + '-';
1317        val         = val.substr(4);
1318      }
1319      else if(original>6 && val.length > 2 && i===1)
1320      {
1321        conversion += val.substr(0, 2) + '-';
1322        val         = val.substr(2);
1323      }
1324    }
1325    conversion += val;
1326    return conversion;
1327  }
1328
1329  // 즐겨찾기 2019-05-26
1330  function f_favorite_add(bookmarkURL, bookmarkTitle)
1331  {
1332
1333    //var bookmarkURL = window.location.href;
1334    //var bookmarkTitle = document.title;
1335    var triggerDefault = false;
1336
1337    if (window.sidebar && window.sidebar.addPanel)
1338    {
1339      // Firefox version < 23
1340      window.sidebar.addPanel(bookmarkTitle, bookmarkURL, '');
1341    }
1342    else if ((window.sidebar && (navigator.userAgent.toLowerCase().indexOf('firefox') > -1)) || (window.opera && window.print))
1343    {
1344      // Firefox version >= 23 and Opera Hotlist
1345      var $this = $(this);
1346      $this.attr('href', bookmarkURL); $this.attr('title', bookmarkTitle);
1347      $this.attr('rel', 'sidebar');
1348      $this.off(e);
1349      triggerDefault = true;
1350    }
1351    else if (window.external && ('AddFavorite' in window.external))
1352    {
1353      // IE Favorite
1354      window.external.AddFavorite(bookmarkURL, bookmarkTitle);
1355    }
1356    else
1357    {
1358      // WebKit - Safari/Chrome
1359      alert((navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Cmd' : 'Ctrl') + '+D 키를 눌러 즐겨찾기에 등록하실 수 있습니다.');
1360    }
1361    return triggerDefault;
1362  }
1363
1364  // 전화번호 분리해서 입력하기 2022-04-27 강대인
1365  // 분리전 input id값과 분리해야되는input 개수 입력
1366  function tel_split(id, len)
1367  {
1368    if($('#'+id).legnth < 1) {return;}
1369
1370    var tel = $('#'+id).val();
1371    var k=0;
1372
1373    if(!tel) { return; }
1374
1375    var arr_tel = tel.split('-', len);
1376
1377    len = parseInt(len);
1378    if(len < 1)
1379    {
1380      len = 1;
1381    }
1382
1383    for(var i=1;i<=len;i++)
1384    {
1385      if( $('#'+id+i).val() == "undefined") { continue; }
1386
1387      $('#'+id+i).val(arr_tel[k]);
1388      k++;
1389    }
1390  }
1391
1392  // 분리되어있는 전화번호를 합쳐진 input에 입력
1393  // 합친 input id값과 분리해야되는input 개수 입력
1394  function tel_join(id, len)
1395  {
1396    var tel = "";
1397    var t_str = "";
1398    var arr_tel = [];
1399    var k = 0;
1400
1401    if($('#'+id).legnth < 1) {return;}
1402
1403    len = parseInt(len);
1404    if(len < 1)
1405    {
1406      len = 1;
1407    }
1408
1409    for(var i=1;i<=len;i++)
1410    {
1411      if( $('#'+id+i).val() == "undefined") { continue; }
1412
1413      t_str = $('#'+id+i).val();
1414
1415      if( t_str.trim() == "") { continue; }
1416
1417      arr_tel[k] = t_str.trim();
1418      k++;
1419    }
1420
1421    tel = arr_tel.join('-');
1422    $('#'+id).val(tel)
1423  }
1424
1425  // 위경도 좌표간 거리계산 2022-09-05 강대인 - Km로 반환
1426  function getDistanceFromLatLonInKm(array) {
1427      var lat1 = array[0].getLat();
1428      var lng1 = array[0].getLng();
1429      var lat2 = array[1].getLat();
1430      var lng2 = array[1].getLng();
1431
1432      function deg2rad(deg) {
1433          return deg * (Math.PI/180)
1434      }
1435      var r = 6371; //지구의 반지름(km)
1436      var dLat = deg2rad(lat2-lat1);
1437      var dLon = deg2rad(lng2-lng1);
1438      var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon/2) * Math.sin(dLon/2);
1439      var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
1440      var d = r * c; // Distance in km
1441      return Math.round(d*1000);
1442  }
1443
1444  // 클립보드에 URL복사
1445  function copy_clip_board(pStr)
1446  {
1447    //let currentUrl = window.document.location.href;
1448
1449    let t = document.createElement("textarea");
1450    document.body.appendChild(t);
1451    t.value = pStr;
1452    t.select();
1453    document.execCommand('copy');
1454    document.body.removeChild(t);
1455
1456    alert('복사가 완료되었습니다');
1457  }
1458
1459  // 사업자번호 유효성체크
1460  function f_biz_no_chk(number){
1461    var numberMap = number.replace(/-/gi, '').split('').map(function (d){
1462      return parseInt(d, 10);
1463    });
1464
1465    if(numberMap.length == 10){
1466      var keyArr = [1, 3, 7, 1, 3, 7, 1, 3, 5];
1467      var chk = 0;
1468
1469      keyArr.forEach(function(d, i){
1470        chk += d * numberMap[i];
1471      });
1472
1473      chk += parseInt((keyArr[8] * numberMap[8])/ 10, 10);
1474      console.log(chk);
1475      return Math.floor(numberMap[9]) === ( (10 - (chk % 10) ) % 10);
1476    }
1477
1478    return false;
1479  }
1480
1481  // 모바일여부 체크
1482  function isMobile()
1483  {
1484    // 모바일 기기를 판별하기 위해 정규 표현식 사용
1485    var userAgent = navigator.userAgent || navigator.vendor || window.opera;
1486
1487    // iOS
1488    if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
1489        return true;
1490    }
1491
1492    // Android
1493    if (/android/i.test(userAgent)) {
1494        return true;
1495    }
1496
1497    // 기타 모바일 기기
1498    if (/Mobi|Tablet|iPad|iPhone|iPod|Android|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) {
1499        return true;
1500    }
1501
1502    return false;
1503  }
1504
1505
1506
1507}
1508
1509

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.