PageSourceSearch

https://www.guamplay.com/pages/js/script.js?v=1791445345

js guamplay.com collected 2026-10-08 07:43:50 UTC 35,612 bytes, 1,006 lines download raw bytes

1function MM_swapImgRestore() { //v3.0
2	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
3}
4function MM_preloadImages() { //v3.0
5	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
6		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
7		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
8}
9
10function MM_findObj(n, d) { //v4.01
11	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
12		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
13	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
14	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
15	if(!x && d.getElementById) x=d.getElementById(n); return x;
16}
17
18function MM_swapImage() { //v3.0
19	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
20	 if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
21}
22
23
24
25function MM_showHideLayers() { //v9.0
26	var i,p,v,obj,args=MM_showHideLayers.arguments;
27	for (i=0; i<(args.length-2); i+=3)
28	with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
29		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
30		obj.visibility=v; }
31}
32
33function Only_Numeric() {
34	if((event.keyCode<48 || event.keyCode>57 || event.keyCode==45) && event.keyCode!=13) event.returnValue=false;
35}
36
37function openwindow(name,url,width,height,scrollbar) {
38		scrollbar_str = scrollbar ? 'yes' : 'no';
39		window.open(url,name,'width='+width+',height='+height+',scrollbars='+scrollbar_str);
40}
41
42function authFunction() {
43		alert('해당 게시판에 대한 권한이 없습니다.   ');
44}
45
46// - Comma 적용 ---
47String.prototype.comma=function() {
48	var l_text=this.replace(/,/g,'');
49
50	if(l_text == "0") return "0";
51
52	var l_pattern=/^(-?\d+)(\d{3})($|\..*$)/;
53
54	if(l_pattern.test(l_text)){
55		l_text=l_text.replace(l_pattern,function(str,p1,p2,p3)
56		{
57			return p1.comma() + ("," + p2 + p3);
58		});
59	}
60	return l_text;
61}
62// - Comma 적용 ---
63
64
65
66// 상품 목록 보기 ajax 함수 (노출시킬 class명, 카테고리코드, 한페이지에 노출시킬 갯수, 리스트 유형, 페이징 사용여부, 인기상품순위 아이콘 사용여부, 테마, 기타 이벤트요소,정렬 필드)
67function product_list_view(display_area,cuid,listmaxcount,list_type,pagenate,hit_num_use,thema,event_type,order_field,order_sort,keyword) {
68
69	if(cuid         == undefined) cuid="";
70	if(listmaxcount == undefined) listmaxcount="";
71	if(list_type    == undefined) list_type="";
72	if(pagenate     == undefined) pagenate="";
73	if(thema   		== undefined) thema="";
74	if(event_type   == undefined) event_type="";
75	if(hit_num_use  == undefined) hit_num_use="";
76	if(order_field  == undefined) order_field="";
77	if(order_sort   == undefined) order_sort="";
78
79	if(keyword == undefined) keyword=''; // 2015-03-26 Lim
80
81	// --- JJC : 2023-02-08 : [괌플전용]렌트카 API 연동 ---
82	var rentcarapi_chk = $("input[name='rentcarapi_chk']").val();
83	var event_pd = $("input[name='pd']").val();
84	var event_pt = $("select[name='pt']").val();
85	var event_rr = $("select[name='rr']").val();
86
87	var app_data = "cuid=" + cuid + "&listmaxcount=" + listmaxcount + "&list_type=" + list_type + "&pagenate=" + pagenate + "&hit_num_use=" + hit_num_use + "&thema=" + thema + "&event_type=" + event_type + "&order_field=" + order_field + "&order_sort=" + order_sort + '&search_keyword=' + keyword;
88	if( rentcarapi_chk == 'Y' ) {
89
90		if( event_pd == '' ) { alert('렌트카 조회 시작날짜를 선택해주시기 바랍니다.'); return false;  }
91		else if( event_pt == '' ) { alert('렌트카 조회 시작시간을 선택해주시기 바랍니다.'); return false;  }
92		else if( event_rr == '' ) { alert('렌트카 조회 렌트기간을 선택해주시기 바랍니다.'); return false;  }
93
94		app_data += "&event_type=rentcarapi&event_pd=" + event_pd + "&event_pt=" + event_pt + "&event_rr=" + event_rr;
95	}
96	// --- JJC : 2023-02-08 : [괌플전용]렌트카 API 연동 ---
97
98	$.ajax({
99			url: "/pages/ajax.product.list.php",
100			cache: false,
101			type: "POST",
102			data: app_data ,
103			success: function(data){
104				$("."+display_area).html(data);
105			},
106			error:function(request,status,error){
107				alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
108			}
109	});
110}
111
112
113// 상품 검색 보기 ajax 함수 (노출시킬 class명, 카테고리코드, 한페이지에 노출시킬 갯수, 리스트 유형, 페이징 사용여부, 인기상품순위 아이콘 사용여부, 테마, 기타 이벤트요소,정렬 필드,검색어, 해시태그)
114function product_search_view(display_area,cuid,listmaxcount,list_type,pagenate,hit_num_use,thema,event_type,order_field,order_sort,keyword,hashtag) {
115
116	if(cuid         == undefined) cuid="";
117	if(listmaxcount == undefined) listmaxcount="";
118	if(list_type    == undefined) list_type="";
119	if(pagenate     == undefined) pagenate="";
120	if(thema   		== undefined) thema="";
121	if(event_type   == undefined) event_type="";
122	if(hit_num_use  == undefined) hit_num_use="";
123	if(order_field  == undefined) order_field="";
124	if(order_sort   == undefined) order_sort="";
125	if(keyword == undefined) keyword=''; // 2015-03-26 Lim
126	if(hashtag == undefined) hashtag='';
127
128	$.ajax({
129			url: "/pages/ajax.product.list.php",
130			cache: false,
131			type: "POST",
132			data: "cuid="+cuid+"&listmaxcount="+listmaxcount+"&list_type="+list_type+"&pagenate="+pagenate+"&hit_num_use="+hit_num_use+"&thema="+thema+"&event_type="+event_type+"&order_field="+order_field+"&order_sort="+order_sort+'&search_keyword='+keyword+'&search_hashtag='+hashtag,
133			success: function(data){
134				$("."+display_area).html(data);
135			},
136			error:function(request,status,error){
137				alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
138			}
139	});
140}
141
142
143
144// 목록에서 구매/장바구니 담기
145function app_submit_from_list(pcode,_type,is_option) {
146	if(is_option) {
147		alert("옵션이 있는 상품입니다. 옵션을 선택해주시기 바랍니다.");
148		location.href = '/?pn=product.view&pcode='+pcode;
149	}
150	else {
151		location.href = '/pages/shop.cart.pro.php?mode=add&pcode='+pcode+'&pass_type=' + _type + '&option_select_type=nooption';
152	}
153}
154
155// - 상세페이지에서 구매/장바구니 담기
156function app_submit(pcode,_type) {
157	// 달력옵션 패치
158	if( $("#use_dateoption").val()=="Y" && !$("#dateoption_selected_date").val() && !$("#checkin_date").val()){
159		alert("날짜를 선택해주세요.");
160		return;
161	}
162	// 달력옵션 패치 끝
163
164	if( !( $("#option_select_cnt").val() * 1 > 0 ) ) {
165		alert("옵션을 하나 이상 선택해주시기 바랍니다.")
166	}
167	else if( !( $("#option_select_expricesum").val() * 1 > 0 ) ) {
168		alert("옵션 합계금액이 0원을 초과해야 합니다.")
169	}
170	else {
171		if($('#add_option_select_1_id').val()) { var add_option_select_1 = $('#add_option_select_1_id').val(); } else { var add_option_select_1 = ''; }
172		if($('#add_option_select_2_id').val()) { var add_option_select_2 = $('#add_option_select_2_id').val(); } else { var add_option_select_2 = ''; }
173		if($('#add_option_select_3_id').val()) { var add_option_select_3 = $('#add_option_select_3_id').val(); } else { var add_option_select_3 = ''; }
174		if($('#add_option_select_4_id').val()) { var add_option_select_4 = $('#add_option_select_4_id').val(); } else { var add_option_select_4 = ''; }
175		if($('#add_option_select_5_id').val()) { var add_option_select_5 = $('#add_option_select_5_id').val(); } else { var add_option_select_5 = ''; }
176		if($('#add_option_select_6_id').val()) { var add_option_select_6 = $('#add_option_select_6_id').val(); } else { var add_option_select_6 = ''; }
177		if($('#add_option_select_7_id').val()) { var add_option_select_7 = $('#add_option_select_7_id').val(); } else { var add_option_select_7 = ''; }
178		if($('#add_option_select_8_id').val()) { var add_option_select_8 = $('#add_option_select_8_id').val(); } else { var add_option_select_8 = ''; }
179		if($('#add_option_select_9_id').val()) { var add_option_select_9 = $('#add_option_select_9_id').val(); } else { var add_option_select_9 = ''; }
180		if($('#add_option_select_10_id').val()) { var add_option_select_10 = $('#add_option_select_10_id').val(); } else { var add_option_select_10 = ''; }
181		if($('.js_drop_item option:selected').val()) { var drop_item_code = $('.js_drop_item option:selected').val() } else { var drop_item_code = ''; } // 2017-08-31 LDD 드롭장소 코드 넘김
182		if($('.js_pickup_item option:selected').val()) { var pickup_item_code = $('.js_pickup_item option:selected').val() } else { var pickup_item_code = ''; } // 2017-08-31 LDD 픽업장소 코드 넘김
183		if($('.js_cnt_setup_item option:selected').val()) { var cnt_setup = $('.js_cnt_setup_item option:selected').val() } else { var cnt_setup = ''; } // JJC : 2023-09-01 : 추가작업 : 인원수 지정 상품
184		if($('#option_select_wholesale_id option:selected').val()) { var wholesale_code = $('#option_select_wholesale_id option:selected').val() } else { var wholesale_code = ''; } // ----- JJC : 프로그램 후반 기능강화 : 인원별 요금 기능 : 2020-05-23 -----
185
186		setTimeout(function() {
187			location.href = ('/pages/shop.cart.pro.php?mode=add&pcode='+pcode+'&pass_type=' + _type  + '&add_option_select_1=' + add_option_select_1 + '&add_option_select_2=' + add_option_select_2 + '&add_option_select_3=' + add_option_select_3 + '&add_option_select_4=' + add_option_select_4 + '&add_option_select_5=' + add_option_select_5 + '&add_option_select_6=' + add_option_select_6 + '&add_option_select_7=' + add_option_select_7 + '&add_option_select_8=' + add_option_select_8 + '&add_option_select_9=' + add_option_select_9 + '&add_option_select_10=' + add_option_select_10 + '&option_select_type=' + $("#option_select_type").val() + '&option_select_cnt=' + $("#option_select_cnt").val() + "&use_dateoption=" + $("#use_dateoption").val() + "&dateoption_selected_date=" + $("#dateoption_selected_date").val() + "&dateoption_selected_time=" + $("#dateoption_selected_time").val() + '&drop_item_code='+drop_item_code+'&pickup_item_code='+pickup_item_code+'&cnt_setup='+cnt_setup+'&wholesale_code='+wholesale_code); // cart 처리페이지 이동 // 2017-08-31 LDD  + '&drop_item_code='+drop_item_code+'&pickup_item_code='+pickup_item_code 추가// ----- JJC : 프로그램 후반 기능강화 : 인원별 요금 기능 : 2020-05-23 // JJC : 2023-09-01 : 추가작업 : 인원수 지정 상품
188		}, 500);
189	}
190}
191
192function app_soldout() {
193	alert("품절된 상품입니다.");
194}
195
196// 로그인 알럿
197function login_alert(pn) {
198	alert("로그인 후 이용하실 수 있습니다.");
199	top.location.href='/?pn=member.login.form&path='+pn;
200}
201
202// defaultValue 값 입력
203function input_dv_insert() {
204
205	obj = $("input[type=text], textarea");
206	for(i=0;i<obj.length;i++) {
207		dv = $(obj).eq(i).attr("defaultValue");
208		!$(obj).eq(i).val() && dv ? $(obj).eq(i).val(dv) : null;
209	}
210
211}
212
213// 입력전 defaultValue 값 제거
214function input_dv_delete() {
215
216	obj = $("input[type=text], textarea");
217	for(i=0;i<obj.length;i++) {
218		dv = $(obj).eq(i).attr("defaultValue");
219		$(obj).eq(i).val() == dv ? $(obj).eq(i).val("") : null;
220	}
221
222}
223
224// 천단위 콤마 제거
225function number_style_comma_delete() {
226
227	obj = $(".number_style");
228
229	if(obj.length > 0)
230		for(var i in obj)
231			if(obj[i].value != undefined)
232				obj[i].value = obj[i].value.replace(/,/g,"");
233}
234
235// 폼 서브밋을 위한 초기화
236function formSubmitSet() {
237
238	input_dv_delete();
239	number_style_comma_delete();
240
241}
242
243$(document).ready(function() {
244
245	/* ----- default 값 자동입력 및 처리. ---------- */
246	input_dv_insert();// default 값 입력
247
248	// input 포커스가 들어왔을때 default 값을 삭제한다.
249	$("input[type=text], textarea").focus(function() {
250		dv = $(this).attr("defaultValue");
251		if($(this).val() == dv)
252			$(this).val("");
253	});
254
255	// input 값이 없이 포커스가 나가면 default 값을 삽입한다.
256	$("input[type=text], textarea").blur(function() {
257		dv = $(this).attr("defaultValue");
258		if(!$(this).val() && dv)
259			$(this).val(dv);
260	});
261	/* ----- // default 값 자동입력 및 처리. ---------- */
262
263
264
265	/* ----- 숫자만 입력받고 천단위 콤마를 삽입한다. ---------- */
266	$(".number_style").keypress(function() {
267
268		// 숫자만 입력
269		if((event.keyCode<48 || event.keyCode>57 || event.keyCode==45) && event.keyCode!=13) event.returnValue=false;
270
271	});
272	$(".number_style").keyup(function() {
273
274		// 천단위 콤마
275		this.value = this.value.comma();
276
277	});
278
279	obj = $(".number_style");
280
281	if(obj.length > 0)
282		for(var i in obj)
283			if(obj[i].value != undefined)
284				obj[i].value = obj[i].value.comma();
285
286	/* ----- // 숫자만 입력받고 천단위 콤마를 삽입한다. ---------- */
287
288});
289
290// 북마크
291function bookmark(title, url) {
292
293	// 넘어온 값이 없으면 현재 페이지 정보 사용
294	if(!title) { title = document.title; }
295	if(!url) { url = location.href; }
296
297	// 웹킷 브라우저(크롬, 사파리)는 자바스크립트로 북마크 생성하는 기능 없으므로 경고창 처리
298	$.browser.chrome = $.browser.webkit && !!window.chrome;
299	$.browser.safari = $.browser.webkit && !window.chrome;
300
301	if($.browser.chrome || $.browser.safari) {
302		alert('현재 사용하는 브라우저는 자동 즐겨찾기 생성 기능을 지원하지 않습니다. \n\n' + (navigator.userAgent.toLowerCase().indexOf('mac') != - 1 ? 'Command/Cmd' : 'CTRL') + ' + D 를 눌러 직접 즐겨찾기에 추가해주세요.');
303	} else {
304	    if(window.external) { // ie
305	        window.external.AddFavorite(url, title);
306	    }
307	    else if(window.sidebar) { // firefox
308	        window.sidebar.addPanel(title, url, "");
309	    }
310	    else if(window.opera && window.print) { // opera
311	        var elem = document.createElement('a');
312	        elem.setAttribute('href',url);
313	        elem.setAttribute('title',title);
314	        elem.setAttribute('rel','sidebar');
315	        elem.click(); // this.title=document.title;
316	    }
317	}
318}
319
320
321// 스크립트 후킹 LDD 2016-05-12
322/*
323fun_new: 특정 함수가 실행 되기전 실행할 함수
324fun_old: 특정함수가 실행된 후 실행할 함수
325parent: 함수의 위치
326Tip: fun_new 함수에서 return false;를 반환 하면 fun_old를 실행 하지 않습니다.
327*/
328function scriptHook(fun_new, fun_old, parent) {
329
330    if(typeof parent == 'undefined') parent = window;
331    for(var i in parent) {
332        if(parent[i] === fun_old) {
333
334            parent[i] = function() {
335
336                var Return = fun_new.apply(this, arguments); // LDD: 2017-09-20 fun_old의 인자값을 쓸 수 있도록 처리
337                if(Return === false) return;
338                return fun_old.apply(this, arguments);
339            }
340            break;
341        }
342    }
343}
344
345function date (format, timestamp) {
346  var jsdate, f
347  // Keep this here (works, but for code commented-out below for file size reasons)
348  // var tal= [];
349  var txtWords = [
350    'Sun', 'Mon', 'Tues', 'Wednes', 'Thurs', 'Fri', 'Satur',
351    'January', 'February', 'March', 'April', 'May', 'June',
352    'July', 'August', 'September', 'October', 'November', 'December'
353  ]
354  // trailing backslash -> (dropped)
355  // a backslash followed by any character (including backslash) -> the character
356  // empty string -> empty string
357  var formatChr = /\\?(.?)/gi
358  var formatChrCb = function (t, s) {
359    return f[t] ? f[t]() : s
360  }
361  var _pad = function (n, c) {
362    n = String(n)
363    while (n.length < c) {
364      n = '0' + n
365    }
366    return n
367  }
368  f = {
369    // Day
370    d: function () {
371      // Day of month w/leading 0; 01..31
372      return _pad(f.j(), 2)
373    },
374    D: function () {
375      // Shorthand day name; Mon...Sun
376      return f.l()
377        .slice(0, 3)
378    },
379    j: function () {
380      // Day of month; 1..31
381      return jsdate.getDate()
382    },
383    l: function () {
384      // Full day name; Monday...Sunday
385      return txtWords[f.w()] + 'day'
386    },
387    N: function () {
388      // ISO-8601 day of week; 1[Mon]..7[Sun]
389      return f.w() || 7
390    },
391    S: function () {
392      // Ordinal suffix for day of month; st, nd, rd, th
393      var j = f.j()
394      var i = j % 10
395      if (i <= 3 && parseInt((j % 100) / 10, 10) === 1) {
396        i = 0
397      }
398      return ['st', 'nd', 'rd'][i - 1] || 'th'
399    },
400    w: function () {
401      // Day of week; 0[Sun]..6[Sat]
402      return jsdate.getDay()
403    },
404    z: function () {
405      // Day of year; 0..365
406      var a = new Date(f.Y(), f.n() - 1, f.j())
407      var b = new Date(f.Y(), 0, 1)
408      return Math.round((a - b) / 864e5)
409    },
410
411    // Week
412    W: function () {
413      // ISO-8601 week number
414      var a = new Date(f.Y(), f.n() - 1, f.j() - f.N() + 3)
415      var b = new Date(a.getFullYear(), 0, 4)
416      return _pad(1 + Math.round((a - b) / 864e5 / 7), 2)
417    },
418
419    // Month
420    F: function () {
421      // Full month name; January...December
422      return txtWords[6 + f.n()]
423    },
424    m: function () {
425      // Month w/leading 0; 01...12
426      return _pad(f.n(), 2)
427    },
428    M: function () {
429      // Shorthand month name; Jan...Dec
430      return f.F()
431        .slice(0, 3)
432    },
433    n: function () {
434      // Month; 1...12
435      return jsdate.getMonth() + 1
436    },
437    t: function () {
438      // Days in month; 28...31
439      return (new Date(f.Y(), f.n(), 0))
440        .getDate()
441    },
442
443    // Year
444    L: function () {
445      // Is leap year?; 0 or 1
446      var j = f.Y()
447      return j % 4 === 0 & j % 100 !== 0 | j % 400 === 0
448    },
449    o: function () {
450      // ISO-8601 year
451      var n = f.n()
452      var W = f.W()
453      var Y = f.Y()
454      return Y + (n === 12 && W < 9 ? 1 : n === 1 && W > 9 ? -1 : 0)
455    },
456    Y: function () {
457      // Full year; e.g. 1980...2010
458      return jsdate.getFullYear()
459    },
460    y: function () {
461      // Last two digits of year; 00...99
462      return f.Y()
463        .toString()
464        .slice(-2)
465    },
466
467    // Time
468    a: function () {
469      // am or pm
470      return jsdate.getHours() > 11 ? 'pm' : 'am'
471    },
472    A: function () {
473      // AM or PM
474      return f.a()
475        .toUpperCase()
476    },
477    B: function () {
478      // Swatch Internet time; 000..999
479      var H = jsdate.getUTCHours() * 36e2
480      // Hours
481      var i = jsdate.getUTCMinutes() * 60
482      // Minutes
483      // Seconds
484      var s = jsdate.getUTCSeconds()
485      return _pad(Math.floor((H + i + s + 36e2) / 86.4) % 1e3, 3)
486    },
487    g: function () {
488      // 12-Hours; 1..12
489      return f.G() % 12 || 12
490    },
491    G: function () {
492      // 24-Hours; 0..23
493      return jsdate.getHours()
494    },
495    h: function () {
496      // 12-Hours w/leading 0; 01..12
497      return _pad(f.g(), 2)
498    },
499    H: function () {
500      // 24-Hours w/leading 0; 00..23
501      return _pad(f.G(), 2)
502    },
503    i: function () {
504      // Minutes w/leading 0; 00..59
505      return _pad(jsdate.getMinutes(), 2)
506    },
507    s: function () {
508      // Seconds w/leading 0; 00..59
509      return _pad(jsdate.getSeconds(), 2)
510    },
511    u: function () {
512      // Microseconds; 000000-999000
513      return _pad(jsdate.getMilliseconds() * 1000, 6)
514    },
515
516    // Timezone
517    e: function () {
518      // Timezone identifier; e.g. Atlantic/Azores, ...
519      // The following works, but requires inclusion of the very large
520      // timezone_abbreviations_list() function.
521      /*              return that.date_default_timezone_get();
522       */
523      var msg = 'Not supported (see source code of date() for timezone on how to add support)'
524      throw new Error(msg)
525    },
526    I: function () {
527      // DST observed?; 0 or 1
528      // Compares Jan 1 minus Jan 1 UTC to Jul 1 minus Jul 1 UTC.
529      // If they are not equal, then DST is observed.
530      var a = new Date(f.Y(), 0)
531      // Jan 1
532      var c = Date.UTC(f.Y(), 0)
533      // Jan 1 UTC
534      var b = new Date(f.Y(), 6)
535      // Jul 1
536      // Jul 1 UTC
537      var d = Date.UTC(f.Y(), 6)
538      return ((a - c) !== (b - d)) ? 1 : 0
539    },
540    O: function () {
541      // Difference to GMT in hour format; e.g. +0200
542      var tzo = jsdate.getTimezoneOffset()
543      var a = Math.abs(tzo)
544      return (tzo > 0 ? '-' : '+') + _pad(Math.floor(a / 60) * 100 + a % 60, 4)
545    },
546    P: function () {
547      // Difference to GMT w/colon; e.g. +02:00
548      var O = f.O()
549      return (O.substr(0, 3) + ':' + O.substr(3, 2))
550    },
551    T: function () {
552      // The following works, but requires inclusion of the very
553      // large timezone_abbreviations_list() function.
554      /*              var abbr, i, os, _default;
555      if (!tal.length) {
556        tal = that.timezone_abbreviations_list();
557      }
558      if ($locutus && $locutus.default_timezone) {
559        _default = $locutus.default_timezone;
560        for (abbr in tal) {
561          for (i = 0; i < tal[abbr].length; i++) {
562            if (tal[abbr][i].timezone_id === _default) {
563              return abbr.toUpperCase();
564            }
565          }
566        }
567      }
568      for (abbr in tal) {
569        for (i = 0; i < tal[abbr].length; i++) {
570          os = -jsdate.getTimezoneOffset() * 60;
571          if (tal[abbr][i].offset === os) {
572            return abbr.toUpperCase();
573          }
574        }
575      }
576      */
577      return 'UTC'
578    },
579    Z: function () {
580      // Timezone offset in seconds (-43200...50400)
581      return -jsdate.getTimezoneOffset() * 60
582    },
583
584    // Full Date/Time
585    c: function () {
586      // ISO-8601 date.
587      return 'Y-m-d\\TH:i:sP'.replace(formatChr, formatChrCb)
588    },
589    r: function () {
590      // RFC 2822
591      return 'D, d M Y H:i:s O'.replace(formatChr, formatChrCb)
592    },
593    U: function () {
594      // Seconds since UNIX epoch
595      return jsdate / 1000 | 0
596    }
597  }
598
599  var _date = function (format, timestamp) {
600    jsdate = (timestamp === undefined ? new Date() // Not provided
601      : (timestamp instanceof Date) ? new Date(timestamp) // JS Date()
602      : new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int)
603    )
604    return format.replace(formatChr, formatChrCb)
605  }
606
607  return _date(format, timestamp)
608}
609function strtotime (text, now) {
610
611  var parsed
612  var match
613  var today
614  var year
615  var date
616  var days
617  var ranges
618  var len
619  var times
620  var regex
621  var i
622  var fail = false
623
624  if (!text) {
625    return fail
626  }
627
628  // Unecessary spaces
629  text = text.replace(/^\s+|\s+$/g, '')
630    .replace(/\s{2,}/g, ' ')
631    .replace(/[\t\r\n]/g, '')
632    .toLowerCase()
633
634  // in contrast to php, js Date.parse function interprets:
635  // dates given as yyyy-mm-dd as in timezone: UTC,
636  // dates with "." or "-" as MDY instead of DMY
637  // dates with two-digit years differently
638  // etc...etc...
639  // ...therefore we manually parse lots of common date formats
640  var pattern = new RegExp([
641    '^(\\d{1,4})',
642    '([\\-\\.\\/:])',
643    '(\\d{1,2})',
644    '([\\-\\.\\/:])',
645    '(\\d{1,4})',
646    '(?:\\s(\\d{1,2}):(\\d{2})?:?(\\d{2})?)?',
647    '(?:\\s([A-Z]+)?)?$'
648  ].join(''))
649  match = text.match(pattern)
650
651  if (match && match[2] === match[4]) {
652    if (match[1] > 1901) {
653      switch (match[2]) {
654        case '-':
655          // YYYY-M-D
656          if (match[3] > 12 || match[5] > 31) {
657            return fail
658          }
659
660          return new Date(match[1], parseInt(match[3], 10) - 1, match[5],
661          match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000
662        case '.':
663          // YYYY.M.D is not parsed by strtotime()
664          return fail
665        case '/':
666          // YYYY/M/D
667          if (match[3] > 12 || match[5] > 31) {
668            return fail
669          }
670
671          return new Date(match[1], parseInt(match[3], 10) - 1, match[5],
672          match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000
673      }
674    } else if (match[5] > 1901) {
675      switch (match[2]) {
676        case '-':
677          // D-M-YYYY
678          if (match[3] > 12 || match[1] > 31) {
679            return fail
680          }
681
682          return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
683          match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000
684        case '.':
685          // D.M.YYYY
686          if (match[3] > 12 || match[1] > 31) {
687            return fail
688          }
689
690          return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
691          match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000
692        case '/':
693          // M/D/YYYY
694          if (match[1] > 12 || match[3] > 31) {
695            return fail
696          }
697
698          return new Date(match[5], parseInt(match[1], 10) - 1, match[3],
699          match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000
700      }
701    } else {
702      switch (match[2]) {
703        case '-':
704          // YY-M-D
705          if (match[3] > 12 || match[5] > 31 || (match[1] < 70 && match[1] > 38)) {
706            return fail
707          }
708
709          year = match[1] >= 0 && match[1] <= 38 ? +match[1] + 2000 : match[1]
710          return new Date(year, parseInt(match[3], 10) - 1, match[5],
711          match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000
712        case '.':
713          // D.M.YY or H.MM.SS
714          if (match[5] >= 70) {
715            // D.M.YY
716            if (match[3] > 12 || match[1] > 31) {
717              return fail
718            }
719
720            return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
721            match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000
722          }
723          if (match[5] < 60 && !match[6]) {
724            // H.MM.SS
725            if (match[1] > 23 || match[3] > 59) {
726              return fail
727            }
728
729            today = new Date()
730            return new Date(today.getFullYear(), today.getMonth(), today.getDate(),
731            match[1] || 0, match[3] || 0, match[5] || 0, match[9] || 0) / 1000
732          }
733
734          // invalid format, cannot be parsed
735          return fail
736        case '/':
737          // M/D/YY
738          if (match[1] > 12 || match[3] > 31 || (match[5] < 70 && match[5] > 38)) {
739            return fail
740          }
741
742          year = match[5] >= 0 && match[5] <= 38 ? +match[5] + 2000 : match[5]
743          return new Date(year, parseInt(match[1], 10) - 1, match[3],
744          match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000
745        case ':':
746          // HH:MM:SS
747          if (match[1] > 23 || match[3] > 59 || match[5] > 59) {
748            return fail
749          }
750
751          today = new Date()
752          return new Date(today.getFullYear(), today.getMonth(), today.getDate(),
753          match[1] || 0, match[3] || 0, match[5] || 0) / 1000
754      }
755    }
756  }
757
758  // other formats and "now" should be parsed by Date.parse()
759  if (text === 'now') {
760    return now === null || isNaN(now)
761      ? new Date().getTime() / 1000 | 0
762      : now | 0
763  }
764  if (!isNaN(parsed = Date.parse(text))) {
765    return parsed / 1000 | 0
766  }
767  // Browsers !== Chrome have problems parsing ISO 8601 date strings, as they do
768  // not accept lower case characters, space, or shortened time zones.
769  // Therefore, fix these problems and try again.
770  // Examples:
771  //   2015-04-15 20:33:59+02
772  //   2015-04-15 20:33:59z
773  //   2015-04-15t20:33:59+02:00
774  pattern = new RegExp([
775    '^([0-9]{4}-[0-9]{2}-[0-9]{2})',
776    '[ t]',
777    '([0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?)',
778    '([\\+-][0-9]{2}(:[0-9]{2})?|z)'
779  ].join(''))
780  match = text.match(pattern)
781  if (match) {
782    // @todo: time zone information
783    if (match[4] === 'z') {
784      match[4] = 'Z'
785    } else if (match[4].match(/^([\+-][0-9]{2})$/)) {
786      match[4] = match[4] + ':00'
787    }
788
789    if (!isNaN(p
789arsed = Date.parse(match[1] + 'T' + match[2] + match[4]))) {
790      return parsed / 1000 | 0
791    }
792  }
793
794  date = now ? new Date(now * 1000) : new Date()
795  days = {
796    'sun': 0,
797    'mon': 1,
798    'tue': 2,
799    'wed': 3,
800    'thu': 4,
801    'fri': 5,
802    'sat': 6
803  }
804  ranges = {
805    'yea': 'FullYear',
806    'mon': 'Month',
807    'day': 'Date',
808    'hou': 'Hours',
809    'min': 'Minutes',
810    'sec': 'Seconds'
811  }
812
813  function lastNext (type, range, modifier) {
814    var diff
815    var day = days[range]
816
817    if (typeof day !== 'undefined') {
818      diff = day - date.getDay()
819
820      if (diff === 0) {
821        diff = 7 * modifier
822      } else if (diff > 0 && type === 'last') {
823        diff -= 7
824      } else if (diff < 0 && type === 'next') {
825        diff += 7
826      }
827
828      date.setDate(date.getDate() + diff)
829    }
830  }
831
832  function process (val) {
833    // @todo: Reconcile this with regex using \s, taking into account
834    // browser issues with split and regexes
835    var splt = val.split(' ')
836    var type = splt[0]
837    var range = splt[1].substring(0, 3)
838    var typeIsNumber = /\d+/.test(type)
839    var ago = splt[2] === 'ago'
840    var num = (type === 'last' ? -1 : 1) * (ago ? -1 : 1)
841
842    if (typeIsNumber) {
843      num *= parseInt(type, 10)
844    }
845
846    if (ranges.hasOwnProperty(range) && !splt[1].match(/^mon(day|\.)?$/i)) {
847      return date['set' + ranges[range]](date['get' + ranges[range]]() + num)
848    }
849
850    if (range === 'wee') {
851      return date.setDate(date.getDate() + (num * 7))
852    }
853
854    if (type === 'next' || type === 'last') {
855      lastNext(type, range, num)
856    } else if (!typeIsNumber) {
857      return false
858    }
859
860    return true
861  }
862
863  times = '(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec' +
864    '|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?' +
865    '|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)'
866  regex = '([+-]?\\d+\\s' + times + '|' + '(last|next)\\s' + times + ')(\\sago)?'
867
868  match = text.match(new RegExp(regex, 'gi'))
869  if (!match) {
870    return fail
871  }
872
873  for (i = 0, len = match.length; i < len; i++) {
874    if (!process(match[i])) {
875      return fail
876    }
877  }
878
879  return (date.getTime() / 1000)
880}
881
882
883
884// JJC - 상품목록 / 상품상세 찜하기 - 2017-11-27
885function product_wish( pcode ){
886	$.ajax({
887			url: "/pages/product.wish.pro.php",
888			cache: false,
889			type: "POST",
890			data: "pcode="+pcode,
891			success: function(data){
892				if(data == 'error1') { alert('잘못된 접근입니다.'); }
893				else if(data == 'error2') {
894					// SSJ : 호텔개선v2 : 2021-10-26
895					//alert('먼저 로그인 하세요.');
896					if(confirm("로그인 후 찜하기 가능합니다. \n\n로그인 하시겠습니까?")){
897						document.location.href = "/?pn=member.login.form";
898					}
899				}
900				else if(data == 'release') {
901					alert('선택하신 상품 찜을 해제했습니다.');
902					$(".wish_" + pcode).removeClass('hit');
903				}
904				else if(data == 'wish') {
905					alert('선택하신 상품을 찜했습니다.');
906					$(".wish_" + pcode).removeClass('hit').addClass('hit');
907				}
908			},
909			error:function(request,status,error){
910				alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
911			}
912	});
913
914}
915
916
917// JJC - 쿠폰다운로드 - 2017-11-27
918function coupon_download( pcode ){
919
920	$('body').append('<div style="position:fixed; top:50%; left:50%; margin-left:-150px; margin-top:-142px; z-index:2;" class="js_coupon_dw_loading"><img src="/pages/images/loading.gif" alt=""></div>');
921	$.ajax({
922		url: "/pages/download_coupon.pro.php",
923		cache: false,
924		type: "POST",
925		data: "pcode="+pcode,
926		success: function(data){
927			data = data.trim();
928			if(data == 'error_login') { if($('.js_coupon_dw_loading').length > 0) {$('.js_coupon_dw_loading').remove();} if(confirm('로그인 후 이용하실 수 있습니다. 로그인 하시겠습니까?')) location.href='/?pn=member.login.form&path='+login_path; }
929			else if(data == 'error_coupon') { if($('.js_coupon_dw_loading').length > 0) {$('.js_coupon_dw_loading').remove();} alert('쿠폰 준비중입니다.'); }
930			else if(data == 'error_product') { if($('.js_coupon_dw_loading').length > 0) {$('.js_coupon_dw_loading').remove();} alert('상품정보가 잘못되었습니다.'); }
931			else if(data == 'sold_out') { if($('.js_coupon_dw_loading').length > 0) {$('.js_coupon_dw_loading').remove();} alert('해당 쿠폰은 품절되었습니다.'); }
932			else if(data == 'already_download') { if($('.js_coupon_dw_loading').length > 0) {$('.js_coupon_dw_loading').remove();} alert('이미 쿠폰이 발급되었습니다. 나의 쿠폰함을 확인하세요.'); location.href=("/?pn=mypage.coupon.list");}
933			else if(data == 'success') { if($('.js_coupon_dw_loading').length > 0) {$('.js_coupon_dw_loading').remove();} alert('무료쿠폰을 다운로드 하였습니다.'); location.href=("/?pn=mypage.coupon.list");}
934			else { if($('.js_coupon_dw_loading').length > 0) {$('.js_coupon_dw_loading').remove();} alert(data); }
935		},
936		error:function(request,status,error){
937			if($('.js_coupon_dw_loading').length > 0) {$('.js_coupon_dw_loading').remove();}
938			alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
939		}
940	});
941}
942
943// - JJC : 호텔개선v2 : 2021-10-24
944// -- SSJ : 호텔개선v2 : 2021-10-26 -- 주소 복사 ----
945function copyToClipboardMsg(id) {
946	var elem = document.getElementById(id);	
947	$("#" + id).show();
948	var succeed = copyToClipboard(elem);
949	if (!succeed) {
950		msg = "복사 도중 오류가 발생하였습니다."
951		alert(msg);
952		return;
953	}
954	alert('복사가 완료되었습니다.\nCtrl+V로 붙여넣기 하셔서 사용하세요');
955	$("#" + id).hide();
956}
957function copyToClipboard(elem) {
958	var targetId = "_hiddenCopyText_";
959	var isInput = elem.tagName === "INPUT" || elem.tagName === "TEXTAREA";
960	var origSelectionStart, origSelectionEnd;
961	if (isInput) {
962		// can just use the original source element for the selection and copy
963		target = elem;
964		origSelectionStart = elem.selectionStart;
965		origSelectionEnd = elem.selectionEnd;
966	} else {
967		// must use a temporary form element for the selection and copy
968		target = document.getElementById(targetId);
969		if (!target) {
970			var target = document.createElement("textarea");
971			target.style.position = "absolute";
972			target.style.left = "-9999px";
973			target.style.top = "0";
974			target.id = targetId;
975			document.body.appendChild(target);
976		}
977		target.textContent = elem.textContent;
978	}
979	// select the content
980	var currentFocus = document.activeElement;
981	target.focus();
982	target.setSelectionRange(0, target.value.length);
983
984	// copy the selection
985	var succeed;
986	try {
987		succeed = document.execCommand("copy");
988	} catch(e) {
989		succeed = false;
990	}
991	// restore original focus
992	if (currentFocus && typeof currentFocus.focus === "function") {
993		currentFocus.focus();
994	}
995	//console.log(succeed);
996	if (isInput) {
997		// restore prior selection
998		elem.setSelectionRange(origSelectionStart, origSelectionEnd);
999	} else {
1000		// clear temporary content
1001		target.textContent = "";
1002	}
1003	return succeed;
1004}
1005// -- SSJ : 호텔개선v2 : 2021-10-26 -- 주소 복사 ----
1006// - JJC : 호텔개선v2 : 2021-10-24

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.