1var NUM = "0123456789"; 2var DNUM = NUM+"."; 3var SALPHA = "abcdefghijklmnopqrstuvwxyz"; 4var ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"+SALPHA; 5var EMAIL = "!#$%&*+-./=?@^_`{|}"+NUM+ALPHA; 6var PASSWORD = "!?@.#,$%^*&_-"+ALPHA+NUM; 7 8var oldNum=new Array(); 9oldNum['qna']=''; 10oldNum['rev']=''; 11 12var isCRM; 13 14String.prototype.trim = function() { 15 var str = this; 16 return this.replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g, ''); 17} 18 19String.prototype.toNumber = Number.prototype.toNumber = function() { 20 var num = this; 21 if(typeof this == 'string') { 22 num = this.replace(/[^0-9.]/, ''); 23 num = num.replace(',', ''); 24 } 25 26 num = /^[0-9]+\.[0-9]+$/.test(num) ? parseFloat(num) : parseInt(num); 27 if(isNaN(num)) num = 0; 28 return num; 29} 30 31String.prototype.format = function(args1, args2, args3, args4, args5) { 32 var arguments = new Array(); 33 if(args1) arguments[0] = args1; 34 if(args2) arguments[1] = args2; 35 if(args3) arguments[2] = args3; 36 if(args4) arguments[3] = args4; 37 if(args5) arguments[4] = args5; 38 39 var formatted = this; 40 for (var arg in arguments) { 41 formatted = formatted.replace("{" + arg + "}", arguments[arg]); 42 } 43 return formatted; 44} 45 46function byName(nm, from) { // document.í¼ë¤ì ì¼ë¡ ì²ë¦¬í 구ì¤í¬ë¦½í¸ ì²ë¦¬ì© 47 if(!from) from = document; 48 var el = from.getElementsByName(nm); 49 return (el.length > 0) ? el[0] : null; 50} 51 52function CheckType(s,spc) { 53 var i; 54 for(i=0; i<s.length; i++) { 55 if(spc.indexOf( s.substring(i, i+1)) < 0) { 56 return false; 57 } 58 } 59 return true; 60} 61 62function nextTab(obj,nxt,len){ 63 if(obj.value.length>=len) nxt.focus(); 64} 65 66function setConfig(name,value){ 67 setCookie( name, value, 365 ); 68 window.alert(_lang_pack.common_save_setting); 69} 70 71function setCookie(name, value, expiredays){ 72 var todayDate = new Date(); 73 todayDate.setDate( todayDate.getDate() + expiredays ); 74 document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 75} 76 77function addFav(url, title) { 78 var url = root_url; 79 var title = document.title; 80 if(window.sidebar && window.sidebar.addPanel) { // Firefox 81 window.sidebar.addPanel(title, url, ""); 82 } else if(window.opera && window.print) { // Opera 83 window.alert(_lang_pack.common_bookmark_function); 84 return true; 85 }else if(window.external){ // IE 86 try { 87 window.external.AddFavorite(url, title); 88 } catch(e) { 89 window.alert(_lang_pack.common_bookmark_function); 90 } 91 } else { 92 window.alert(_lang_pack.common_bookmark_function); 93 } 94} 95 96function getCookie( name ){ 97 var nameOfCookie = name + "="; 98 var x = 0; 99 while(x <= document.cookie.length) { 100 var y = (x+nameOfCookie.length); 101 if(document.cookie.substring( x, y ) == nameOfCookie ){ 102 if((endOfCookie=document.cookie.indexOf( ";", y )) == -1) 103 endOfCookie = document.cookie.length; 104 return unescape( document.cookie.substring( y, endOfCookie ) ); 105 } 106 x = document.cookie.indexOf( " ", x ) + 1; 107 if(x == 0) break; 108 } 109 return ""; 110} 111 112function layTgl(obj, speed) { 113 var obj = $(obj); 114 if(obj.length < 1) return; 115 116 if(obj.css('display') == 'none') obj.show(speed); 117 else obj.hide(speed); 118} 119 120function layTgl2(obj_name) { 121 layTgl(document.getElementById(obj_name)); 122} 123 124function textDisable(o,d){ 125 if(d) { 126 o.style.backgroundColor='#EFEFEF'; 127 o.disabled=true; 128 } else { 129 o.style.backgroundColor=''; 130 o.disabled=false; 131 } 132} 133 134function checkBlank(o,m){ 135 if(typeof o=='undefined') return true; 136 if(o.value.trim() == '') { 137 window.alert(m); 138 try { o.focus(); } catch (ex) { } 139 return false; 140 } 141 return true; 142} 143 144function checkSel(o,m){ 145 if(o.selectedIndex == 0) { 146 window.alert(m); 147 o.focus(); 148 return false; 149 } 150 return true; 151} 152 153function checkCB(obj, msg){ 154 var icbk=0; 155 if(!obj) { 156 window.alert(_lang_pack.common_no_selected); 157 return false; 158 } 159 160 if(obj.length) { 161 for (dh=0; dh<obj.length; dh++) { 162 if(obj[dh].checked==true) { 163 icbk++; 164 break; 165 } 166 } 167 } else if(obj && obj.checked==true) { 168 icbk++; 169 } 170 171 if(icbk<1) { 172 window.alert(msg); 173 return false; 174 } 175 return true; 176} 177 178function checkAll(obj, ck){ 179 if($.prop) { 180 $(obj).prop('checked', ck); 181 } else { 182 $(obj).attr('checked', ck); 183 } 184 if($(obj).is(':checked') == true) $(obj).parents('tr').addClass('checked'); 185 else $(obj).parents('tr').removeClass('checked'); 186} 187 188function checkNum(o, m) { 189 if(/[^0-9\.]/.test(o.value)) { 190 window.alert(_lang_pack.common_number_only); 191 o.focus(); 192 return false;
193 } 194 return true; 195} 196 197function wisaOpen(url,name,scroll,w,h) { 198 if(!scroll) scroll='no'; 199 if(!w) w='100'; 200 if(!h) h='100'; 201 if(isCRM) crmFrm.location.href = url; 202 else return window.open(url,name,'top=10px,left=10px,height='+h+'px,width='+w+'px,status=yes,resizable=yes,scrollbars='+scroll+',toolbar=no,menubar=no'); 203} 204 205function selfResize(w, h){ 206 var bw = document.documentElement.scrollWidth; 207 var bh = document.documentElement.scrollHeight; 208 var cw = document.documentElement.clientWidth; 209 var ch = document.documentElement.clientHeight; 210 211 if(bh > window.screen.availHeight) bh = window.screen.availHeight-(window.screenY+50); // MS Edge 212 213 var w1 = (w) ? w : bw; 214 var h1 = (h) ? h : bh; 215 if(w1 < 100) w1 = 100; 216 if(h1 < 100) h1 = 100; 217 window.resizeBy(w1-cw, h1-ch); 218} 219 220// ì°ì form submit ë°©ì§ 221var preventContinuousClickEvent = function() { 222 return false; 223} 224function preventContinuousClick(f, sec) { 225 if(!sec) sec = 1000; 226 227 $(f).bind('submit', preventContinuousClickEvent); 228 setTimeout(function() { 229 $(f).unbind('submit', preventContinuousClickEvent); 230 }, sec); 231} 232 233function Resize(w, h) { 234 var sh = screen.Height-150; 235 if(h>sh) h=sh; 236 237 if(Math.abs(document.body.offsetWidth - document.body.clientWidth) > 5) window.resizeTo(w + 26, h + 55); 238 else window.resizeTo(w + 10, h + 59); 239} 240 241function zipSearch(form_nm,zip_nm,addr1_nm,addr2_nm,zip_mode){ 242 var zip_mode = (zip_mode == 2) ? 2 : 1; 243 var srurl='/common/zip_search.php?form_nm='+form_nm+'&zip_nm='+zip_nm+'&addr1_nm='+addr1_nm+'&addr2_nm='+addr2_nm+'&zip_mode='+zip_mode+'&urlfix=Y'; 244 var target = document.getElementById("zipT"); 245 if(target) { 246 target.style.display = "block"; 247 target.src = srurl; 248 } else { 249 window.open(srurl,'zip', ('scrollbars=yes,resizable=no,width=374px, height=170px')); 250 } 251} 252 253function zipSearch2(form_nm, val) { 254 var srurl=root_url+'/main/exec.php?exec_file=common/zipSearch.php&form_nm='+form_nm+'&search='+encodeURIComponent(val); 255 var zip_mode = $('form[name='+form_nm+']').find(':checked[name=zip_mode]'); 256 if(zip_mode) { 257 srurl += '&zip_mode='+zip_mode.val(); 258 } 259 260 //íìë¶ ì£¼ìAPI ì¬ì© 261 if(juso_api_use == 'Y' || juso_api_use == 'D') { 262 //ë ì´ì´ìì± 263 if(!$('#juso_api_layer').length) { 264 $('body').append("<div id='juso_api_layer' style='display:none; overflow-y:scroll; position:fixed; z-index:10; width:100%; height:100%; background-color:#fff;'></div>"); 265 var element_layer = document.getElementById('juso_api_layer'); 266 element_layer.style.border = '1px solid'; 267 element_layer.style.left = '0px'; 268 element_layer.style.top = '0px'; 269 270 //주ìê²ìì°½ ì ê±° 271 if($('#addressee_sel').length)$('#addressee_sel').remove(); 272 273 //íì´ì§ì´ë²¤í¸ ëì ë¡ë 274 $(document).on("click",".loadAJAXPaging_juso",function() { 275 var _paramEncode = $(this).attr("href").split('&'); 276 $.each(_paramEncode, function(i, val) { 277 if(/^search/i.test(val)) { 278 _tmp_val = val.split('='); 279 val = _tmp_val[0]+"="+encodeURIComponent(_tmp_val[1]); 280 } 281 if(i) _paramEncode += "&"+val; 282 else _paramEncode = val; 283 }); 284 $.ajax({ 285 type: 'get', 286 url: root_url+'/main/exec.php'+_paramEncode+'&exec_file=common/zipSearch.php', 287 dataType : 'json', 288 async : false, 289 success: function(result) { 290 if(result.result == true) { 291 $('#juso_api_layer').html(result.data); 292 } else { 293 alert(result.message); 294 } 295 } 296 }); 297 return false; 298 }) 299 } 300 301 //ë°ì´í° ë¡ë 302 if (juso_api_use == 'D') { 303 $.ajaxSetup({cache: true}); 304 $.getScript('https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js', function() { 305 juso_api_layer_show(); 306 307 $.get('/main/exec.php?exec_file=common/zipSearch.php', function(r) { // ì¤í¨ 308 $('#juso_api_layer').html(r); 309 $('.layer_zip_addr_list>table').replaceWith('<div id="daum_wrap"></div>'); 310 $('#daum_wrap').css({ 311 'height':(window.screen.availHeight-$('.layer_zip_addr_list>.title').outerHeight()-2)+'px'} 312 ); 313 314 // ë¤ì ì°í¸ë²í¸ 본체 315 var f = $('form[name='+form_nm+']')[0]; 316 new daum.Postcode({ 317 oncomplete: function(data) { 318 zipInputLayer(form_nm, data.address, data.zonecode); 319 }, 320 width: '100%', 321 height: '100%' 322 }).embed(document.getElementById('daum_wrap'), {q: f.addressee_dong.value}); 323 }); 324 }); 325 } else { 326 $.ajax({ 327 type: 'get', 328 url: srurl, 329 dataType : 'json', 330 async : false, 331 success: function(result) { 332 if(result.result == true) { 333 $('#juso_api_layer').html(result.data); 334 juso_api_layer_show(); 335 } else { 336 alert(result.message); 337 } 338 } 339 }); 340 } 341 } else { 342 var frm = document.getElementsByName(hid_frame); 343 frm[0].src = srurl; 344 } 345} 346 347function zipInput(f) { 348 var sel = $('[name=addressee_sel]', f).val(); 349 var tmp = sel.split(' '); 350 var zip = tmp[0]; 351 var addr = sel.replace(new RegExp('^'+zip, 'gi'), ''); 352 353 if(f.elements['addressee_zip']) { 354 f.elements['addressee_zip'].value=zip; 355 f.elements['addressee_addr1'].value=addr; 356 } else { 357 f.elements['zip'].value=zip; 358 f.elements['addr1'].value=addr; 359 } 360 361 if(f.ono) { 362 useMilage(f, 3); 363 } 364} 365 366function zipInputLayer(form_nm, addr, zip) { 367 368 var f = document.getElementsByName(form_nm)[0]; 369 if(f.elements['addressee_zip']) { 370 f['addressee_zip'].value=zip; 371 f['addressee_addr1'].value=addr; 372 } else { 373 f.elements['zip'].value=zip; 374 f.elements['addr1'].value=addr; 375 } 376 377 //ë ì´ì´ ì¨ê¹ì²ë¦¬ 378 juso_api_layer_hide(); 379 380 if(f.ono) { 381 useMilage(f, 3); 382 } 383} 384 385function juso_api_layer_show() { 386 window.oriScroll = $(window).scrollTop(); 387 $('body').children().each(function(i) { 388 if($(this).css('display') != 'none') { 389 $(this).addClass('juso_api_hidden'); 390 } 391 $(this).hide(); 392 }); 393 $('#juso_api_layer').show(); 394 return false;
395} 396 397function juso_api_layer_hide() { 398 $('.juso_api_hidden').show().removeClass('juso_api_hidden'); 399 $('#juso_api_layer').hide(); 400 $(window).scrollTop(window.oriScroll); 401 return false; 402} 403 404function CheckMail(email){ 405 var aindex=email.indexOf("@"); 406 var dotindex=email.indexOf("."); 407 408 if(aindex==-1 || dotindex==-1) return false; 409 return true; 410} 411 412function isEmpty(data){ 413 for(ii=0; ii<data.length; ii++) { 414 if(data.substring(ii, ii+1) != " ") return false; 415 } 416 return true; 417} 418 419function checkPhone(o,m){ 420 var r=9; 421 422 if(o && o.tagName) { 423 if(isEmpty(o.value) == true) r = 0; 424 return r; 425 } 426 427 for (i=0; i<3; i++) { 428 if(isEmpty(o[i].value) || !CheckType(o[i].value, NUM)) { 429 r=i; 430 break; 431 } 432 } 433 return r; 434} 435 436function chgEmail(txt,sel,current) { 437 if(typeof sel=='undefined') return; 438 439 if(current) { 440 for (i=0; i<sel.length; i++) { 441 if(sel[i].value==current) { 442 sel.selectedIndex=i; 443 break; 444 } 445 } 446 447 if(sel.selectedIndex==0) sel.selectedIndex=sel.length-1; 448 } 449 else txt.value=sel.value; 450 451 if(sel.selectedIndex<sel.length-1) { 452 txt.readOnly=true; 453 txt.style.backgroundColor='#e0e0e0'; 454 } else { 455 txt.readOnly=false; 456 txt.style.backgroundColor=''; 457 } 458} 459 460var openssl_bak = ""; 461function checkLoginFrm(f){ 462 if(f.member_type) { 463 if(!checkCB(f.member_type, _lang_pack.common_input_mtype)) return false; 464 } 465 if(!checkBlank(f.member_id, _lang_pack.common_input_memberid)) return false; 466 if(!checkBlank(f.pwd, _lang_pack.common_input_pwd)) return false; 467 468 if(f.setHttps) { 469 f.action = (f.setHttps.checked == true) ? f.action.replace ("http:","https:") : f.action.replace ("https:","http:"); 470 } 471 472 if(f.setOpenSSL) { // ì ìë³ì setOpenSSL ì common.js ì ì ì¸ëì´ììµëë¤. 473 if(!openssl_bak) openssl_bak = f.action; 474 f.action = (f.setOpenSSL.checked == true) ? ssl_url : openssl_bak; 475 } 476 printFLoading(); 477} 478 479function checkGuestOrderFrm(f){ 480 if(!checkBlank(f.ono, _lang_pack.common_input_ono)) return false; 481 if(!checkBlank(f.phone, _lang_pack.common_input_phonenum)) return false; 482 483 if(ssl_type != 'Y') { 484 if(f.setOpenSSL) { // ì ìë³ì setOpenSSL ì common.js ì ì ì¸ëì´ììµëë¤. 485 if(!openssl_bak) openssl_bak = f.action; 486 f.action = (f.setOpenSSL.checked == true) ? ssl_url : openssl_bak; 487 } 488 } 489} 490 491function memberOnly(u,c,t){ 492 if(mlv==10) { 493 if(c==1 && !confirm(_lang_pack.common_confirm_login)) { 494 if(t==1) return false; 495 else return; 496 u=''; 497 } 498 u=root_url+'/member/login.php?rURL='+escape(u); 499 } 500 if(u && t!=3) location.href=u; 501 else if(t==1 || t==3) return true; 502} 503 504function checkSearchFrm(f){ 505 if(!checkBlank(f.search_str, _lang_pack.common_input_searchstr)) return false; 506} 507 508function layTglList(old,lay_name,lay_no){ 509 var olay = document.getElementById(lay_name+oldNum[old]); 510 var nlay = document.getElementById(lay_name+lay_no); 511 512 if(oldNum[old]!=lay_no) { 513 if(oldNum[old]) { 514 if(olay) olay.style.display="none"; 515 } 516 if(nlay) nlay.style.display="block"; 517 oldNum[old]=lay_no; 518 } else { 519 if(nlay) nlay.style.display="none"; 520 oldNum[old]=""; 521 } 522 523 $('.layTgl_img_'+lay_no).each(function() { 524 try { 525 var img = $(this); 526 var _width = parseInt(img.attr('_width')); 527 var _height = parseInt(img.attr('_height')); 528 529 if(img.width() > _width) img.width(_width); 530 else if(img.height() > _height) img.height(_height); 531 } catch(ex) { 532 533 } 534 }); 535} 536 537function setComma(str, chk) { 538 if(typeof str != 'string' && typeof str != 'number') return str; 539 if(currency_decimal > 0){ 540 var str = str.toString().replace(/,/g, ''); 541 }else{ 542 var str = str.toString().replace(/,/g, '').replace(/^0+([^0])/, '$1'); 543 } 544 if(chk) { 545 if(/[^0-9]/.test(str)) { 546 window.alert(_lang_pack.common_number_only); 547 return false; 548 } 549 } 550 551 return str.replace(/([0-9])(?=([0-9]{3})+(?![0-9]))/g, '$1,'); 552} 553 554function removeComma(str) { 555 if(typeof(str) == 'string') str = str.replace(/,/g, ''); 556 return str; 557} 558 559function removeDot(str) { 560 if(typeof(str) == 'string') str = str.replace("\.", ''); 561 return str; 562} 563 564function kcpCardReceipt(tno){ 565 url='http://admin.kcp.co.kr/Modules/Sale/Card/ADSA_CARD_BILL_Receipt.jsp?c_trade_no='+tno 566 window.open(url,name,'top=10,left=10,height=700,width=440,status=no,scrollbars=yes,toolbar=no,menubar=no'); 567} 568 569function inicisCardReceipt(tid) { 570 var receiptUrl = "https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid=" + tid + "&noMethod=1"; 571 window.open(receiptUrl,"receipt","width=430,height=700"); 572} 573 574function closePopup(popup){ 575 setCookie(popup,'Y',1); 576 window.close(); 577} 578 579function closePopup2(popup,n){ 580 setCookie(popup,'Y',1); 581 layTgl2('wm_popup_'+n); 582} 583 584function closePopup7(popup,n){ 585 setCookie(popup,'Y',7); 586 layTgl2('wm_popup_'+n); 587} 588 589function closePopup3(url){ 590 if(url) { 591 parent.document.location.href=url; 592 } 593 window.close(); 594} 595 596function newSMSpwd(){ 597 url=root_url+'/member/sms_find.php'; 598 location.href = url; 599} 600 601function click_prd_scroll(t){ 602 if(click_prd.length<1) return; 603 604 if(t=="+") { 605 tmp=click_prd_finish+1; 606 if(tmp>click_prd.length) { 607 window.alert(_lang_pack.common_recentprd_last); 608 return; 609 } 610 click_prd_start++; 611 click_prd_finish++; 612 } else { 613 tmp=click_prd_finish-1; 614 if(tmp==click_prd_limit) { 615 window.alert(_lang_pack.common_recentprd_first); 616 return; 617 } 618 click_prd_start--; 619 click_prd_finish--; 620 } 621 622 for (i=click_prd_start; i<click_prd_finish; i++) { 623 tmp=i-click_prd_start; 624 document.getElementById('click_prd_title'+tmp).innerHTML=click_prd[i]; 625 } 626} 627 628function viewMember2(n,id){ 629 if(id == undefined) id=''; 630 var nurl=root_url+'/_manage/?body=member@member_view.frm&ref_front=true&mno='+n+'&mid='+id; 631 window.open(nurl,'view_member','top=10,left=10,width=950,status=no,toolbars=no,scrollbars=yes'); 632} 633 634function flashMovie(fid, src, wid, hei, fvs, wmd, version) { 635 var fPrint = ''; 636 var Id = document.getElementById(fid); 637 var Src = src; 638 var Width = wid; 639 var Height = hei; 640 var FlashVars = (fvs != undefined)? fvs :''; 641 var Wmod = (wmd != undefined)? wmd :''; 642 if(!version) version = '10,0,0,0'; 643
644 if(isObject(Id)) { 645 fPrint = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="'+version+' width="'+Width+'" height="'+Height+'" id="wisa_'+fid+'">'; 646 fPrint += '<param name="movie" value="'+Src+'">'; 647 fPrint += '<param name="allowScriptAccess" value="always" />'; 648 fPrint += '<param name="allowFullScreen" value="false" />'; 649 fPrint += '<param name="quality" value="high">'; 650 fPrint += (FlashVars != null) ? '<param name="FlashVars" value="'+FlashVars+'">' : ''; 651 fPrint += (Wmod != null) ? '<param name="wmode" value="'+Wmod+'">' : ''; 652 fPrint += '<embed'; 653 fPrint += ' src="'+Src+'"'; 654 fPrint += (FlashVars != null) ? ' FlashVars="'+FlashVars+'"' : ''; 655 fPrint += (Wmod != null) ? ' wmode="'+Wmod+'"' : ''; 656 fPrint += ' quality="high"'; 657 fPrint += ' allowScriptAccess="always"'; 658 fPrint += ' allowFullScreen="false"'; 659 fPrint += ' pluginspage="http://www.macromedia.com/go/getflashplayer"'; 660 fPrint += ' type="application/x-shockwave-flash" '; 661 fPrint += ' width="'+Width+'"'; 662 fPrint += ' height="'+Height+'"'; 663 fPrint += '></embed>'; 664 fPrint += '</object>'; 665 Id.innerHTML = fPrint; 666 } 667} 668 669function isObject(a) { 670 return (a && typeof a == 'object'); 671} 672 673function flashMovie2(fid,src,wid,hei,fvs,wmd) { 674 flashMovie(fid, src, wid, hei, fvs, wmd, '9,0,0,0'); 675} 676 677function viewWMMsg(n) { 678 var url = (n) ? root_url+'/mypage/msg_view.php?no='+n : root_url+'/mypage/msg_list.php?mode=1'; 679 wisaOpen(url,'wmMgsWin'); 680} 681 682function trim(str){ 683 return str.replace(/^\s*/,'').replace(/\s*$/, '');; 684} 685 686function qmc_check(o){ 687 if(o.checked==true) r='Y'; 688 else r='N'; 689 690 setCookie('quick_menu_move_check',r,365); 691} 692 693function seImgSize(o,width) { 694 if(o.width > width) o.style.width=width; 695} 696 697function AdminMailSend(url,w,h){ 698 if(!w) w=500; if(!h) h=500; 699 var Op=window.open(url, "AdminM", "width="+w+", height="+h+", status=no, scrollbars=yes"); 700 Op.focus(); 701} 702 703function adminMSck(f) { 704 if(!checkBlank(f.from_name, _lang_pack.common_input_name)) return false; 705 if(!checkBlank(f.from_email, _lang_pack.common_input_email)) return false; 706 if(!checkBlank(f.sub, _lang_pack.common_input_subject)) return false; 707 if(!checkBlank(f.content, _lang_pack.common_input_content)) return false; 708} 709 710function getHttpRequest(URL,method) { 711 nochache = new Date(); 712 713 if( URL.indexOf("?") < 0) URL += "?"; 714 715 URL = URL+"&ncache="+nochache; 716 if( method == null ) method = "GET"; 717 718 var xmlhttp = null; 719 if(window.XMLHttpRequest) xmlhttp = new XMLHttpRequest(); 720 else xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 721 xmlhttp.open(method, URL, false); 722 723 xmlhttp.onreadystatechange = function() { 724 if(xmlhttp.readyState==4 && xmlhttp.status == 200 && xmlhttp.statusText=='OK') { 725 responseText = xmlhttp.responseText; 726 } 727 } 728 xmlhttp.send(''); 729 730 return responseText = xmlhttp.responseText; 731} 732 733function createBackDiv(target, bgC, w, h, fr){ 734 var w=w ? w : 830; 735 var h=h ? h : 500; 736 var fr=fr ? fr : ''; 737 var bw=target.document.body.clientWidth; 738 var bh=target.document.body.scrollHeight; 739 var bh2=target.document.body.clientHeight; 740 var oh=target.document.body.scrollTop; 741 var posX=(bw-w)/2; 742 var posY=(bh-h)/2; 743 744 if(!target.document.getElementById('dmMainBgDiv')){ 745 var obj=target.document.createElement('div'); 746 with(obj.style){ 747 position='absolute'; 748 left=0; 749 top=0; 750 width='100%'; 751 height=(bh < bh2) ? bh2 : bh; 752 backgroundColor='#000000'; 753 filter='Alpha(Opacity=50)'; 754 opacity='0.5'; 755 zIndex='50'; 756 } 757 obj.id='dmMainBgDiv'; 758 target.document.body.appendChild(obj); 759 obj.innerHTML='<iframe style="width:100%; height:100%; opacity:0; filter=\'Alpha(Opacity=0);\'"></iframe>'; 760 761 obj=target.document.createElement('div'); 762 with(obj.style){ 763 position='absolute'; 764 left=posX; 765 top=oh+10; 766 width=w; 767 height=bh2-20; 768 if(bgC) backgroundColor=bgC; 769 zIndex='100'; 770 } 771 obj.id='dmMainDiv'; 772 target.document.body.appendChild(obj); 773 } 774} 775 776function finishedHosting(url, type){ 777 createBackDiv(this, ''); 778 bh=document.body.clientHeight; 779 posY=(bh-417)/2; 780 div=document.getElementById('dmMainDiv'); 781 if(type == 1){ // ì¬ì©ì 782 content='<img src="'+url+'/_manage/image/service/hosting_end2.gif" width="550" height="417">'; 783 }else{ 784 content='<img src="'+url+'/_manage/image/service/hosting_end1.gif" width="550" height="417" usemap="#goExtend">\n'; 785 content+='<map name="goExtend"><area shape="rect" href="./?body=service@service_main&stype=1" coords="212,180,339,220"></map>'; 786 } 787 div.innerHTML='<div id="finishHDiv" align="center" style="padding-top:'+posY+'px;">'+content+'</div>'; 788} 789 790function wclose() { 791 if(parent.isCRM) { 792 var frm = parent.document.getElementById("crmFrm"); 793 frmHeight = frm.offsetHeight; 794 if(frm) frm.style.height = 0; 795 796 parent.Resize(parent.document.body.scrollWidth, parent.document.body.scrollHeight); 797 parent.document.getElementById("crmDiv").style.overflow = "hidden"; 798 } 799 else window.close() 800} 801 802function FilterNumOnly(i) { 803 if(!i) return; 804 805 if(currency_decimal > 0){ 806 var exp = /[^0-9.]+/; 807 }else{ 808 var exp = /[^0-9]+/; 809 } 810 while(exp.test(i.value) == true){ 811 i.value = i.value.replace(exp, ''); 812 } 813} 814 815function addEvent(object, event ,listener) { 816 if(object.addEventListener) object.addEventListener (event, listener, false); 817 else if(object.attachEvent) object.attachEvent ('on' + event, listener); 818} 819 820function moveCate(db) { 821 var f = document.getElementById('selectCateFrm'); 822 document.location.href=root_url+"/board/?db="+db+"&cate="+f.selectCate.value; 823} 824 825function goValidEscrow(mertid){ 826 var strMertid = mertid; 827 window.open("https://pgweb.dacom.net/pg/wmp/mertadmin/jsp/mertservice/s_escrowYn.jsp?mertid="+strMertid,"check","width=339, height=263, scrollbars=no, left = 200, top = 50"); 828 829} 830 831function goValidEscrowByBusiNo(busino, hashdata){ 832 window.open("https://pgweb.dacom.net/pg/wmp/mertadmin/jsp/mertservice/s_escrowYn.jsp?busino="+busino+"&hashdata="+hashdata,"check","width=339, height=263, scrollbars=no, left = 200, top = 50"); 833} 834 835// Quick Preview 836function quickDetailPopup(obj, pno, cno1) { 837 $.get(root_url+'/main/exec.php?exec_file=shop/quickDetail.exe.php', {"type":"popup", "pno":pno}, function(json) { 838 var json = $.parseJSON(json); 839 840 if(json.qd1_use != 'Y') { 841 document.location.href = root_url+'/shop/detail.php?ano='+pno; 842 return; 843 } 844
845 $('#qdBackground').remove(); 846 $('#qdMain').remove(); 847 848 var de = document.documentElement.scrollTop >= document.body.scrollTop ? document.documentElement : document.body; 849 var clientHeight = $(window).height(); 850 var bodyType = navigator.appName.indexOf("Internet Explorer") != -1 ? 'html' : 'body'; 851 852 $(bodyType).css('overflow','hidden'); 853 $('body').attr('_mr_', $('body').css('margin-right')).css('margin-right','18px'); 854 855 // background 856 var bg = $(document.createElement('div')) 857 .css({"z-index":99, "position":"absolute", "left":"0", "top":"0", "width":de.scrollWidth, "height":de.scrollHeight, "background-color":json.qd1_bgcolor, "opacity":(json.qd1_opacity/100)}) 858 .addClass('qdBackground') 859 .attr('id', 'qdBackground'); 860 861 $('body').append(bg); 862 863 var param = ''; 864 if(json.qd1_scroll == '2') { 865 param += '&height='+(clientHeight-json.qd1_margin-30); 866 } 867 if(cno1) param += '&cno1='+cno1; 868 869 // main 870 $('body').append("<iframe id='qdMain' class='qdMain' allowtransparency=true frameborder=0></iframe>"); 871 $('#qdMain').css({"z-index":100, "position":"absolute", "top":de.scrollTop, "left":0, "width":de.scrollWidth, "height":"100%", "display":"none"}) 872 .attr("src", "/main/exec.php?exec_file=shop/quickDetail.inc.php&striplayout=1&type=popup&ano="+pno+param) 873 .ready(function() { 874 $('#qdMain').show(); 875 }); 876 }); 877} 878 879function setAnchorLink() { 880 $('a').each(function() { 881 if(!this.target) { 882 if(/quickDetail|^javascript/i.test(this.href) == false) { 883 this.target = '_parent'; 884 } 885 } 886 }); 887} 888 889function removequickDetailPopup() { 890 if(navigator.userAgent.indexOf('Trident') > -1) { 891 $('#qdBackground').remove(); 892 $('#qdMain').remove(); 893 894 $(document.documentElement).css('overflow','auto'); 895 $('body').css('margin-right', $('body').attr('_mr_')); 896 } else { 897 $('#qdBackground').fadeOut('fast', function() { 898 $(this).remove(); 899 }); 900 $('#qdMain').fadeOut('fast', function() { 901 $(this).remove(); 902 903 var bodyType = navigator.appName.indexOf("Internet Explorer") != -1 ? 'html' : 'body'; 904 $(bodyType).css('overflow','auto'); 905 $('body').css('margin-right', $('body').attr('_mr_')); 906 }); 907 } 908} 909 910function quickDetailFrame(obj, pno, cno1) { 911 var frameno = $(obj).attr('frameno'); 912 if(!frameno) { 913 frameno = $('.preview_frame').attr('id').replace(/preview_frame_/, ''); 914 } 915 if(!frameno) return false; 916 var frame = $('#preview_frame_'+frameno); 917 if(frame.length > 0) { 918 if(!cno1) cno1 = ''; 919 frame.animate({"opacity":"0"}, 'fast') 920 .attr('src', root_url+'/main/exec.php?exec_file=shop/quickDetail.exe.php&type=frame&cno1='+cno1+'&frameno='+frameno+'&pno='+pno) 921 .animate({"opacity":"1"}, 'fast'); 922 } 923} 924 925 926function previewResize(frameno, htype) { 927 var de = document.documentElement.scrollHeight > document.body.scrollHeight ? document.documentElement : document.body; 928 929 if(typeof is_mobile != 'undefined' && is_mobile == 'Y') { // 모ë°ì¼ììë ê°ë¡ 100% 930 $('#preview_frame_'+frameno, parent.document).width('100%'); 931 } 932 933 if(htype == '1') { 934 $('#preview_frame_'+frameno, parent.document).height(1).height(de.scrollHeight); 935 } 936 $('#preview_frame_'+frameno, parent.document).animate({"opacity":"1"},'fast'); 937} 938 939function bgmPlayer(mode){ 940 var elem = parent.frames[0].document.getElementById('bgmPlayer'); 941 switch (mode) { 942 case 'prev' : 943 elem.previous(); 944 break; 945 case 'next' : 946 elem.next(); 947 break; 948 case 'play' : 949 elem.play(); 950 break; 951 case 'stop' : 952 elem.stop(); 953 break; 954 case 'pause' : 955 elem.pause(); 956 break; 957 } 958} 959 960function printReceipt(cate, cart_selected, ono) { // ì¥ë°êµ¬ë/주문ì/ë§ì´íì´ì§ ììì¦ ì¶ë ¥ 961 var param = ''; 962 if(cate == 2 || cate == 3) { 963 param = '&ono='+$('input[name=ono]').val(); 964 } 965 if(ono) { 966 param = '&ono='+ono; 967 } 968 if(cart_selected) { 969 param += '&cart_selected='+cart_selected; 970 } 971 972 var win = window.open('/main/exec.php?exec_file=mypage/receipt.php&cate='+cate+param, 'receipt', 'status=no, width=100px, height=100px, resize=no'); 973 if(!win) { 974 window.alert(_lang_pack.common_blocked_popup); 975 return; 976 } 977 win.focus(); 978} 979 980function checkcpnFrm(f) { 981 if(!checkBlank(f.sccode, _lang_pack.common_input_scnum)) return false;
982} 983 984// Smart Editor 985var oEditors = []; 986var eType=2; 987var seCalled=false; 988function seCall(contentId, editor_code, neko_gr) { 989 if(seCalled && seCalled.indexOf('@'+contentId) > 0) return; 990 if(typeof neko_gr == "undefined") neko_gr=""; 991 992 var skin = 'SmartEditor2Skin.php'; 993 if (typeof browser_type != 'undefined' && browser_type == 'mobile') { 994 skin = 'SmartEditor2Skin_m.php'; 995 $('#'+contentId).css({'width':'100%', 'min-width':'260px'}); 996 } 997 998 eType=2; 999 nhn.husky.EZCreator.createInIFrame({ 1000 oAppRef: oEditors, 1001 elPlaceHolder: contentId, 1002 sSkinURI: "/main/exec.php?exec_file=smartEditor/"+skin+"&editor_code="+editor_code+"&contentId="+contentId+"&neko_gr="+neko_gr+"&urlfix=Y", 1003 htParams : {bUseToolbar : true, 1004 fOnBeforeUnload : function() { 1005 //if(eType == 1) return 'íì´ì§ë¥¼ ì´ëíë©´ ì ì¥íì§ ìì ë´ìì ì ì¤ë©ëë¤.'; 1006 } 1007 }, 1008 fOnAppLoad : function(){ 1009 1010 }, 1011 fCreator: "createSEditor2" 1012 }); 1013 1014 seCalled+='@'+contentId; 1015} 1016 1017function pasteHTML(contentId, html) { 1018 eType=2; 1019 1020 if(!oEditors.getById[contentId]) return false; 1021 oEditors.getById[contentId].exec("PASTE_HTML", [html]); 1022} 1023 1024function seDelFile(contentId, no) { 1025 eType=2; 1026 if(!confirm(_lang_pack.common_confirm_delete)) return; 1027 1028 $.ajax({ 1029 type: 'get', 1030 url: '/main/exec.php?exec_file=smartEditor/upload/upload.exe.php', 1031 data: 'no='+no+'&wmode=delete', 1032 dataType : 'html', 1033 async : false, 1034 success: function(result) { 1035 if(result == 'OK') { 1036 var doc = oEditors.getById[contentId].getWYSIWYGDocument(); 1037 $('.img_obj_'+no, doc).parent().remove(); 1038 oEditors.getById[contentId].exec("UPDATE_CONTENTS_FIELD", []); 1039 1040 var preview = $(oEditors.getById[contentId].elEditingAreaContainer) 1041 .parents('#smart_editor2') 1042 .find('iframe[name=se2_img_preview_frm]'); 1043 if(preview.length == 1) { 1044 $('#preview'+no, preview[0].contentWindow.document).remove(); 1045 } 1046 } else window.alert(_lang_pack.common_faild_fdelete+result); 1047 } 1048 }); 1049} 1050 1051function showHTML(contentId) { 1052 var sHTML = oEditors.getById[contentId].getIR(); 1053 window.alert(sHTML); 1054} 1055 1056function submitContents(contentId, msg) { 1057 eType=2; 1058 oEditors.getById[contentId].exec("UPDATE_CONTENTS_FIELD", []); 1059 1060 var content_tmp = document.getElementById(contentId).value.replace(/(<br( ?\/)?>)+$/i, ''); 1061 if(content_tmp == "" && typeof msg != 'undefined' && msg != '') { 1062 alert(msg); 1063 return false; 1064 } 1065 1066 return true; 1067} 1068 1069function setDefaultFont() { 1070 var sDefaultFont = 'ê¶ì'; 1071 var nFontSize = 24; 1072 oEditors.getById[contentId].setDefaultFont(sDefaultFont, nFontSize); 1073} 1074 1075function prdMore(obj_id, file_name, module, option) { // ì모ë°ì¼ ë보기 ì¤í¬ë¦½í¸ 1076 /* 1077 option.full_reload : true=ì ì²´íì´ì§ ì´ë, false=more íí 1078 */ 1079 if(typeof obj_id == 'string') { 1080 var obj = $('#'+obj_id); 1081 } else { 1082 obj = obj_id; 1083 obj_id = obj.attr('id'); 1084 if(!obj_id) { 1085 obj_id = 'prd_mode_'+new Date().getTime(); 1086 obj.attr('id', obj_id); 1087 } 1088 } 1089 if(!option) option = {}; 1090 1091 var page = obj.attr('module_page'); 1092 if(!page) page = (option.full_reload == true) ? 1 : 2; 1093 1094 if(page == 'end' && option.nopaging != true) { 1095 window.alert(_lang_pack.common_last_page); 1096 return; 1097 } 1098 1099 var param = {"obj_id":obj_id, "_tmp_file_name":file_name, "single_module":module, "striplayout":1, "module_page":page, "document_url":document.URL.replace(/#.*$/, ''), "ajaxSkin":option.ajaxSkin, 'full_reload':option.full_reload}; 1100 var getURL = window.location.toString().split('?'); 1101 if(getURL[1]) { 1102 var temp = getURL[1].replace(/#.*$/, '').split('&'); 1103 for(var key in temp) { 1104 var temp2 = temp[key].split('='); 1105 param[temp2[0]] = temp2[1] 1106 } 1107 } 1108 var _scroll_top = $(window).scrollTop(); // êµ¬ê¸ í¬ë¡¬ ë³ê²½ì¬í ëì 1109 $.get(root_url+'/main/exec.php?exec_file=skin_module/skin_ajax.php', param, function(result) { 1110 if(option.full_reload == true) { 1111 obj.html(''); 1112 } 1113 1114 if (parseInt(result.end_page) == page && option.btn) { 1115 $(option.btn).hide(); 1116 } 1117 1118 result = result.content; 1119 if(option.nopaging != true) { 1120 if($.trim(result)) { 1121 // ë¤ë¡ê°ê¸° 복구 주ì 1122 var tmpurl = document.URL; 1123 var hashurl = tmpurl.replace(/.*#/, ''); 1124 var regexp = new RegExp('(&)?(b_'+module+'=)[0-9]+', 'g'); 1125 if(regexp.test(hashurl)) { 1126 tmpurl = tmpurl.replace(regexp, '$1$2'+page); 1127 } else { 1128 tmpurl += (document.URL.indexOf('#') < 0) ? '#' : '&'; 1129 tmpurl += 'b_'+module+'='+page; 1130 } 1131 location.href = tmpurl; 1132 1133 obj.append(result); 1134 $(window).scrollTop(_scroll_top); 1135 if(option.full_reload != true) { // more ë²í¼ ì´ì© ì ë¤ìíì´ì§ë¡ 커ì ì´ë 1136 page++; 1137 obj.attr('module_page', page); 1138 } 1139 } else { 1140 if (option.btn) { 1141 $(option.btn).hide(); 1142 } 1143 window.alert(_lang_pack.common_last_page); 1144 obj.attr('module_page', 'end'); 1145 } 1146 } else { 1147 obj.html(result); 1148 } 1149 if(option.complete) { 1150 option.complete(); 1151 } 1152 }); 1153} 1154 1155function reloadProductBoard(type, page, sort) { 1156 // ìíí ìì¸ ë ì´ì´ ë¯¸ë¦¬ê³ ì¹¨ 1157 var view_layer = $('#review_detail_layer'); 1158 if(view_layer.length == 1) { 1159 reloadReviewDetail(true); 1160 } 1161 1162 // ìíí ì ë ¬ê° ì ì¥ 1163 if(sort > 0) { 1164 setCookie('b_'+type+'_sort', sort, 30); 1165 } 1166 var obj = $('#detail_'+type+'_ajax_list'); 1167 if(obj.length > 0 || view_layer.length == 1) { 1168 if(page) { 1169 page = page.replace(new RegExp('^\\?[a-z]+_page=([0-9]+).*', 'gi'), '$1'); 1170 obj.attr('module_page', page); 1171 } 1172 prdMore(obj, 'shop_detail.php', 'detail_'+type+'_list', {'full_reload':true, 'nopaging':true}); 1173 } else { 1174 location.href = page; 1175 } 1176} 1177 1178function getFixedSize(obj, size) { 1179 if(obj.width > size) { 1180 obj.style.width = size+'px'; 1181 } 1182} 1183 1184function setDimmed(color, opacity) { 1185 $('bgfilter').remove(); 1186 1187 if(!color) color = '#000'; 1188 if(!opacity) opacity = 0.5; 1189 1190 var de = document.documentElement.scrollTop >= document.body.scrollTop ? document.documentElement : document.body; 1191 var clientHeight = $(window).height() 1192 var bodyType = navigator.appName.indexOf("Internet Explorer") != -1 ? 'html' : 'body'; 1193 1194 $(bodyType).css('overflow','hidden'); 1195 if(/Mobile/.test(navigator.userAgent) == false) { 1196 $('body').attr('_mr_', $('body').css('margin-right')).css('margin-right','17px'); 1197 } 1198 1199 // background 1200 var bg = $(document.createElement('bgfilter'))
1201 .css({"z-index":99, "position":"absolute", "left":"0", "top":"0", "width":"100%", "height":de.scrollHeight, "background-color":color, "opacity":opacity}) 1202 .addClass('qdBackground') 1203 .attr('id', 'qdBackground'); 1204 1205 $('body').append(bg); 1206 1207 return bg; 1208} 1209 1210function removeDimmed() { 1211 $('bgfilter').fadeOut('fast', function() { 1212 $(this).remove(); 1213 }); 1214 var bodyType = navigator.appName.indexOf("Internet Explorer") != -1 ? 'html' : 'body'; 1215 $(bodyType).css('overflow','auto'); 1216 $('body').css('margin-right', $('body').attr('_mr_')); 1217} 1218 1219function popupOpen () { 1220 if(getCookie("_custom_popup") == "Y") { 1221 document.getElementById('_custom_popup').style.display = 'none'; 1222 } 1223} 1224 1225function popupClose (type) { 1226 switch(type){ 1227 case "S" : 1228 document.getElementById("_custom_popup").remove(); 1229 break; 1230 case "L" : 1231 document.getElementById("_custom_popup").remove(); 1232 setCookie("_custom_popup", "Y", 3); 1233 break; 1234 default : 1235 return false; 1236 } 1237} 1238 1239function wishPartCartAjax(pno, o) { 1240 $.post(root_url+'/main/exec.php', {"exec_file":"mypage/wish.exe.php", "exec":"add", "pno":pno, "from_ajax":true}, function(result) { 1241 if(result.status == 'faild') { 1242 window.alert(result.msg); 1243 return; 1244 } 1245 if(result.status == 'on') { 1246 $(o).addClass('wish_on').removeClass('wish_off'); 1247 } else { 1248 $(o).addClass('wish_off').removeClass('wish_on'); 1249 } 1250 // if(result.msg && confirm(result.msg+'\n'+_lang_pack.common_confirm_wishlist)) { 1251 // location.href = root_url+'/mypage/wish_list.php'; 1252 // } 1253 }); 1254} 1255 1256function cartPartCartAjax(pno, product_name, sell_prc) { 1257 $.post(root_url+'/main/exec.php', {"exec_file":"cart/cart.exe.php", "exec":"add", "pno":pno, "buy_ea":1, "from_ajax":true}, function(result) { 1258 if(/^[0-9]+$/.test(result) == true) { 1259 quickDetailPopup(null, result); 1260 } else if(result == 'OK') { 1261 if($('.quick_cart_parent').length > 0) { // íµì¹´í¸ ì¬ì©ì 1262 openQuickCart(9, 'auto'); 1263 } else { // 미ì¬ì©ì 1264 if(confirm(_lang_pack.shop_confirm_cartok)) { 1265 location.href = root_url+'/shop/cart.php'; 1266 } 1267 } 1268 addCartExternalActions({ 1269 'hash': pno, 1270 'product_name': product_name, 1271 'total_prc': sell_prc, 1272 'buy_ea': 1 1273 }, 'add'); 1274 } else { 1275 window.alert(result.replace(/\\(\"|\')/g, "$1")); 1276 return; 1277 } 1278 }); 1279} 1280 1281function ts_replace(str, pre, suf) { 1282 var tmp = ''; 1283 for(var i = 0; i < str.length; i++) { 1284 tmp += pre+str.substr(i, 1)+suf; 1285 } 1286 return tmp; 1287} 1288 1289function removeMemberDeleted(mno, hash) { 1290 if(confirm(_lang_pack.common_restore_sleep)) { 1291 $('iframe[name='+hid_frame+']').attr('src', '/main/exec.php?exec_file=member/login.exe.php&exec=removeDeleted&mno='+mno+'&hash='+hash); 1292 } 1293} 1294 1295function showExchangeFee(price){ 1296 var return_val = "0"; 1297
1298 if($.trim(r_currency_type) && price.toNumber() > 0){ 1299 var fee =price.toNumber() * exchangeRate.toNumber(); 1300 return_val = setComma(fee.toFixed(r_currency_decimal)); 1301 } 1302 return return_val; 1303} 1304 1305function snsLogin(sns_type, sns_cid, rurl) { 1306 1307 $.post("/main/exec.php?exec_file=member/login.exe.php", { "sns_type":sns_type,"sns_cid": sns_cid}, 1308 function (rjson) { 1309 if(rjson["result"]==true){ 1310 if(rjson.app_process){ 1311 if(rjson.app_process_device == 'IOS'){ 1312 eval(rjson.app_process); 1313 }else{ 1314 eval(rjson.app_process); 1315 window.location.href=rjson.app_rurl; 1316 } 1317 }else{ 1318 try { 1319 if($(opener).length>0) opener.parent.location.href=rurl; 1320 if($(opener).length==0) window.location.href=rurl; 1321 if($(opener).length>0) self.close(); 1322 } catch(e) { 1323 window.location.href=rurl; 1324 } 1325 } 1326 } else { 1327 alert(rjson["message"]); 1328 window.location.href=rurl; 1329 } 1330 },'json'); 1331} 1332 1333if(typeof $ == 'function') { 1334 $.prototype.attrprop = function(attr, val) { 1335 if(typeof $.prop == 'function') { 1336 this.prop(attr, val); 1337 } else { 1338 this.attr(attr, val); 1339 } 1340 } 1341} 1342 1343$(document).ready(function(){ 1344 $('.remove_dash').bind({ 1345 'blur' : function() { 1346 this.value = this.value.replace(/[^0-9]/g,''); 1347 }, 1348 'keyup' : function() { 1349 this.value = this.value.replace(/[^0-9]/g,''); 1350 } 1351 }).each(function() { 1352 this.value = this.value.replace(/[^0-9]/g,''); 1353 }); 1354}); 1355 1356// ì¥ë°êµ¬ë ê´ë ¨ ì¤í¬ë¦½í¸ (shop.js ìì ì´ì ) 1357function addWish(f, mode) { 1358 if(!mode) mode = 'add'; 1359 f.exec.value = mode; 1360 f.target=hid_frame; 1361 f.action=root_url+'/main/exec.php?exec_file=mypage/wish.exe.php'; 1362 f.submit(); 1363} 1364 1365function checkWish(f) { 1366 if(eval(f.total_wish.value)<1) { 1367 window.alert(_lang_pack.shop_error_nowishlist); 1368 return false; 1369 } 1370 return true; 1371} 1372 1373function cartToWish(f) { 1374 if(!checkCB(f.cno, _lang_pack.shop_select_selwishlist)) return; 1375 f.exec_file.value = "mypage/wish.exe.php"; 1376 f.exec.value='add'; 1377 f.submit(); 1378} 1379 1380function deleteWish(f) { 1381 if(!checkWish(f)) return; 1382 if(!checkCB(f.wno, _lang_pack.shop_select_rmwishlist)) return; 1383 f.exec_file = 'mypage/wish.exe.php' 1384 f.exec.value='delete'; 1385 f.submit(); 1386} 1387 1388function deletePartWishAjax(wno) { 1389 if(!confirm(_lang_pack.shop_confirm_rmwishlist)) return false; 1390 1391 $.post(root_url+'/main/exec.php', {"exec_file":"mypage/wish.exe.php", "exec":"delete", "wno[]":wno}, function(result) { 1392 document.location.reload(); 1393 }); 1394} 1395 1396function cartWish(f) { 1397 if(!checkWish(f)) return; 1398 if(!checkCB(f.wno, _lang_pack.shop_select_selcart)) return; 1399 f.exec_file.value = "cart/cart.exe.php"; 1400 f.exec.value='from_wish'; 1401 f.submit(); 1402} 1403 1404function cartPartWishAjax(wno) { 1405 var json = {"exec_file":"cart/cart.exe.php", "exec":"from_wish", "wno[]":wno, "from_ajax":true}; 1406 $('[name$="['+wno+']"]', document.wishFrm).each(function() { 1407 json[this.name] = $(this).val(); 1408 }); 1409 1410 $.post(root_url+'/main/exec.php', json, function(result) { 1411 if(result == 'OK') { 1412 if(confirm(_lang_pack.shop_confirm_cartok)) { 1413 location.href = root_url+'/shop/cart.php'; 1414 } 1415 } else { 1416 window.alert(result); 1417 } 1418 }); 1419} 1420 1421function truncateWish(f) { 1422 if(confirm(_lang_pack.common_confirm_delete)) { 1423 f.exec.value = 'truncate'; 1424 f.submit(); 1425 } 1426} 1427 1428function checkCart(f) { 1429 if(f.cart_rows.value=="0") { 1430 window.alert(_lang_pack.shop_error_nocart); 1431 return false; 1432 } 1433 return true; 1434} 1435 1436function deleteCart(f) { 1437 if(!checkCart(f)) return; 1438 if(!checkCB(f.cno, _lang_pack.shop_select_rmcart)) return; 1439 f.exec.value='delete'; 1440 f.target = hid_frame; 1441 1442 if(typeof ace_counter_cart != 'undefined') { 1443 if(ace_counter_cart == '1') { 1444 cnum=f['cno[]'].length ? f['cno[]'].length : 1; 1445 for(ii=0; ii<cnum; ii++) { 1446 if(cnum > 1) { 1447 if(f['cno[]'][ii].checked) { 1448 if(document.getElementsByName("buy_ea["+ii+"]").length > 0) AEC_F_D(_AEC_prodidlist[ii], 'o', f['buy_ea['+ii+']'].value); 1449 else AEC_F_D(_AEC_prodidlist[ii], 'o', f['buy_ea[]'][ii].value); 1450 } 1451 }else{ 1452 if(f['cno[]'].checked) { 1453 if(document.getElementsByName("buy_ea["+ii+"]").length > 0) AEC_F_D(_AEC_prodidlist[ii], 'o', f['buy_ea['+ii+']'].value); 1454 else AEC_F_D(_AEC_prodidlist[ii], 'o', f['buy_ea[]'].value); 1455 } 1456 } 1457 } 1458 } 1459 } 1460 f.submit(); 1461} 1462 1463function deletePartCart(f,cn) { 1464 if(!checkCart(f)) return; 1465 if(f['cno[]'].length > 1) { 1466 f.cno[cn].checked=true; 1467 } else { 1468 f.cno.checked=true; 1469 } 1470 f.exec.value='delete'; 1471 f.submit(); 1472} 1473 1474function deletePartCartAjax(cno, is_quickcart) { 1475 if(!confirm(_lang_pack.shop_confirm_rmcart)) return false;
1476 1477 var sbscr = (document.cartSbscrFrm) ? 'Y' : 'N'; 1478 $.post(root_url+'/main/exec.php', {"exec_file":"cart/cart.exe.php", "exec":"delete", "cno[]":cno, "sbscr":sbscr, "from_ajax":"true"}, function(result) { 1479 try { 1480 for (key in result) { 1481 addCartExternalActions({ 1482 'hash': result[key].hash, 1483 'product_name': result[key].name, 1484 'total_prc': result[key].sell_prc, 1485 'buy_ea': result[key].buy_ea 1486 }, 'remove'); 1487 } 1488 } catch (ex) {} 1489 1490 if(is_quickcart) { 1491 openQuickCart(1, 'reload'); 1492 } else { 1493 document.location.reload(); 1494 } 1495 }); 1496} 1497 1498// ì¥ë°êµ¬ë ì¸ì ì ì¸ë¶ ì¤í¬ë¦½í¸ ìë 1499function addCartExternalActions(data, action) { 1500 // êµ¬ê¸ í¥ìë ì ììê±°ë 1501 if (typeof use_google_enhenced_ecommerce == 'boolean' && typeof google_alanytics_id == 'string') { 1502 if (use_google_enhenced_ecommerce == true) { 1503 ga('create', google_alanytics_id); 1504 ga('require', 'ec'); 1505 ga('ec:addProduct', { 1506 'id': data.hash, 1507 'name': data.product_name, 1508 'price': data.total_prc, 1509 'quantity': data.buy_ea 1510 }); 1511 ga('ec:setAction', action); 1512 ga('send', 'event', 'UX', 'click', 'add to cart'); 1513 } 1514 } 1515 1516 // êµ¬ê¸ ì ì¦ìë 1517 if (typeof use_google_ads == 'boolean' && typeof google_ads_cart_id == 'string') { 1518 if (use_google_ads == true) { 1519 gtag('event', 'conversion', { 1520 'send_to': google_ads_cart_id, 1521 'value': data.total_prc, 1522 'currency': (currency == 'ì') ? 'KRW' : currency, 1523 'transaction_id': data.hash 1524 }); 1525 } 1526 } 1527} 1528 1529function truncateCart(f) { 1530 if(!checkCart(f)) return; 1531 if(!confirm(_lang_pack.shop_confirm_truncatecart)) return; 1532 f.exec.value='truncate'; 1533 f.target = hid_frame; 1534 1535 if(typeof ace_counter_cart != 'undefined') { 1536 if(ace_counter_cart == '1') { 1537 AEC_D_A(); 1538 } 1539 } 1540 1541 if(typeof AEC_CALL_DEL_ALL != 'undefined') { 1542 AEC_CALL_DEL_ALL( ); 1543 } 1544 1545 if(typeof ACC_CARTDEL != 'undefined') { 1546 ACC_CARTDEL(); 1547 } 1548 1549 f.submit(); 1550} 1551 1552function updateCart(f) { 1553 if(!checkCart(f)) return; 1554 checkAll(f.cno,true); 1555 f.exec.value='update'; 1556 f.target = hid_frame; 1557 1558 if(typeof AEC_CALL_STR_FUNC != 'undefined') { // acecounter new 1559 var buy_ea = $('input[name^="buy_ea\["]'); 1560 for(i = 0; i < _ace_countvar; i++) { 1561 var change = parseInt(buy_ea[i].value)-parseInt(_A_nl[i]); 1562 if(change != 0) { 1563 var _cnt = Math.abs(change); 1564 var _type = change > 0 ? 'i' : 'o'; 1565 AEC_CALL_STR_FUNC(_A_pl[i], _type, _cnt); 1566 } 1567 } 1568 } 1569 1570 if(typeof ACC_INOUT != 'undefined') { // acecounter mobile 1571 var buy_ea = $('input[name^="buy_ea\["]'); 1572 for(i = 0; i < cart_pno.length; i++) { 1573 ACC_INOUT(cart_pno[i], buy_ea[i].value); 1574 } 1575 } 1576 1577 if(typeof ace_counter_cart != 'undefined') { // acecounter old 1578 if(ace_counter_cart == '1') { 1579 cnum=f['cno[]'].length ? f['cno[]'].length : 1; 1580 for(ii=0; ii<cnum; ii++) { 1581 if(cnum > 1) { 1582 if(document.getElementsByName("buy_ea["+ii+"]").length > 0) AEC_U_V(_AEC_prodidlist[ii], f['buy_ea['+ii+']'].value); 1583 else AEC_U_V(_AEC_prodidlist[ii], f['buy_ea[]'][ii].value); 1584 }else{ 1585 if(document.getElementsByName("buy_ea["+ii+"]").length > 0) AEC_U_V(_AEC_prodidlist[ii], f['buy_ea['+ii+']'].value); 1586 else AEC_U_V(_AEC_prodidlist[ii], f['buy_ea[]'].value); 1587 } 1588 } 1589 } 1590 } 1591 f.submit(); 1592} 1593 1594function orderCart(f, checked, type) { 1595 var u2 = ''; 1596 1597 if(!checkCart(f)) return; 1598 u=root_url+'/shop/order.php'; 1599 if(type=='Y') { 1600 u2 = 'sbscr=Y'; 1601 } 1602 if(typeof f.cart_where!='undefined' && f.cart_where.value) { 1603 u+='?cart_where='+f.cart_where.value+'&'+u2; 1604 }else { 1605 if(u2) u+='?'+u2; 1606 } 1607 1608 if(checked == 'checked') if(!checkCB(f.cno, _lang_pack.shop_error_noprd)) return; 1609 1610 if(checked == 'checked') { 1611 f.action = u; 1612 f.target = '_self'; 1613 f.submit(); 1614 } else { 1615 location.href=u; 1616 } 1617} 1618 1619function cartEaChg(obj, type, cno, is_update) { 1620 if(typeof obj != 'object') return; 1621 var f = $(obj).parents('form'); 1622 if(f.length != 1) return; 1623 1624 var ea = $('#buy_ea'+cno, f); 1625 if(type == 1) { 1626 ea.val(parseInt(ea.val())+1); 1627 } else { 1628 if(parseInt(ea.val()) <= 1) return; 1629 else { 1630 ea.val(parseInt(ea.val())-1); 1631 } 1632 } 1633 1634 if(is_update == true) { 1635 updateCart(f[0]); 1636 } 1637} 1638 1639// íµì¹´í¸ 1640function openQuickCart(quickno, action) { 1641 var cart = null; 1642 1643 switch(action) { 1644 case 'leave' : 1645 closeQuickCart(quickno, action); 1646 return; 1647 break; 1648 case 'click' : 1649 if(quickno < 9) { 1650 if($('.wing_quick_cart_layer'+quickno).html() != '') { 1651 closeQuickCart(quickno, action); 1652 return; 1653 } 1654 } 1655 break; 1656 case 'stopFadeout' : 1657 $('.wing_quick_cart_layer'+quickno).attr('fadeout', ''); 1658 return; 1659 break; 1660 case 'enter' : 1661 $('.wing_quick_cart_layer'+quickno).attr('fadeout', ''); 1662 break; 1663 } 1664 1665 for(var key = 1; key <= 2; key++) { 1666 if($('.wing_quick_cart_layer'+key).length > 0) { 1667 $.get(root_url+'/shop/cart.php?quickcart='+key, {'from_ajax':'true'}, function(r) { 1668 var json = $.parseJSON($.trim(r)); 1669 var cart = $('.wing_quick_cart_layer'+json.quickcart); 1670
1671 cart.html(json.content).fadeIn('fast'); 1672 $('.quick_cart_cnt').text(json.cnt); 1673 1674 // chrome bug fix 1675 if(action == 'enter') { 1676 $('.quick_cart_parent'+quickno).unbind('mouseenter'); 1677 } 1678 1679 if(action == 'auto') { 1680 var interval = parseInt(cart.attr('interval')); 1681 if(isNaN(interval) == false && interval > 0) { 1682 cart.attr('fadeout', 'true'); 1683 setTimeout(function() { 1684 closeQuickCart(json.quickcart, 'fadeout'); 1685 }, (interval*1000)); 1686 } 1687 } 1688 }); 1689 } 1690 } 1691} 1692 1693function closeQuickCart(quickno, action) { 1694 var cart = $('.wing_quick_cart_layer'+quickno); 1695 if(action == 'fadeout') { 1696 var is_fadeout = cart.attr('fadeout'); 1697 if(is_fadeout == 'true') { 1698 cart.attr('fadeout', ''); 1699 } else { 1700 return; 1701 } 1702 } 1703 1704 cart.fadeOut('fast', function() { 1705 $(this).html(''); 1706 1707 // chrome bug fix 1708 if(action == 'leave') { 1709 $('.quick_cart_parent'+quickno).mouseenter(function(){ 1710 openQuickCart(quickno, 'enter') 1711 }); 1712 } 1713 }); 1714} 1715 1716function commonAjaxUpload(input, url, param, complete) { 1717 if(!input.files) { 1718 window.alert('ë¤ì¤ ì ë¡ë를 ì§ìíì§ ìë ë¸ë¼ì°ì ì ëë¤.\nIE10 ì´ìì Internet Explorer ëë í¬ë¡¬ ë¸ë¼ì°ì 를 ì´ì©í´ 주ì¸ì.'); 1719 return false; 1720 } 1721 if(input.files.length < 1) return; 1722 1723 var ret = []; 1724 for(var i = 0; i < input.files.length; i++) { 1725 var fd = new FormData(); 1726 for(var key in param) { 1727 fd.append(key, param[key]); 1728 } 1729 fd.append("upfile"+i, input.files[i]); 1730 fd.append('from_ajax', 'true'); 1731 1732 $.ajax({ 1733 'url': url, 1734 'type':'post', 1735 'contentType': false, 1736 'processData': false, 1737 'async': false, 1738 'data': fd, 1739 'success': function(r) { 1740 ret[i] = r; 1741 }, 1742 }); 1743 } 1744 input.value = ''; 1745 if(typeof complete == 'function') { 1746 for(var key in ret) { 1747 complete(ret[key]); 1748 } 1749 } 1750} 1751 1752// ë보기 ë²í¼ ì¬ì©ì ë¤ë¡ê°ê¸° 복구 1753$(window).ready(function() { 1754 var url = location.href.split('#'); 1755 if(url[1]) { 1756 var hashurl = url[1].split('&'); 1757 for(var key in hashurl) { 1758 if(/^b_[^=]+=[0-9]+$/.test(hashurl[key])) { 1759 var tmp = hashurl[key].split('='); 1760 console.log(tmp); 1761 $.ajax({ 1762 type: 'get', 1763 url: root_url+'/main/exec.php?exec_file=skin_module/skin_ajax.php', 1764 data: {'single_module':tmp[0], 'more_page':tmp[1]}, 1765 dataType : 'json', 1766 async : false, 1767 success: function(r) { 1768 $('#'+r.obj_id).html(r.content).attr('module_page', r.next_page); 1769 } 1770 }); 1771 } 1772 } 1773 } 1774}); 1775 1776// ê³µíµ confirm ë¤ì´ì¼ë¡ê·¸ 1777function dialogConfirm(title, content, buttons) { 1778 if(!title) title = root_url; 1779 content = content.replace("\n", "<br>") 1780 1781 var dialog = $("<div id='_dialogConfirm' class='_dialog_Confirm'></div>"); 1782 $('body').append(dialog); 1783 1784 $(dialog).dialog({ 1785 title: title, 1786 resizable: false, 1787 height: "auto", 1788 width: 300, 1789 minHeight: 200, 1790 modal: true, 1791 closeOnEscape: false, 1792 buttons: buttons, 1793 open: function(event, ui) { 1794 $(".ui-dialog-titlebar-close", $(this).parent()).hide(); 1795 }, 1796 }).html(content); 1797} 1798 1799function dialogConfirmClose() { 1800 $('._dialog_Confirm').dialog("close"); 1801 $('._dialog_Confirm').remove(); 1802} 1803 1804//ìê°ì¹´ì´í¸ 1805function timeInit() { 1806 timeCnt = 5*60; 1807 tid = setInterval("timeCounter()",1000); 1808} 1809function timeCounter() { 1810 $('#minsec').val(timePadZero(parseInt(timeCnt/60))+timePadZero(parseInt(timeCnt%60))); 1811 timeCnt--; 1812 if (timeCnt<0) { 1813 clearInterval(tid); 1814 } 1815} 1816function timePadZero(n) { 1817 return n>9?n:"0"+n; 1818} 1819 1820function ordSearchdate(sdate, fdate, type) { 1821 $('#start_date').val(sdate); 1822 $('#finish_date').val(fdate); 1823 if(type==true) { 1824 document.location.href='/mypage/order_list.php?start_date='+sdate+'&finish_date='+fdate; 1825 } 1826} 1827 1828function ordDatesubmit() { 1829 var start_date = $('#start_date').val(); 1830 var finish_date = $('#finish_date').val(); 1831 var clink = ''; 1832 if(sessKey) clink = "&c="+sessKey; 1833 document.location.href='/mypage/order_list.php?start_date='+start_date+'&finish_date='+finish_date+clink; 1834} 1835 1836function downLoadCoupon(n) { 1837 if(confirm(_lang_pack.shop_confirm_downCpn)) { 1838 $.get('/main/exec.php', {'from_ajax':'true', 'exec_file':'mypage/coupon_download.php', 'no':n}, function(r) { 1839 var json = $.parseJSON(r); 1840 if(json.result == 'error') { 1841 if(json.resultmsg == 'login') { 1842 if(typeof is_quickDetail == 'boolean' && is_quickDetail) { 1843 parent.location.href = '/member/login.php?rURL='+escape(parent.this_url) 1844 } else { 1845 parent.location.href = '/member/login.php?rURL='+escape(this_url) 1846 } 1847 } else { 1848 window.alert(json.resultmsg); 1849 } 1850 } else if(json.result == 'OK') { 1851 window.alert(json.resultmsg); 1852 location.reload(); 1853 } 1854 }); 1855 } 1856} 1857 1858function downLoadCouponAll(n) { 1859 if(confirm(_lang_pack.shop_confirm_downCpn)) { 1860 $.get('/main/exec.php', {'from_ajax':'true', 'exec_file':'mypage/coupon_download.php', 'coupon_type':'ALL', 'no':n}, function(r) { 1861 var json = $.parseJSON(r); 1862 if(json.result == 'error') { 1863 if(json.resultmsg == 'login') { 1864 if(typeof is_quickDetail == 'boolean' && is_quickDetail) { 1865 parent.location.href = '/member/login.php?rURL='+escape(parent.this_url) 1866 } else { 1867 parent.location.href = '/member/login.php?rURL='+escape(this_url) 1868 } 1869 } else { 1870 window.alert(json.resultmsg); 1871 } 1872 } else if(json.result == 'OK') { 1873 window.alert(json.resultmsg); 1874 location.reload(); 1875 } 1876 }); 1877 } 1878} 1879 1880// íìì²´í¬ë°ì¤ì ì ì²´ì²´í¬ë°ì¤ ì°ë 1881var chainCheckbox = function(all_chkbox, sub_checkbox) { 1882 this.all_check = all_chkbox; 1883 this.sub_checkbox = sub_checkbox; 1884 1885 var _this = this; 1886 this.all_check.click(function() { 1887 _this.sub_checkbox.prop('checked', this.checked); 1888 }); 1889 1890 if(_this.sub_checkbox.filter(':checked').length == _this.sub_checkbox.length) { 1891 _this.all_check.prop('checked', true); 1892 } 1893 1894 this.sub_checkbox.click(function() { 1895 if(_this.sub_checkbox.filter(':checked').length == _this.sub_checkbox.length) { 1896 _this.all_check.prop('checked', true); 1897 } else { 1898 _this.all_check.prop('checked', false); 1899 } 1900 }); 1901} 1902 1903// íìì¸ì¼ 1904function printTimeSale(o) { 1905 var now = Math.floor(new Date().getTime()/1000); 1906 var datee = parseInt($(o).data('timestamp')); 1907 var lefttime = datee-now; 1908 var unit = [86400, 3600, 60, 1]; 1909 var res = ''; 1910 if(lefttime > 0) { 1911 for(var key in unit) { 1912 key = parseInt(key); 1913 if(eval('use_ts_mark_'+(key+1)) == 'Y') { 1914 tmp = Math.floor(lefttime/unit[key]); 1915 if(tmp < 1 && res == '') continue; 1916 lefttime -= unit[key]*tmp; 1917 1918 if(res) res += ' '; 1919 if(key > 0 && tmp < 10) tmp = '0'+tmp; 1920 res += '<span class="_timer_num _timer_num_'+key+'">'+tmp+'</span><span class="_timer_split _timer_split_'+key+'">'+eval('ts_mark_'+(key+1))+'</span>'; 1921 } 1922 } 1923 } 1924 $(o).html(res); 1925} 1926$(function() { 1927 if($('._timesale_timer').length > 0) { 1928 setInterval(function() { 1929 $('._timesale_timer').each(function() { 1930 printTimeSale(this); 1931 }); 1932 }, 1000); 1933 } 1934}); 1935 1936// íë¡ í¸ ë¡ë© 1937function printFLoading() { 1938 $('body').append('<div id="__smt_loading_layer"><div class="loading"></div></div>'); 1939} 1940 1941function removeFLoading() { 1942 $('#__smt_loading_layer').remove(); 1943} 1944 1945function deliveryConfirm(dlv_no, dlv_code){ 1946 // 1. ì ì°½ ì´ê¸° 1947 const newWin = window.open("", 'dlv', 'status=no, width=800px'); 1948 1949 // 2. form ëì ìì± 1950 const form = document.createElement("form"); 1951 form.method = "POST"; 1952 form.action = "https://info.sweettracker.co.kr/tracking/5"; 1953 form.target = "dlv"; // ì ì°½ì ì´ë¦ 1954 1955 let data = []; 1956 data['t_key'] = "HawGx51Ox4MH035Lk0SmqQ"; 1957 data['t_code'] = dlv_no; 1958 data['t_invoice'] = dlv_code; 1959 1960 // 3. ë°ì´í° ì½ì 1961 for (const key in data) { 1962 if (data.hasOwnProperty(key)) { 1963 const input = document.createElement("input"); 1964 input.type = "hidden"; 1965 input.name = key; 1966 input.value = data[key]; 1967 form.appendChild(input); 1968 } 1969 } 1970 1971 document.body.appendChild(form); 1972 1973 // 4. submit ì¤í 1974 form.submit(); 1975 1976 // 5. form ì ê±° (ì í ì¬í) 1977 document.body.removeChild(form); 1978}
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.