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.