1var isOpera = navigator.userAgent.toLowerCase().indexOf("opera")!=-1; 2var isIE = navigator.userAgent.toLowerCase().indexOf("msie")!=-1; 3var isGecko = navigator.userAgent.toLowerCase().indexOf("gecko")!=-1; 4var isSafari = navigator.userAgent.toLowerCase().indexOf("webkit")!=-1; 5 6 function restore_image(name) { 7 var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? 'document.'+name : 'document.all.'+name); 8 if (name == '') return; 9 if (img && img.altsrc) { 10 img.src = img.altsrc; 11 img.altsrc = null; 12 } 13 } 14 15 function change_image(name,rpath, preload) { 16 var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? 'document.'+name : 'document.all.'+name); 17 if (name == '') return; 18 if (img) { 19 img.altsrc = img.src; 20 img.src = rpath; 21 } 22 } 23 24 function restore_img(name) { 25 //var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? 'document.'+name : 'document.all.'+name); 26 if (name == '') return; 27 28 var img = getEl(name); 29 if (img && img.altsrc) { 30 img.src = img.altsrc; 31 img.altsrc = null; 32 } 33 } 34 35 function change_img(name,rpath, preload) { 36 //var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? 'document.'+name : 'document.all.'+name); 37 if (name == '') return; 38 39 var img = getEl(name); 40 if (img) { 41 img.altsrc = img.src; 42 img.src = rpath; 43 } 44 } 45 46 function DisplayShow_inline(lname) 47 { 48 try { 49 document.getElementById(lname).style.display = "inline-block"; 50 } catch(ex){} 51 //eval(layerRef+'["'+lname+'"]'+styleRef+'display="block"') ; 52 } 53 54 55 function DisplayShow(lname) 56 { 57 try { 58 document.getElementById(lname).style.display = "block"; 59 } catch(ex){} 60 //eval(layerRef+'["'+lname+'"]'+styleRef+'display="block"') ; 61 } 62 63 //div ì¨ê¸°ê¸° 64 function DisplayHide(lname) 65 { 66 try { 67 document.getElementById(lname).style.display = "none"; 68 } catch(ex){} 69 //eval(layerRef+'["'+lname+'"]'+styleRef+'display="none"') ; 70 } 71 72 //String íì¥ 73 //script íê·¸ ìì cookieê° ì¬ì©ëê²½ì° ì¤í¬ë¦½í¸ë¥¼ ì ê±° íì¬ ë°í 74 var PATTERN_COOKIESCRIPTS = '(?:<script[^>].*?>)((\n|\r|.)([^<])*?)(cookie+)((\n|\r|.)*?)(?:<\/script>)'; 75 76 String.prototype.stripCookieScripts = function() { 77 return this.replace(new RegExp(PATTERN_COOKIESCRIPTS, 'img'), ''); 78 } 79 80 81//ëª¨ë¬ ë¤ì´ì¼ë¡ê·¸ 82function ShowDialogModal( pageUrl, dialogWidth, dialogHeight ) 83{ 84 //if (navigator.appName.charAt(0) == "N") // ë·ì¤ì¼ì´í 85 //{ 86 var iTop = (screen.height - dialogHeight) / 2 ; 87 var iLeft = (screen.width - dialogWidth) / 2 ; 88 89/* 90 var sOption = "location=no,menubar=no,resizable=no,toolbar=no,dependent=yes" + 91 ",width=" + dialogWidth + 92 ",height=" + dialogHeight + 93 ",top=" + iTop + 94 ",left=" + iLeft ; 95*/ 96 97 var sOption="width=431,height=256"; 98 window.open( pageUrl, 'Aladdin', sOption, true ) ; 99 100 /* 101 var oWindow = window.open( pageUrl, 'Aladdin', sOption, true ) ; 102 var oWindow = window.open( '', 'Aladdin', sOption, true ) ; 103 oWindow.moveTo( iLeft, iTop ) ; 104 oWindow.resizeTo( dialogWidth, dialogHeight ) ; 105 oWindow.focus() ; 106 oWindow.location.href = pageUrl ; 107 108 this.Window = oWindow ; 109 110 window.top.captureEvents( Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS ) ; 111 window.top.parent.addEventListener( 'mousedown', this.CheckFocus, true ) ; 112 window.top.parent.addEventListener( 'mouseup', this.CheckFocus, true ) ; 113 window.top.parent.addEventListener( 'click', this.CheckFocus, true ) ; 114 window.top.parent.addEventListener( 'focus', this.CheckFocus, true ) ; 115 116 } 117 else 118 { 119 var oDialogInfo = new Object() ; 120 oDialogInfo.Title = "Aladdin"; 121 oDialogInfo.Page = pageUrl; 122 oDialogInfo.Editor = window; 123 124 var sUrl = '/js/modaldialog.htm' ; 125 126 window.showModalDialog( sUrl, oDialogInfo, "dialogWidth:" + dialogWidth + "px;dialogHeight:" + dialogHeight + "px;help:no;scroll:no;status:no") ; 127 } 128 */ 129} 130 131function LoginPopup(bAlert) 132{ 133 if(bAlert == true){ 134 alert('ë¡ê·¸ì¸ í ë¤ì ìëí´ ì£¼ì¸ì.'); 135 } 136 137 /* ë³´ìíì´ì§ìì ì ìì SecureOpener=1 íë¼ë©í° ì¶ê° 18.10.04 update by kim0chung */ 138 if (window.location.protocol == 'https:') { 139 ShowDialogModal("https://www.aladin.co.kr/login/wlogin_popup.aspx?SecureOpener=1", 430, 300); 140 } else { 141 ShowDialogModal("https://www.aladin.co.kr/login/wlogin_popup.aspx", 430, 300); 142 } 143 144 /* 몰íì ë³ ë³´ìê²½ê³ ë¡ ë¡ê·¸ì¸ URL ë³ê²½ 17.11.13 update by kim0chung */ 145 //ShowDialogModal("/login/wlogin_popup.aspx", 430, 300); 146} 147 148 149function LoginPopupMsg(msg) 150{ 151 alert(msg); 152 153 if (window.location.protocol == 'https:') { 154 ShowDialogModal("https://www.aladin.co.kr/login/wlogin_popup.aspx?SecureOpener=1", 430, 300); 155 } else { 156 ShowDialogModal("https://www.aladin.co.kr/login/wlogin_popup.aspx", 430, 300); 157 } 158} 159 160 161function LoginPopup_Url(returnUrl) 162{ 163 if (window.location.protocol == 'https:') { 164 ShowDialogModal("https://www.aladin.co.kr/login/wlogin_popup.aspx?SecureOpener=1&returnUrl=" + returnUrl, 430, 300); 165 } else { 166 ShowDialogModal("https://www.aladin.co.kr/login/wlogin_popup.aspx?returnUrl=" + returnUrl, 430, 300); 167 } 168} 169 170 171function popup_open(url,nwidth,nheight,bscroll) 172{ 173 174 if(bscroll == true) 175 window.open( url,'apopup','scrollbars=yes,width=' + nwidth + ',height=' + nheight); 176 else 177 window.open(url,'apopup','scrollbars=no,width=' + nwidth + ',height=' + nheight); 178} 179 180function fn_PopUpPriview(url) { 181 var width = screen.width * 0.95; 182 var height = screen.height * 0.95; 183 184 185 // var url = "/shop/book/wletslookViewer.aspx?ISBN="+ISBN;
186 var options = "top=0, left=0, width=" + width + ", height=" + height + ", status=no, menubar=no, toolbar=no, resizable=no"; 187 window.open(url, name, options); 188} 189function fn_PopUpPriview(url, gubun) { 190 var width = screen.width * 0.95; 191 var height = screen.height * 0.95; 192 if (gubun == 1) { 193 width = screen.width * 0.7; 194 height = screen.height * 0.95; 195 } 196 197 // var url = "/shop/book/wletslookViewer.aspx?ISBN="+ISBN; 198 var options = "top=0, left=0, width=" + width + ", height=" + height + ", status=no, menubar=no, toolbar=no, resizable=no"; 199 window.open(url, name, options); 200} 201function popup_letslook(isbn) { 202 window.open('/shop/book/wletslookViewer.aspx?ISBN='+isbn,'popup','scrollbars=yes,width=1240,height=850'); 203} 204 205//19ì¸ì´ì- ì ìì± ë¯¸ë¦¬ì½ê¸° 206//ë² ì¤í¸ì ë¬> ì ìì± , ìííì´ì§ >커ë²íë¨(êµë´/ì ìì± ) , 207function popup_ebookpreview_Adult(type, url) 208{ 209 210 if (type == "login") 211 { 212 if (confirm("19ì¸ ì´ìë§ ì´ì©í ì ìë ìíì ëë¤. ë¡ê·¸ì¸ í´ì£¼ì¸ì.")) 213 { 214 document.location.href = url; 215 } 216 } 217 else if (type == "goAdlutUrl") { 218 document.location.href = url; 219 } 220 else if (type == "goAdlutUrl_SNS") { 221 alert("19ì¸ ì´ìë§ ì´ì©í ì ìë ìíì¼ë¡, íì íìì ë³´ ì ë ¥ ë° ë³¸ì¸ì¸ì¦ì ìë£í í ì´ì©í ì ììµëë¤."); 222 document.location.href = url; 223 } 224 else if (type == "IsNotAdult") { 225 alert("19ì¸ ì´ìë§ ì´ì©í ì ìë ìíì¼ë¡ ê³ ê°ëê»ìë ì´ì©í ì ììµëë¤."); 226 return; 227 } 228 else if (type == "IsAdult") { 229 popup_ebookpreview(url); //ì ê·¼íì© 230 } 231} 232 233 234//ì ìì± ë¯¸ë¦¬ì½ê¸° 235function popup_ebookpreview(url) { 236 url = "http://www.aladin.co.kr/shop/ebook/preview.aspx?url=" + url; 237 window.open(url, 'popup_ebookpreview', 'width=790,height=800,left=0,top=0,scrollbars=yes,status=no,toolbar=no,'); 238} 239 240// radioni, 2010-05-06 return window object 241function popup_open2(url,nwidth,nheight,bscroll) 242{ 243 var w; 244 245 if(bscroll == true) 246 w = window.open( url,'apopup','scrollbars=yes,width=' + nwidth + ',height=' + nheight); 247 else 248 w = window.open(url,'apopup','scrollbars=no,width=' + nwidth + ',height=' + nheight); 249 250 return w; 251} 252 253 254function popup_help(pagename) 255{ 256 url = "/cs_center/wcs_popup_help.aspx?pn=" + pagename; 257 popup_open(url,730,600,true); 258} 259 260function opener_Redirect(url) 261{ 262 window.opener.document.location.href = url; 263} 264 265 266function getEvent(ev){ 267 return (ev ? ev : window.event); 268} 269 270function getEl(id) 271{ 272 if (document.getElementById) { 273 return document.getElementById(id); 274 } else if (document.all) { 275 return document.all[id]; 276 } else if (document.layers) { 277 return document.layers[id]; 278 } 279 280 return null; 281} 282 283 284function hideHelpMsg(id){ 285 try{ 286 var o = getEl(id); 287 o.style.visibility = "hidden"; 288 } catch(e){} 289} 290 291/**** 292 * 293 * Geckoìì§ìì fck editor를 ì´ì©í ë, Backì í ê²½ì° Backì 6ë²í´ì¤ì¼íë¤. 294 * 295 * @author visharp 296 *****/ 297function fckBack(){ 298 (navigator.userAgent.toLowerCase().indexOf("gecko")!=-1 ? 299 function(){ history.go(-6);} : 300 function(){ history.back(); })(); 301} 302 303/** 304* Event Methodê° ëë² ì ìëë ê²ì ë°©ì§. 305* ëë² ì ìë functionì ì°¨ë¡ëë¡ í¸ì¶. 306* 307* @author visharp 308***/ 309function addEvent(eventFn, newEventfn){ 310 var _eventFn = eval(eventFn); 311 312 var tempFn = function(){ 313 /* ìì ì ì¸ë event functionì´ ìë¤ë©´, ê·¸ functionì í¸ì¶í´ ì¤ */ 314 if(_eventFn) _eventFn(); 315 newEventfn(); 316 } 317 318 eval(eventFn +' = tempFn'); 319} 320 321/****** 322* Clientì ì±ë¥ 측ì . 323******/ 324function checkSpeed(isRecurr){ 325 var s = new Date().getMilliseconds(); 326 for(var i=0;i<2300;i++){ 327 var a=document.body; 328 } 329 var e = new Date().getMilliseconds() - s; 330 331 if(e<1 && !isRecurr){ 332 e = checkSpeed(true); 333 } else if(e<1 && isRecurr) { 334 return -1; 335 } 336 return e; 337} 338 339var prevHelpLayer; 340 341/* visibility를 ì´ì©í í ê¸ */ 342function toggleLayerV(id){ 343 var o = getEl(id); 344//alert(o); 345 if (o.style.visibility=="visible"){ 346 o.style.visibility = "hidden"; 347 } else { 348 if(prevHelpLayer) prevHelpLayer.style.visibility = "hidden"; 349 o.style.visibility = "visible"; 350 prevHelpLayer = o; 351 } 352} 353 354function layerVisible(id){ 355 // return DisplayShow(id); 356 var o = $(id); 357 if(!o) return; 358 o.style.visibility = "visible"; 359} 360 361function layerHidden(id){ 362 // return DisplayHide(id); 363 var o = $(id); 364 if(!o) return; 365 o.style.visibility = "hidden"; 366} 367 368function Hide_prevHelpLayer() 369{ 370 if(prevHelpLayer) prevHelpLayer.style.visibility = "hidden"; 371} 372 373function fn_helpLayer_Toggle(id){ 374 var o = getEl(id); 375 if (o.style.display == "block"){ 376 o.style.display = "none"; 377 } else { 378 if(prevHelpLayer) prevHelpLayer.style.display = "none"; 379 o.style.display = "block"; 380 prevHelpLayer = o; 381 } 382} 383 384function fn_helpLayer_Toggle_img(sender,target) { 385 386 var target = document.getElementById(target); 387 var src = sender.querySelector('img').src; 388 389 if (target.style.display == 'block') { 390 target.style.display = 'none'; 391 sender.querySelector('img').src = src.replace('_up', '_down'); 392 } else { 393 target.style.display = 'block'; 394 sender.querySelector('img').src = src.replace('_down', '_up'); 395 } 396} 397 398function fn_Layer_Hidden(id) { 399 var o = $(id); 400 if(!o) return; 401 o.style.display = "none"; 402} 403 404 405/** 406* Event Methodê° ëë² ì ìëë ê²ì ë°©ì§. 407* ëë² ì ìë functionì ì°¨ë¡ëë¡ í¸ì¶. 408* 409* @author visharp 410***/ 411function addEvent2(objName, eventName, eventFn){ 412 if (window.attachEvent) { 413 var o = eval(objName); 414 o.attachEvent(eventName, eventFn) 415 } else if (window.addEventListener){ 416 var o = eval(objName); 417 o.addEventListener(eventName.substring(2), eventFn , true) 418 } else {
419 // ë¶ë¦´ì¼ ê±°ì ììë¯.. 420 var objectEventName = objName+'.'+eventName; 421 var oldEventFn = eval(objectEventName); 422 423 var tempFn = function(){ 424 /* ìì ì ì¸ë event functionì´ ìë¤ë©´, ê·¸ functionì í¸ì¶í´ ì¤ */ 425 if(oldEventFn) oldEventFn(); 426 eventFn(); 427 } 428 eval(objectEventName +' = tempFn'); 429 } 430} 431 432/** 433* Event Methodê° ëë² ì ìëë ê²ì ë°©ì§. 434* ëë² ì ìë functionì ì°¨ë¡ëë¡ í¸ì¶. 435* 436* Objectì ì´ë¦ë§ê³ , ê°ì²´ ìì²´ë¡ ì ê·¼ 437* @author visharp 438***/ 439function addEventListenerFn(obj, eventName, eventFn){ 440 try { 441 if (window.attachEvent) { 442 obj.attachEvent(eventName, eventFn); 443 return true; 444 } else if (window.addEventListener){ 445 obj.addEventListener(eventName.substring(2), eventFn , true) 446 return true; 447 } 448 } catch(ex){} 449 return false; 450} 451 452var debug = false; 453var debug_mode = false; 454function warn(str){ 455 if(debug_mode) alert(str); 456} 457 458 459function selectAll(o){ 460 if(o.createTextRange){ 461 var range = o.createTextRange(); 462 range.moveStart("character", 0); 463 range.moveEnd("character", o.value.length); 464 range.select() 465 }else if(o.setSelectionRange){ 466 o.setSelectionRange(0, o.value.length) 467 } 468} 469 470function ttrim(str){ 471 var spos = 0; 472 while (str.charAt(spos) == ' ') spos = spos + 1; 473 474 var epos = str.length - 1; 475 while (epos >= 0 && str.charAt(epos) == ' ') epos = epos - 1; 476 return str.substring(spos, epos+1); 477} 478 479function trim(str) { 480 return str.replace(/(^\s*)|(\s*$)/g, ""); 481} 482 483 484function pubGo(pubBannerId, url){ 485 location.href = url; 486} 487 488function Coupon_Get(nType) 489{ 490 popup_open("/ucl/coupon/wcoupondown_result.aspx?nType=" + nType, 600, 600); 491} 492 493// SELECT BOXìì value를 기ì¤ì¼ë¡ selectíê² ë§ë ë¤. 494function selectByValue(selectOid, val){ 495 var o = getEl(selectOid); 496 if(o){ 497 for(var i=0; i<o.length; i++){ 498 if(o[i].value==val){ 499 o[i].selected = true; 500 return; 501 } 502 } 503 } 504} 505 506function setInitValue(objName, val){ 507 var o = getEl(objName); 508 if(o) o.value = val; 509} 510 511function setInitRadioValue(objName, val){ 512 var o = getEl(objName+val); 513 if(o){ 514 o.checked = true; 515 } else { 516 o = getEl(objName[val]); 517 if(o) o.selected = true; 518 } 519} 520 521/* ê°ì ì´ë¦ì radioë²í¼ ì¤ ì íë ê°ì 리í´íë¤.*/ 522function getSelectedRadioValue(names){ 523 var d = document.getElementsByName(names); 524 for(var ii=0; ii<d.length; ii++){ 525 if(d[ii].checked) return d[ii].value; 526 } 527 return ''; 528} 529 530function setRadioByValue(objName, val) { 531 var o = document.getElementsByName(objName); 532 if(o != null) 533 { 534 for(i=0; i<o.length; i++) 535 { 536 if(o[i].value == val) o[i].checked = true; 537 } 538 } 539} 540 541// csCenterê²ì ë°ë¡ê°ê¸° 542function goSearch(keyWord){ 543 try{ 544 var f = document.forms['frmCsSearch']; 545 f.SearchWord.value = keyWord; 546 f.submit(); 547 }catch(e){ alert(e); } 548} 549 550function $(id){ 551 return getEl(id); 552} 553 554function _$(id){ 555 var o = getEl(id); 556 if(o) return o.value; 557 else return null; 558} 559 560/* ê¸ì ì르기. íê¸,ìì´ ìê´ìì´ ë¹ì·í ê¸¸ì´ ëì´ @visharp*/ 561function nSubstring(str, len){ 562 if(!str || str.length<1) return str; 563 564 var weightLen = 0; 565 var count = 0; 566 567 for(var i=0; i<str.length; i++){ 568 if (len*2<=weightLen) break; 569 var ch = str.charCodeAt(i); 570 571 if(ch <0 || ch >=128) 572 weightLen += 2; //íê¸.. 573 else 574 weightLen += 1; //ì문.. 575 576 count++; 577 } 578 if(weightLen%2==1) count--; 579 return str.substring(0,count); 580} 581 582/* ë¹íì 문ìí기를 í¬í¨í ë¡ê·¸ì¸ íì */ 583function LoginCsPopUp(returnurl){ 584 var url = '/login/wlogin_popup.aspx?nologinq=1'; 585 586 if(returnurl){ 587 url = url + '&returnurl=' + escape(returnurl); 588 } 589 590 var csPop = window.open(url,'Login','width=431,height=256,status=0'); 591 592 if(!csPop){ 593 alert('íì ì´ ì°¨ë¨ëììµëë¤. íì ì°¨ë¨ì í´ì íìê³ ë¤ì í ë² ë¡ê·¸ì¸ í´ì£¼ì¸ì.'); 594 } 595} 596 597/* ì¸ì리 ë§ë¤ ì½¤ë§ ì°ê¸° */ 598function toCur(data){ 599 var nData = parseInt(data, 10); 600 601 if(isNaN(nData)) return 0; 602 603 var sData = nData.toString(); 604 var result = ''; 605 var nch =''; 606 var endPos = 0; 607 if(nData<0) endPos = 1; // ë§ì´ëì¤ ê¸ì¡ì´ë©´ 맨 ëì ì ì¸ 608 609 for(var ii=sData.length-1; ii>=endPos; ii--){ 610 nch = sData.charAt(ii); 611 result = nch + result; 612 613 if ( (ii%3==sData.length%3) && ii>endPos) { 614 result=','+result; 615 } 616 } 617 618 if(nData<0) result='-' + result; 619 return result; 620} 621 622/* textboxì ë ¥ì enterí¤ë¥¼ ë§ëë¤ */ 623function preventReturn(ev){ 624 ev = getEvent(ev); 625 if(ev.keyCode==13){ 626 if(ev.stopPropagation && ev.preventDefault){ 627 ev.stopPropagation(); 628 ev.preventDefault(); 629 } else if(window.event){ 630 ev.cancelBubble = true; 631 ev.returnValue = false;
632 } else { 633 // .... 634 } 635 return false; 636 } 637} 638 639/* div í ë리를 ë¥ê·¸ë ê² */ 640function RoundMeV(elName, borderColor, bgColor){ 641 var oel = $(elName); 642 if(!oel) return; 643 var elBgColor = oel.style.backgroundColor; 644 var elPadding = oel.style.padding; 645 // paddingì ë°ì¼ë¡ ëº 646 if(!elPadding) elPadding = '0px'; 647 else oel.style.padding ='0px' 648 649 var s = oel.innerHTML; 650 s = '<div style="background-color: '+bgColor+' ">'+ 651 '<span style="border-style: solid; border-color: '+borderColor+'; border-width: 0px 2px; overflow: hidden; background-color: '+elBgColor+'; display: block; height: 1px; font-size: 1px; margin-left: 3px; margin-right: 3px;"> </span>'+ 652 '<span style="border-style: solid; border-color: '+borderColor+'; border-width: 0px 1px; overflow: hidden; background-color: '+elBgColor+'; display: block; height: 1px; font-size: 1px; margin-left: 2px; margin-right: 2px;"> </span>'+ 653 '<span style="border-style: solid; border-color: '+borderColor+'; border-width: 0px 1px; overflow: hidden; background-color: '+elBgColor+'; display: block; height: 1px; font-size: 1px; margin-left: 1px; margin-right: 1px;"> </span>'+ 654 '<span style="border-style: solid; border-color: '+borderColor+'; border-width: 0px 1px; overflow: hidden; background-color: '+elBgColor+'; display: block; height: 2px; font-size: 1px; margin-left: 0px; margin-right: 0px;"> </span>'+ 655 '</div><div style="background-color:'+elBgColor+';padding:'+elPadding+'">' 656 +s + 657 '</div><div style="background-color: '+bgColor+'"><span style="border-style: solid; border-color: '+borderColor+'; border-width: 0px 1px; overflow: hidden; background-color: '+elBgColor+'; display: block; height: 2px; font-size: 1px; margin-left: 0px; margin-right: 0px;"> </span>'+ 658 '<span style="border-style: solid; border-color: '+borderColor+'; border-width: 0px 1px; overflow: hidden; background-color: '+elBgColor+'; display: block; height: 1px; font-size: 1px; margin-left: 1px; margin-right: 1px;"> </span>'+ 659 '<span style="border-style: solid; border-color: '+borderColor+'; border-width: 0px 1px; overflow: hidden; background-color: '+elBgColor+'; display: block; height: 1px; font-size: 1px; margin-left: 2px; margin-right: 2px;"> </span>'+ 660 '<span style="border-style: solid; border-color: '+borderColor+'; border-width: 0px 2px; overflow: hidden; background-color: '+elBgColor+'; display: block; height: 1px; font-size: 1px; margin-left: 3px; margin-right: 3px;"> </span></div>'; 661 oel.innerHTML = s; 662} 663 664/* ì í´ì§ ê¸ììê° ëë©´ ë¤ì Elementë¡ ìëì´ëíë¤. keyupì ì¬ì© */ 665function autoMoveNext(event, targetO, len, nextElementName){ 666 var ev = getEvent(event); 667 if(ev.keyCode==8 || ev.keyCode==37 || ev.keyCode==39) return; // (ë°±ì¤íì´ì¤, ì¼ìª½íì´í, ì¤ë¥¸ìª½íì´í)ë 무ì 668 669 if(!targetO || !nextElementName) return; 670 if(targetO.value.length>=len){ 671 var o = $(nextElementName); 672 if(!o) return; 673 o.focus(); 674 } 675} 676 677/* 길ì´ê° 0ì¸ ìíìì ë°±ì¤íì´ì¤ë¥¼ ë르면 ì´ì ì Elementë¡ ìëì´ëíë¤. onkeydownì ì¬ì©*/ 678function autoMovePrev(event, targetO, prevElementName){ 679 var ev = getEvent(event); 680 if(ev.keyCode!=8) return; 681 682 if(!targetO || !prevElementName) return; 683 if(targetO.value.length==0){ 684 var o = $(prevElementName); 685 if(!o) return; 686 // o.value = o.value.substring(0, o.value.length-1); 687 688 /* 커ì를 맨 ë¤ë¡ ì´ëìí¤ê¸° */ 689 if(o.createTextRange) { 690 var range = o.createTextRange(); 691 range.collapse(false); 692 range.moveStart("character", 0); 693 range.moveEnd("character", o.value.length); 694 range.select(); 695 } else if (o.setSelectionRange){ 696 o.setSelectionRange(o.value.length, o.value.length); 697 } 698 699 o.focus(); 700 } 701} 702 703// ìë°, DVDë©ì¸íì´ì§ì CommingSoon Ticker / FFìì ë²ê·¸ë°ê²¬. 704var CommingSoonTicker = { 705 "MAX_COUNT" : 6 , 706 "count" : 0 , 707 "timeobj" : '', 708 "cc" : '', 709 710 "rollStart" : function (){ 711 if(CommingSoonTicker.timeobj) clearInterval(CommingSoonTicker.timeobj); 712 CommingSoonTicker.timeobj = setInterval("CommingSoonTicker.roll()", 20); 713 }, 714 715 "roll" : function (){ 716 var cc = $('com_content'); 717 if(!cc) return; 718 var mt = parseInt(cc.style.marginTop); 719 cc.style.marginTop = (mt-1) + 'pt'; 720 // $('st_name').innerHTML = cc.style.marginTop; 721 722 if(parseInt(Math.abs(mt))%16==0){ 723 clearInterval(CommingSoonTicker.timeobj); 724 725 CommingSoonTicker.count++; 726 727 if( parseInt(CommingSoonTicker.count%3) == 0 ) 728 cc.style.paddingTop='0px'; 729 if( parseInt(CommingSoonTicker.count%3) == 1 ) 730 cc.style.paddingTop='1px'; 731 else 732 cc.style.paddingTop='2px'; 733 734 735 if(CommingSoonTicker.MAX_COUNT==CommingSoonTicker.count){ 736 // ë°ê¿ì¹ê¸°(무í루í) 737 var cc = $('com_content'); 738 if(cc) { cc.style.marginTop = "-2pt";} 739 CommingSoonTicker.count = 0; 740 } 741 742 // $('hotdvd').innerHTML = 'OOK' + CommingSoonTicker.count; 743 } else { 744 // $('hotdvd').innerHTML = 'nnn ' + CommingSoonTicker.count; 745 } 746 }, 747 748 "start" : function(){ 749 cc = $('com_content'); 750 if(!cc) return; 751 if(!cc.getElementsByTagName) return; 752 753 CommingSoonTicker.MAX_COUNT = cc.getElementsByTagName("li").length; 754 cc.innerHTML += '<li>' + cc.getElementsByTagName("li")[0].innerHTML + '</li>'; 755 // alert( cc.innerHTML ); 756 757 setInterval("CommingSoonTicker.rollStart()", 3000); 758 } 759 760}; 761 762function win_pop_cookie(path, win_name, wi, he, scroll, cookie_name) { 763 if ( getCookie( cookie_name ) == "" ) { 764 window.open(path,win_name,'width='+wi+',height='+he+',resizable=no,scrollbars='+scroll+', status=no,toolbar=no'); 765 } 766} 767 768function getCookie( name ){ 769 var nameOfCookie = name + "="; 770 var x = 0; 771 while ( x <= document.cookie.length ){ 772 var y = (x+nameOfCookie.length); 773 if ( document.cookie.substring( x, y ) == nameOfCookie ) { 774 if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 775 endOfCookie = document.cookie.length; 776 777 return unescape( document.cookie.substring( y, endOfCookie ) ); 778 } 779 x = document.cookie.indexOf( " ", x ) + 1; 780 if ( x == 0 ) 781 break; 782 } 783 return ""; 784} 785 786function setCookie_V1(name, value, expires) { 787 var domain = ".aladin.co.kr"; 788 var secure = false;
789 790 var endDate = new Date(); 791 endDate.setDate(endDate.getDate() + expires); 792 document.cookie = name + "=" + escape(value) + ((endDate == null) ? "" : ("; expires=" + endDate.toGMTString())) + "; path=/" + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); 793} 794 795function setCookie( name, value, expiredays ) 796{ 797 var endDate = new Date(); 798 endDate.setDate( endDate.getDate()+ expiredays ); 799 document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + endDate.toGMTString() + ";" 800} 801 802// Deprecated 803function btnBlogit_onclick(isbn){ 804 window.open('/ttb/wblogit.aspx?ISBN='+isbn, 'blogit', 'scrollbars=1,resizable=1,width=500,height=400'); 805} 806// Deprecated 807function btnBlogit_Copy_onclick(isbn){ 808 window.open('/ttb/wblogit_copy.aspx?ISBN=' + isbn, 'blogit_copy', 'scrollbars=1,resizable=1,width=500,height=400'); 809} 810 811function Blogit(isbn){ 812 var o = window.open('/ttb/wblogit.aspx?ISBN='+isbn, 'blogit', 'scrollbars=1,resizable=1,width=830,height=670'); 813 if(typeof(o)=='undefined') alert('íì ì°¨ë¨ì í´ì§í´ì£¼ì¸ì') 814} 815function Blogit_Copy(isbn){ 816 var o = window.open('/ttb/wblogit_copy.aspx?ISBN='+isbn, 'blogit_copy', 'scrollbars=1,resizable=1,width=500,height=400'); 817 if(typeof(o)=='undefined') alert('íì ì°¨ë¨ì í´ì§í´ì£¼ì¸ì') 818} 819 820function fn_Search_StoreNotice() { 821 alert("매ì¥ëª ì ë르면 í매ê°ì ìê° ìì¹ë¥¼ ì ì ììµëë¤."); 822 return false; 823} 824 825 826// ì¤ì í¬ê² ì¤í¬ë¡¤ëë ë°°ë 827var upBanner = {}; 828upBanner.init = function(elName){ 829 // const field 830 this.timeInteval = 40; 831 this.speedVal = 3; 832 833 //field 834 this.to = ''; 835 this.count = 0; 836 this.elName = elName; 837 this.targetEl = $(this.elName); 838 839 840 this.height = 0; 841 this.targetEl.style.display = 'block'; 842 843 // public method(s) 844 845 this.setHeight = function(val){ 846 this.count = val/this.speedVal; 847 this.height = val; 848 }; 849 850 this.hide = function(){ 851 $(this.elName+'_Close').style.display = "none"; 852 this.count = this.height/this.speedVal; 853 upBanner.hide_timer(); 854 }; 855 856 this.show = function (){ 857 if(upBanner.count<1){ 858 upBanner.targetEl.style.height = parseInt(upBanner.height)+'px'; 859 $(upBanner.elName+'_Close').style.display = "block"; 860 clearTimeout(upBanner.to); 861 return; 862 } 863 864 upBanner.count-=4; 865 if(upBanner.count*upBanner.speedVal<0){ 866 upBanner.targetEl.style.height = parseInt(upBanner.height)+'px'; 867 } else { 868 upBanner.targetEl.style.height = parseInt(upBanner.height-upBanner.count*upBanner.speedVal)+'px'; 869 } 870 upBanner.to = setTimeout(upBanner.show, upBanner.timeInteval); 871 return; 872 }; 873 874 this.hide_timer = function (){ 875 if(upBanner.count<2){ 876 upBanner.targetEl.style.display = 'none'; 877 clearTimeout(upBanner.to); 878 return; 879 } 880 881 upBanner.count-=4; 882 upBanner.targetEl.style.height = (upBanner.count*upBanner.speedVal)+'px'; 883 upBanner.to = setTimeout(upBanner.hide_timer, upBanner.timeInteval); 884 return; 885 }; 886 887} 888upBanner.start = function(elName){ 889 var cook = getCookie('phono_upBanner'); 890 if(parseInt(cook,10)==1){ 891 return; 892 } 893 this.init(elName); 894 this.setHeight(160); 895 this.show(); 896} 897 898upBanner.ToDayStop = function(){ 899 setCookie('phono_upBanner', 1, 1); 900 upBanner.hide(); 901} 902 903 904function cyPop(){ 905 if ( getCookie( "cyworld_pop_no_see" )!="true" ) { 906 var cyworld_pop = window.open('/ucl_editor/ttb/wcyworld_pop.aspx', "cyworld_pop", 'width=430,height=305,resizable=0,scrollbars=0' ); 907 if(!cyworld_pop){ 908 alert("íì ì´ ì°¨ë¨ ëììµëë¤.\r\níì ì¤ì ì íì©ì¼ë¡ í´ì£¼ì기 ë°ëëë¤."); 909 } else { 910 // cyworld_pop.opener = self; 911 } 912 } 913} 914 915// ace Counter쿼리ì¶ê° 916function addParam() { 917 if(!document || !document.getElementsByTagName) return; 918 919 var param = "main"; 920 if (location.href.indexOf('aladin.co.kr/home/welcome.aspx') > 0) param = "we"; 921 else if (location.href.indexOf('aladin.co.kr/usedstore/wstoremain.aspx') > 0) param = "offmain"; 922 923 try{ 924 var aTags = document.getElementsByTagName('a'); 925 addParamInLinks(aTags, param); 926 }catch(exxx){} 927} 928 929// í¹ì ìë¦¬ë¨¼í¸ ë´ììë§ ë§í¬ê°ì íë¼ë¯¸í° ë¶ì´ê¸° 930function addParamInElement(objName, param) { 931 if(!document || !document.getElementsByTagName || !document.getElementById) return; 932 933 var obj = document.getElementById(objName); 934 935 if(!obj) return; 936 937 try{ 938 var aTags = obj.getElementsByTagName('a'); 939 addParamInLinks(aTags, param); 940 }catch(exxx){} 941} 942 943// 주ì´ì§ aíê·¸ì ë§í¬ê°ë¤ì í¹ì íë¼ë¯¸í°(start) ë¶ì´ê¸° 944function addParamInLinks(aTags, param){ 945 for(var i=0; i<aTags.length; i++){ 946 try{ 947 var caTags = aTags[i]; 948 var caTagsHref = caTags.href; 949 950 if(!caTagsHref || caTagsHref=="" || caTagsHref.indexOf("#")>-1 || caTagsHref.indexOf("javascript")>-1 || caTagsHref.indexOf("/blog/mypaper/")>-1 951 || caTagsHref.indexOf("mailto:")>-1 || caTagsHref.indexOf("&start")>
951-1 || caTagsHref.indexOf("?start")>-1 ) { 952 continue; 953 } else if (caTagsHref.indexOf("/jiny/wnoti.aspx") > -1) { 954 if (caTagsHref.indexOf("?") > 0) { 955 caTags.href = caTagsHref + '&start=' + param + "_allim"; 956 } else { 957 caTags.href = caTagsHref + '?start=' + param + "_allim"; 958 } 959 } else { 960 if (caTagsHref.indexOf("?") > 0) { 961 caTags.href = caTagsHref + '&start=' + param; 962 } else { 963 caTags.href = caTagsHref + '?start=' + param; 964 } 965 } 966 }catch(ex){ /*alert(ex);*/ } 967 } 968} 969 970/* for 'firefox' : íì ìì ë¶ëª¨ì°½ì íì ìíëì°ê¸° */ 971function newWinPop(url, isClose){ 972 //if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){ 973 if(opener && opener.window){ 974 var isOpen = opener.window.open(url, "newWinPop"); 975 if(isClose && isClose==true && isOpen){ 976 self.close(); 977 } 978 return isOpen; 979 } 980 return false; 981} 982 983/* ë¶ëª¨ì Iframe ì¬ì´ì¦ë¥¼ ì¡°ì í ë ì¬ì©í¨ */ 984function fReSize(iframeID) { 985 try { 986 var objFrame = parent.document.getElementsByName(iframeID)[0]; //ë¶ëª¨ì°½ì iframe ì´ë¦ ë°ìì¤ëê² 987 var objBody = document.body; 988 989 ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight); 990 if (ifrmHeight > 0) { 991 objFrame.style.height = ifrmHeight; 992 } 993 } catch(e) { 994 //fReSize(); 995 } 996} 997// Display FLash movie 998function DFL(url, width, height){ 999 var urlEn = encodeURIComponent ? encodeURIComponent : escape; 1000 var xType= 'flash'; 1001 var LowerUrl = url.toLowerCase(); 1002 if(LowerUrl.indexOf(".wmv")>-1 || LowerUrl.indexOf(".avi")>-1){ 1003 xType= 'wm'; 1004 } 1005 document.write("<s"+"cript type=\"text/javascript\" src=\"/js/wxobject.aspx?width="+width+"&height="+height+"&type="+xType+"&src="+urlEn(url)+"\"></s"+"cript>"); 1006 // document.write("<s"+"cript type=\"text/javascript\" src=\"/js/wxobject.aspx?width=425&height=355&src=http://www.youtube.com/v/bCiMxU5OiDA\"></s"+"cript>"); 1007} 1008 1009function DFL_V2(url, width, height, autoplay){ 1010 var urlEn = encodeURIComponent ? encodeURIComponent : escape; 1011 var xType= 'flash'; 1012 var LowerUrl = url.toLowerCase(); 1013 if(LowerUrl.indexOf(".wmv")>-1 || LowerUrl.indexOf(".avi")>-1 || LowerUrl.indexOf(".wma")>-1 || LowerUrl.indexOf(".mov")>-1){ 1014 xType= 'wm'; 1015 } 1016 //document.write("<s"+"cript type=\"text/javascript\" src=\"/js/wxobject.aspx?width="+width+"&height="+height+"&type="+xType+"&src="+urlEn(url)+"&autoplay=" + autoplay + " \"></s"+"cript>"); 1017 // document.write("<s"+"cript type=\"text/javascript\" src=\"/js/wxobject.aspx?width=425&height=355&src=http://www.youtube.com/v/bCiMxU5OiDA\"></s"+"cript>"); 1018} 1019 1020function __debug(){ 1021 //try{ 1022 // var input = ''; 1023 // for(var i=0; i<1000; i++) { 1024 // input = prompt("debug", input); 1025 // if(input=='exit') break; 1026 // eval(input); 1027 // } 1028 //}catch(ex){alert(ex);} 1029} 1030 1031function reFormBanner(headerTopName) { 1032 var headerTop = $(headerTopName); 1033 if(!headerTop) return; 1034 1035 var TopHeight = headerTop.offsetHeight + headerTop.offsetTop + 45; 1036 1037 //ë©ì¸ ì¤ë¥¸ìª½ ë°°ë 1038 var bannerright = getEl("bannerright"); 1039 if(bannerright) { 1040 bannerright.style.left = (document.body.clientWidth + 935) / 2; 1041 bannerright.style.top = TopHeight - 60; 1042 } 1043 1044 //ë©ì¸ ì¼ìª½ ë°°ë 1045 var bannerleft = getEl("bannerleft"); 1046 if(bannerleft) { 1047 bannerleft.style.right = (document.body.clientWidth + 935) / 2; 1048 bannerleft.style.top = TopHeight - 36; 1049 } 1050 1051 //ì°ì»´ ì¤ë¥¸ìª½ íµë©ë´ 1052 var welcome_quickmenu = getEl("welcome_quickmenu"); 1053 if(welcome_quickmenu) { 1054 welcome_quickmenu.style.left = ((document.body.clientWidth+935) / 2); 1055 welcome_quickmenu.style.top = TopHeight - 42; 1056 } 1057 1058 //ì°ì»´ ì¼ìª½ ë°°ë 1059 var welcome_leftbanner = getEl("welcome_leftbanner"); 1060 if(welcome_leftbanner) { 1061 welcome_leftbanner.style.right = ((document.body.clientWidth+935) / 2); 1062 //welcome_leftbanner.style.top = TopHeight - 45; 1063 welcome_leftbanner.style.top = TopHeight -115; 1064 } 1065} 1066 1067addEvent2("window", "onload", function() { 1068 var now = new Date(); 1069 if((getCookie('IsWorkLayer') != "checked") && now.getFullYear() == 2010 && (now.getMonth() + 1) == 1 && now.getDate() == 16 && now.getHours() == 1) 1070 { 1071 var obj = $("Wa_header1_headerTop"); 1072 var left = ((document.body.clientWidth - 400) / 2) 1073 var top = obj.offsetHeight + obj.offsetTop + 45 1074 var htmEvent = "<div id='WorkLayer' style='position:absolute;z-index:1000;top:" + top +";
1074left:" + left + ";'><table width='436' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td><img src='http://image.aladdin.co.kr/img/events/090801_notice01.jpg' /></td></tr><tr><td align='center' background='http://image.aladdin.co.kr/img/events/090801_notice02.jpg'><table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td style='width:100%;line-height: 17px; font-family: dotum; font-size: 12px;text-align:left;word-break: break-all;color:#000000;padding:0 20px 0 20px;'>ìë íì¸ì, ê³ ê°ë!<br />ìë¼ë ìì¤í ì 기 ì ê²ì ëí´ ìë´í´ ë립ëë¤.<br /><br /><strong><font style='color: #67b228; font-size: 14px; letter-spacing: -1px;'>ì ê² ìê° : 2010ë 1ì 16ì¼ (í ìì¼) ìë²½ 2ì ~ 3ì</font></strong><br /><br />ìì ìê° ëì ìë¼ëì 모ë ìë¹ì¤ (ìë¼ë ìì¬, ì°½ìë¸ë¡ê·¸, TTB)를 ì´ì©íì¤ ì ììµëë¤.<br /><br />ëí ë§¤ì¼ ìë²½ ì 기ì ì¼ë¡ ì´ë£¨ì´ì§ë ì ë°ì´í¸ (ìì¬ ì§ì ì ë°ì´í¸, ì¤ê³ ìµì ë±ë¡í 물í ìê°ê¸, ë§ì´ìë¼ë ë±)ê° ë¹ì¼ ì ë°ì´í¸ ëì§ ìì ì ìì¼ë ì°¸ì¡°í´ ì£¼ì기 ë°ëëë¤.<br /><br /><strong><font style='color: #525252;'>íì¬ ì§í ì¤ì¸ ìì ì´ ìì¼ìë¤ë©´ ìë²½ 0ì ì´ì ì ì ì¥íê³ ìë£í´ì£¼ì기 ë°ëëë¤.</font></strong><br /></td></tr></table></td></tr><tr><td background ='http://image.aladdin.co.kr/img/events/090801_notice03.jpg' style='line-height: 17px;font-family:dotum;font-size:12px;height:40px;padding: 17px 0 0 7px;text-align:left;'>" + 1075 "<a href=\"javascript:HiddenPopLayer('WorkLayer');\"><img src='http://image.aladdin.co.kr/img/events/090801_notice04.jpg' border='0' /></a></td></tr></table></div>"; 1076 obj.innerHTML += htmEvent; 1077 setCookie('IsWorkLayer','checked',1); 1078 } 1079}); 1080 1081function HiddenPopLayer(name) 1082{ 1083 $(name).style.visibility = "hidden"; 1084} 1085 1086//div ë³´ì¬ì£¼ê¸° 1087function hDisplayShow(lname){ 1088 getEl(lname).style.display = "block"; 1089} 1090 1091//div ë³´ì¬ì£¼ê¸° 1092function hDisplayShowL(lname){ 1093 getEl(lname).style.display = "inline"; 1094} 1095 1096 1097//div ì¨ê¸°ê¸° 1098function hDisplayHide(lname){ 1099 getEl(lname).style.display = "none"; 1100} 1101 1102function shortenUrlCopy(shortenUrl){ 1103 var secMsg = ''; 1104 1105 if(window.clipboardData){ 1106 var secCheck = window.clipboardData.setData('TEXT',shortenUrl); 1107 if(secCheck){ 1108 alert('ë¨ì¶URLì´ ë³µì¬ëììµëë¤.'); 1109 Element.hide('shortenUrlPop'); 1110 return; 1111 } else { 1112 secMsg = 'IEì ê²½ì°ë ì¡ì¸ì¤ë¥¼ íì©íì ì¼ ë³µì¬ê° ê°ë¥í©ëë¤.\r\n'; 1113 } 1114 } 1115 1116 prompt(secMsg + "ìëì ë¨ì¶URLì ë³µì¬íìê³ ìíìë ê³³ì ë¶ì¬ë£ê¸° í´ì£¼ì기 ë°ëëë¤.", shortenUrl); 1117 1118} 1119 1120 1121function checkTodayPopLayer(name,key) 1122{ 1123 if ( getCookie(key) != "checked") 1124 $(name).style.visibility = "visible"; 1125} 1126 1127function HiddenTodayPopLayer(name) 1128{ 1129 $(name).style.visibility = "hidden"; 1130} 1131 1132function closeTodayPopLayer(name, key, expiredays) 1133{ 1134 setPopupCookie( key, "checked" , expiredays); 1135 HiddenTodayPopLayer(name); 1136} 1137function setPopupCookie( name, value, expiredays ) 1138{ 1139 var endDate = new Date(); 1140 endDate.setDate( endDate.getDate()+ expiredays ); 1141 endDate.setHours(0); 1142 endDate.setMinutes(0); 1143 endDate.setSeconds(0); 1144 document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + endDate.toGMTString() + ";" 1145} 1146 1147function FindCVSPopupShow() 1148{ 1149 if ("ActiveXObject" in window) 1150 { // ie 1151 window.open('http://was.cvsnet.co.kr/GIS/ZERO/terminal/cvsnet_shop_home_terminal_gshome.jsp', 'cvsnet','width=1000,height=680,status=0'); 1152 } 1153 else 1154 { // not ie 1155 window.open('/ucl/account/wa_FindCVSLayer.aspx', 'FindCVS','width=420,height=620,status=0,scrollbars=1'); 1156 } 1157} 1158 1159function copyText(text, alertMessage) { 1160 var secMsg = ''; 1161 1162 if (window.clipboardData) { 1163 var secCheck = window.clipboardData.setData('TEXT', text); 1164 if (secCheck) { 1165 alert(alertMessage); 1166 return; 1167 } else { 1168 secMsg = 'IEì ê²½ì°ë ì¡ì¸ì¤ë¥¼ íì©íì ì¼ ë³µì¬ê° ê°ë¥í©ëë¤.\r\n'; 1169 } 1170 } 1171 1172 prompt(secMsg + "ìëì í ì¤í¸ì ë³µì¬íìê³ ìíìë ê³³ì ë¶ì¬ë£ê¸° í´ì£¼ì기 ë°ëëë¤.", text); 1173} 1174 1175function isValidEmailAddress(email) {
1176 var validEmail = false; 1177 if (email) { 1178 var pattern = /^[\w-']+(\.[\w-']+)*@([a-zA-Z0-9]+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*?\.[a-zA-Z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$/; 1179 validEmail = pattern.exec(email); 1180 } 1181 return validEmail; 1182} 1183 1184 1185 1186//############################################ 1187//긴ê¸ê³µì§íì 2010-04-23 juliet 1188//############################################ 1189//setTimeout(function(){ 1190// var cookie_n_noticepopup="notice_popup"; 1191// var cookie_v_noticepopup="notice_checked"; 1192// if(getCookie(cookie_n_noticepopup) != cookie_v_noticepopup){ 1193// var p = window.open('http://www.aladdin.co.kr/ucl_editor/notice/notice_20100423.aspx', 'aladdin_notice', 'width=520,height=468,toolbar=no, location=no, status=no, menubar=no, resizable=no;'); 1194// p.focus(); 1195// } 1196// 1197//}, 300); 1198 1199var jinyRecentRecomTab = { 1200 currentIdx: 0, 1201 maxIdx: 0, 1202 tabs: [], 1203 idPrefix: "#jiny_recentRecom_Tab", 1204 next: function () { this._move(1); }, 1205 prev: function () { this._move(-1); }, 1206 _move: function (dir) { 1207 this.moveTo(jinyRecentRecomTab.currentIdx + dir); 1208 }, 1209 moveTo: function (idx) { 1210 $j(this.idPrefix + jinyRecentRecomTab.currentIdx).css("display", "none"); 1211 jinyRecentRecomTab.currentIdx = (idx + this.maxIdx) % (this.maxIdx); 1212 $j(this.idPrefix + jinyRecentRecomTab.currentIdx).css("display", ""); 1213 }, 1214 init: function () { 1215 this.tabs = $j(".jiny_recentRecom_Tab"); 1216 this.maxIdx = this.tabs.length; 1217 this.currentIdx = 0; 1218 } 1219}; 1220 1221var jinyToolLayerInfoFW = { 1222 custKey: 0, 1223 IsUserValidLogin: false, 1224 orderListMsgST: false, 1225 _middleCoverClass: ".w_jiny_6dan_cover", 1226 _recentRecomListId: "#w_jiny_recentRecomList", 1227 _recentListId: "#w_jiny_recentList", 1228 _btnWrapClass: ".w_jiny_btn_wrap2", 1229 _recentDelIconClass: ".w_fix_del", 1230 _recentDelBtnClass: ".jinyToolRecentDelete", 1231 recentListInit: function () { 1232 if ($j(this._recentListId).html() == '') { 1233 $j(".w_jiny_click").hide(); 1234 return; 1235 } 1236 1237 $j(this._recentListId).find("li").hover( 1238 function (e) { 1239 $j(this).find(jinyToolLayerInfoFW._recentDelIconClass).show(); 1240 }, 1241 function (e) { 1242 $j(this).find(jinyToolLayerInfoFW._recentDelIconClass).hide(); 1243 } 1244 ) 1245 1246 $j(this._recentDelBtnClass).click(function (e) { 1247 var isbn = $j(this).parents("li").attr("data-isbn"); 1248 var fnName = "DeleteRecent"; 1249 //var url = "/jiny/wajax.aspx?custkey=" + jinyToolLayerInfoFW.custKey + "&commandtype=RecentItemListHtml&ISBN=" + isbn + "&fn=" + fnName + jinyToolLayerInfoFW._getDummy(); 1250 var url = jinyToolLayerInfoFW._getAjaxUrl("RecentItemListHtml", isbn, fnName); 1251 1252 $j(jinyToolLayerInfoFW._recentListId).load(url, function () { 1253 jinyToolLayerInfoFW.recentListInit(); 1254 1255 // var recomUrl = "/jiny/wajax.aspx?custkey=" + jinyToolLayerInfoFW.custKey + "&commandtype=RecentRecomItemHtml" + jinyToolLayerInfoFW._getDummy(); 1256 var recomUrl = jinyToolLayerInfoFW._getAjaxUrl("RecentRecomItemHtml", "", ""); 1257 $j(jinyToolLayerInfoFW._recentRecomListId).load(recomUrl, function () { 1258 jinyToolLayerInfoFW.recomListInit(); 1259 }); 1260 }); 1261 1262 return false; 1263 }); 1264 }, 1265 _execRecomAjax: function (isbn, type) { 1266 var fnName = ""; 1267 1268 if (type == 1) { 1269 fnName = "AddOrderList"; 1270 } else if (type == 2) { 1271 fnName = "DeleteRecommend"; 1272 } else { 1273 return; 1274 } 1275 1276 var currentIdx = jinyRecentRecomTab.currentIdx; 1277 // var url = "/jiny/wajax.aspx?custkey=" + jinyToolLayerInfoFW.custKey + "&commandtype=RecentRecomItemHtml&ISBN=" + isbn + "&fn=" + fnName + jinyToolLayerInfoFW._getDummy(); 1278 var url = jinyToolLayerInfoFW._getAjaxUrl("RecentRecomItemHtml", isbn, fnName); 1279 1280 $j(jinyToolLayerInfoFW._recentRecomListId).load(url, function () { 1281 if (jinyToolLayerInfoFW._isRecomListEmpty()) { 1282 return; 1283 } 1284 jinyToolLayerInfoFW.recomListInit(); 1285 jinyRecentRecomTab.moveTo(currentIdx); 1286
1287 $j("#recommend_layer_box_basket").hide(); 1288 if (type == 1) { 1289 jinyToolLayerInfoFW._showMsgBox("#recommend_layer_box_orderList"); 1290 } 1291 }); 1292 }, 1293 _execAddBasketAjax: function (isbn) { 1294 $j("#recommend_layer_box_orderList").hide(); 1295 AUtil.addBasketSimple(isbn, function (data) { 1296 var basketResult = data; 1297 var resultObj = $j("#recommend_layer_box_basket"); 1298 1299 if (basketResult["Exist"] == "true") { 1300 resultObj.find(".existFalse").hide(); 1301 resultObj.find(".existTrue").show(); 1302 } else { 1303 resultObj.find(".existFalse").show(); 1304 resultObj.find(".existTrue").hide(); 1305 } 1306 1307 jinyToolLayerInfoFW._showMsgBox("#recommend_layer_box_basket"); 1308 //console.log("_execAddBasketAjax"); 1309 }); 1310 }, 1311 _showMsgBox: function(layerId){ 1312 $j(layerId).show(); 1313 1314 if (jinyToolLayerInfoFW.orderListMsgST) { 1315 clearTimeout(jinyToolLayerInfoFW.orderListMsgST); 1316 } 1317 1318 jinyToolLayerInfoFW.orderListMsgST = setTimeout(function () { 1319 $j(layerId).fadeOut(500); 1320 }, 1000); 1321 }, 1322 _isRecomListEmpty: function () { 1323 if ($j(jinyToolLayerInfoFW._recentRecomListId).html() == '') { 1324 $j("#w_jiny_recentContent").hide(); 1325 return true; 1326 } else { 1327 $j("#w_jiny_recentContent").show(); 1328 return false; 1329 } 1330 }, 1331 recomListInit: function () { 1332 if (jinyToolLayerInfoFW._isRecomListEmpty()) { 1333 return; 1334 } 1335 1336 $j(this._recentRecomListId).find(this._middleCoverClass).hover( 1337 function (e) { 1338 $j(this).find(jinyToolLayerInfoFW._btnWrapClass).show(); 1339 }, 1340 function (e) { 1341 $j(this).find(jinyToolLayerInfoFW._btnWrapClass).hide(); 1342 } 1343 ) 1344 1345 $j(".jinyToolShopLink").attr("href", function () { 1346 var isbn = jinyToolLayerInfoFW._getDataISBN(this); 1347 return "http://www.aladin.co.kr" + "/shop/wproduct.aspx?ISBN=" + isbn; 1348 }); 1349 1350 $j(".jinyToolAddOrderListBtn").click(function (e) { 1351 if (jinyToolLayerInfoFW.IsUserValidLogin == false) { jinyToolLayerInfoFW._loginPopup(); return false; } 1352 var isbn = jinyToolLayerInfoFW._getDataISBN(this); 1353 jinyToolLayerInfoFW._execRecomAjax(isbn, 1); 1354 return false; 1355 }); 1356 1357 $j(".jinyToolRecomDeleteBtn").click(function (e) { 1358 if (jinyToolLayerInfoFW.IsUserValidLogin == false) { jinyToolLayerInfoFW._loginPopup(); return false; } 1359 var isbn = jinyToolLayerInfoFW._getDataISBN(this); 1360 jinyToolLayerInfoFW._execRecomAjax(isbn, 2); 1361 return false; 1362 }); 1363 1364 $j(".jinyToolAddBasketBtn").click(function (e) { 1365 var isbn = jinyToolLayerInfoFW._getDataISBN(this); 1366 jinyToolLayerInfoFW._execAddBasketAjax(isbn); 1367 return false; 1368 }); 1369 1370 jinyRecentRecomTab.init(); 1371 }, 1372 _getDataISBN: function (obj) { 1373 return $j(obj).parents(this._middleCoverClass).attr("data-isbn"); 1374 }, 1375 _loginPopup: function () { 1376 window.open('/login/wlogin_popup.aspx', 'Login', 'width=780,height=500,status=0'); 1377 return; 1378 }, 1379 _getDummy: function () { 1380 return "&__dummy=" + new Date().getTime(); 1381 }, 1382 _getAjaxUrl: function (commandtype, ISBN, fnName) { 1383 var url = "/jiny/wajax.aspx?custkey=" + this.custKey + this._getDummy(); 1384 1385 if (commandtype && commandtype.length > 0) { 1386 url = url + "&commandtype=" + commandtype; 1387 } 1388 1389 if (ISBN && ISBN.length > 0) { 1390 url = url + "&ISBN=" + ISBN; 1391 } 1392 1393 if (fnName && fnName.length > 0) { 1394 url = url + "&fn=" + fnName; 1395 } 1396 return url; 1397 }, 1398 AllListInit: function () { 1399 var recomUrl = jinyToolLayerInfoFW._getAjaxUrl("RecentRecomItemHtml", "", ""); 1400 1401 $j(this._recentRecomListId).load(recomUrl, function () { 1402 jinyToolLayerInfoFW.recomListInit(); 1403 1404 var recentUrl = jinyToolLayerInfoFW._getAjaxUrl("RecentItemListHtml", "", ""); 1405 1406 $j(jinyToolLayerInfoFW._recentListId).load(recentUrl, function () { 1407 jinyToolLayerInfoFW.recentListInit(); 1408 }); 1409 }); 1410 } 1411} 1412 1413var jinyRecentRecomTab2 = { 1414 currentIdx: 0, 1415 maxIdx: 0, 1416 tabs: [], 1417 idPrefix: "#jiny_recentRecom_Tab", 1418 next: function () { this._move(1); }, 1419 prev: function () { this._move(-1); }, 1420 _move: function (dir) { 1421 this.moveTo(jinyRecentRecomTab2.currentIdx + dir); 1422 }, 1423 moveTo: function (idx) { 1424 $j(this.idPrefix + jinyRecentRecomTab2.currentIdx).css("display", "none"); 1425 jinyRecentRecomTab2.currentIdx = (idx + this.maxIdx) % (this.maxIdx); 1426 $j(this.idPrefix + jinyRecentRecomTab2.currentIdx).css("display", ""); 1427 }, 1428 init: function () { 1429 this.tabs = $j(".jiny_recentRecom_Tab"); 1430 this.maxIdx = this.tabs.length; 1431 this.currentIdx = 0; 1432 } 1433}; 1434 1435var jinyToolLayerInfoFW2 = { 1436 custKey: 0, 1437 IsUserValidLogin: false, 1438 orderListMsgST: false, 1439 currentISBN: "", 1440 IsBtnLayer: true, 1441 _middleCoverClass: ".layerbtnboxwrap", 1442 _recentRecomListId: "#w_jiny_recentRecomList", 1443 _recentListId: "#w_jiny_recentList", 1444 _btnWrapClass: ".layerbtnbox", 1445 _recentDelIconClass: ".w_fix_del", 1446 _recentDelBtnClass: ".jinyToolRecentDelete", 1447 recentListInit: function () { 1448 if ($j(this._recentListId).html() == '') { 1449 $j(".w_jiny_click").hide(); 1450 return; 1451 } 1452 1453 $j(this._recentListId).find("li").hover( 1454 function (e) { 1455 $j(this).find(jinyToolLayerInfoFW2._recentDelIconClass).show(); 1456 }, 1457 function (e) { 1458 $j(this).find(jinyToolLayerInfoFW2._recentDelIconClass).hide(); 1459 } 1460 ) 1461 1462 $j(this._recentDelBtnClass).click(function (e) { 1463 var isbn = $j(this).parents("li").attr("data-isbn"); 1464 var fnName = "DeleteRecent"; 1465 var url = jinyToolLayerInfoFW2._getAjaxUrl("RecentItemListHtml2", isbn, fnName); 1466 1467 $j(jinyToolLayerInfoFW2._recentListId).load(url, function () { 1468 jinyToolLayerInfoFW2.recentListInit(); 1469 1470 var recomUrl = jinyToolLayerInfoFW2._getAjaxUrl("RecentRecomItemHtml2", jinyToolLayerInfoFW2.currentISBN, ""); 1471 $j(jinyToolLayerInfoFW2._recentRecomListId).load(recomUrl, function () { 1472 jinyToolLayerInfoFW2.recomListInit(); 1473 }); 1474 }); 1475 1476 return false;
1477 }); 1478 }, 1479 _execRecomAjax: function (isbn, type) { 1480 var fnName = ""; 1481 1482 if (type == 1) { 1483 fnName = "AddOrderList"; 1484 } else if (type == 2) { 1485 fnName = "DeleteRecommend"; 1486 } else { 1487 return; 1488 } 1489 1490 var currentIdx = jinyRecentRecomTab2.currentIdx; 1491 var url = jinyToolLayerInfoFW2._getAjaxUrl("RecentRecomItemHtml2", jinyToolLayerInfoFW2.currentISBN, fnName); 1492 1493 $j(jinyToolLayerInfoFW2._recentRecomListId).load(url, function () { 1494 if (jinyToolLayerInfoFW2._isRecomListEmpty()) { 1495 return; 1496 } 1497 jinyToolLayerInfoFW2.recomListInit(); 1498 jinyRecentRecomTab2.moveTo(currentIdx); 1499 1500 $j("#recommend_layer_box_basket").hide(); 1501 if (type == 1) { 1502 jinyToolLayerInfoFW2._showMsgBox("#recommend_layer_box_orderList"); 1503 } 1504 }); 1505 }, 1506 _execAddBasketAjax: function (isbn) { 1507 $j("#recommend_layer_box_orderList").hide(); 1508 AUtil.addBasketSimple(isbn, function (data) { 1509 var basketResult = data; 1510 var resultObj = $j("#recommend_layer_box_basket"); 1511 1512 if (basketResult["Exist"] == "true") { 1513 resultObj.find(".existFalse").hide(); 1514 resultObj.find(".existTrue").show(); 1515 } else { 1516 resultObj.find(".existFalse").show(); 1517 resultObj.find(".existTrue").hide(); 1518 } 1519 1520 jinyToolLayerInfoFW2._showMsgBox("#recommend_layer_box_basket"); 1521 //console.log("_execAddBasketAjax"); 1522 }); 1523 }, 1524 _showMsgBox: function (layerId) { 1525 $j(layerId).show(); 1526 1527 if (jinyToolLayerInfoFW2.orderListMsgST) { 1528 clearTimeout(jinyToolLayerInfoFW2.orderListMsgST); 1529 } 1530 1531 jinyToolLayerInfoFW2.orderListMsgST = setTimeout(function () { 1532 $j(layerId).fadeOut(500); 1533 }, 1000); 1534 }, 1535 _isRecomListEmpty: function () { 1536 if ($j(jinyToolLayerInfoFW2._recentRecomListId).html() == '') { 1537 $j("#w_jiny_recentContent").hide(); 1538 return true; 1539 } else { 1540 $j("#w_jiny_recentContent").show(); 1541 return false; 1542 } 1543 }, 1544 recomListInit: function () { 1545 if (jinyToolLayerInfoFW2._isRecomListEmpty()) { 1546 return; 1547 } 1548 1549 if (this.IsBtnLayer) { 1550 $j(this._recentRecomListId).find(this._middleCoverClass).hover( 1551 function (e) { 1552 //$j(this._recentRecomListId).find(this._btnWrapClass).show(); 1553 $j(this).find(jinyToolLayerInfoFW2._btnWrapClass).show(); 1554 }, 1555 function (e) { 1556 //$j(this._recentRecomListId).find(this._btnWrapClass).hide(); 1557 $j(this).find(jinyToolLayerInfoFW2._btnWrapClass).hide(); 1558 } 1559 ); 1560 } 1561 1562 _nowClickSwiper.update(); 1563 1564 $j(".jinyToolShopLink").attr("href", function () { 1565 var isbn = jinyToolLayerInfoFW2._getDataISBN(this); 1566 return "http://www.aladin.co.kr" + "/shop/wproduct.aspx?ISBN=" + isbn; 1567 }); 1568 1569 $j(".jinyToolAddOrderListBtn").click(function (e) { 1570 if (jinyToolLayerInfoFW2.IsUserValidLogin == false) { jinyToolLayerInfoFW2._loginPopup(); return false; } 1571 var isbn = jinyToolLayerInfoFW2._getDataISBN(this); 1572 jinyToolLayerInfoFW2._execRecomAjax(isbn, 1); 1573 return false; 1574 }); 1575 1576 $j(".jinyToolRecomDeleteBtn").click(function (e) { 1577 if (jinyToolLayerInfoFW2.IsUserValidLogin == false) { jinyToolLayerInfoFW2._loginPopup(); return false; } 1578 var isbn = jinyToolLayerInfoFW2._getDataISBN(this); 1579 jinyToolLayerInfoFW2._execRecomAjax(isbn, 2); 1580 return false; 1581 }); 1582 1583 $j(".jinyToolAddBasketBtn").click(function (e) { 1584 var isbn = jinyToolLayerInfoFW2._getDataISBN(this); 1585 jinyToolLayerInfoFW2._execAddBasketAjax(isbn); 1586 return false; 1587 }); 1588 1589 jinyRecentRecomTab2.init(); 1590 }, 1591 _getDataISBN: function (obj) { 1592 return $j(obj).parents(this._middleCoverClass).attr("data-isbn"); 1593 }, 1594 _loginPopup: function () { 1595 window.open('/login/wlogin_popup.aspx', 'Login', 'width=780,height=500,status=0'); 1596 return; 1597 }, 1598 _getDummy: function () { 1599 return "&__dummy=" + new Date().getTime(); 1600 }, 1601 _getAjaxUrl: function (commandtype, ISBN, fnName) { 1602 var url = "/jiny/wajax.aspx?custkey=" + this.custKey + this._getDummy(); 1603 1604 if (commandtype && commandtype.length > 0) { 1605 url = url + "&commandtype=" + commandtype; 1606 } 1607 1608 if (ISBN && ISBN.length > 0) { 1609 url = url + "&ISBN=" + ISBN; 1610 } 1611 1612 if (fnName && fnName.length > 0) { 1613 url = url + "&fn=" + fnName; 1614 } 1615 return url; 1616 }, 1617 AllListInit: function () { 1618 var recomUrl = jinyToolLayerInfoFW2._getAjaxUrl("RecentRecomItemHtml2", jinyToolLayerInfoFW2.currentISBN, ""); 1619 1620 $j(this._recentRecomListId).load(recomUrl, function () { 1621 jinyToolLayerInfoFW2.recomListInit(); 1622 1623 var recentUrl = jinyToolLayerInfoFW2._getAjaxUrl("RecentItemListHtml2", "", ""); 1624 1625 $j(jinyToolLayerInfoFW2._recentListId).load(recentUrl, function () { 1626 jinyToolLayerInfoFW2.recentListInit(); 1627 }); 1628 }); 1629 }, 1630 recomOnlyListInit: function () { 1631 var recomUrl = jinyToolLayerInfoFW2._getAjaxUrl("RecentRecomItemHtml2", jinyToolLayerInfoFW2.currentISBN, ""); 1632 1633 $j(this._recentRecomListId).load(recomUrl, function () { 1634 jinyToolLayerInfoFW2.recomListInit();
1635 _nowClickSwiper.update(); 1636 }); 1637 } 1638} 1639 1640function PublisherList_Open() { 1641 window.open('/aladdin/PublisherList.aspx','pubShopList','width=780,height=560,status=0'); 1642 return false; 1643} 1644 1645function ShopList_Open() { 1646 window.open('/aladdin/ShopList.aspx', 'pubShopList', 'width=780,height=560,status=0'); 1647 return false; 1648} 1649 1650// aladin Util 1651var AUtil = { 1652 // ë³´ê´í¨ ë´ê¸° 1653 "saveListAdd": function (isbn) { 1654 if (isbn == '') { 1655 return; 1656 } 1657 1658 try { 1659 var goUrl = "/shop/common/wsafebasket_add_popup.aspx?AddSafeBasketAll=" + isbn; 1660 var saveListWin = window.open(goUrl, "SafeBasket", "width=450,height=284"); 1661 } catch (ex) { 1662 1663 } 1664 }, 1665 // oì childì¤, ì²´í¬ë ìíì ISBN리ì¤í¸ ê°ì ¸ì¤ê¸° 1666 "getCheckedISBNList": function (o) { 1667 var checkedList = $j(o).find("input:checked"); 1668 1669 if (checkedList.length == 0) { 1670 alert('ì íë ìíì´ ììµëë¤.'); 1671 return ''; 1672 } 1673 1674 var isbnCol = ''; 1675 1676 checkedList.each(function (index) { 1677 var n = $j(this).attr('name'); 1678 1679 if (n.indexOf('.') > -1) { 1680 var isbn = n.substring(n.indexOf('.') + 1, n.length); 1681 1682 if (isbnCol == '') 1683 isbnCol = isbn; 1684 else 1685 isbnCol += ',' + isbn; 1686 } 1687 }); 1688 return isbnCol; 1689 }, 1690 // oì childì¤, checkbox ì ì²´ì í 1691 "checkAll": function (o) { 1692 var checkboxList = $j(o).find("input:checkbox"); 1693 var checkboxCheckedCount = $j(o).find("input:checked").length; 1694 1695 if (checkboxList.length == checkboxCheckedCount) { 1696 checkboxList.attr("checked", false); 1697 } else { 1698 checkboxList.attr("checked", true); 1699 } 1700 }, 1701 addBasketSimple: function (isbn, succCallback) { 1702 var toUrl = "/shop/BasketAjax.aspx?method=basketaddwithexistcheck&qty=1&isbn=" + isbn; 1703 1704 jQuery.ajax({ 1705 url: toUrl, 1706 contentType: "application/json; charset=utf-8", 1707 cache: false, 1708 dataType: "json", 1709 timeout: 5000, 1710 async: false, 1711 success: function (data) { 1712 var basketResult = $j.parseJSON(data); 1713 succCallback(data); 1714 } 1715 }); 1716 }, 1717 shuffleFromTo: function (f, t) { 1718 var j, x, i, arr = []; 1719 for (i = f; i < t; i++) { 1720 arr.push(i); 1721 } 1722 for (i = arr.length; i; i -= 1) { 1723 j = Math.floor(Math.random() * i); 1724 x = arr[i - 1]; 1725 arr[i - 1] = arr[j]; 1726 arr[j] = x; 1727 } 1728 return arr; 1729 } 1730} 1731 1732function Josa(txt, josa) { 1733 var code = txt.charCodeAt(txt.length - 1) - 44032; 1734 1735 // ì본 ë¬¸êµ¬ê° ììëë ë¹ ë¬¸ìì´ ë°í 1736 if (txt.length == 0) { 1737 return ''; 1738 } 1739 1740 // íê¸ì´ ìëë 1741 if (code < 0 || code > 11171) { 1742 return josa; 1743 } 1744 1745 if (code % 28 == 0) { 1746 return Josa.get(josa, false); 1747 } 1748 else { 1749 return Josa.get(josa, true); 1750 } 1751} 1752 1753Josa.get = function (josa, jong) { 1754 // jong : trueë©´ ë°ì¹¨ìì, falseë©´ ë°ì¹¨ìì 1755 1756 if (josa == 'ì' || josa == '를') return (jong ? 'ì' : '를'); 1757 if (josa == 'ì´' || josa == 'ê°') return (jong ? 'ì´' : 'ê°'); 1758 if (josa == 'ì' || josa == 'ë') return (jong ? 'ì' : 'ë'); 1759 if (josa == 'ì' || josa == 'ê³¼') return (jong ? 'ì' : 'ê³¼'); 1760 1761 // ì ì ìë ì¡°ì¬ 1762 return '**'; 1763} 1764 1765function popupResize(mainElementId, margin) { 1766 var marginRight = 0; 1767 var marginBottom = 0; 1768 1769 if (margin) { 1770 if (margin.right) { marginRight = margin.right; } 1771 if (margin.bottom) { marginBottom = margin.bottom; } 1772 } 1773 1774 var d = document.getElementById(mainElementId); 1775 var borderW = window.outerWidth - window.innerWidth; 1776 var borderH = window.outerHeight - window.innerHeight; 1777 var contentsW = d.offsetWidth; 1778 var contentsH = d.offsetHeight; 1779 var width = contentsW + borderW + marginRight; 1780 var height = contentsH + borderH + marginBottom; 1781 1782 window.resizeTo(width, height); 1783 // alert("" + width + "," + height); 1784} 1785 1786// Item목ë¡ìì, ì¶ì²ë§ë²ì¬ í´í (PC-모ë°ì¼ê³¼ ë¡ì§ ì¼ì¹ íì) 1787var jinyItemTooltip = { 1788 jquery: false, 1789 nickName: '', 1790 jinyItemIdList: false, 1791 tooltipMsg: '', 1792 targetId: '', 1793 isMobile: false, 1794 init: function (jquery, targetId) { 1795 this.jquery = jquery; 1796 this.targetId = targetId; 1797 1798 var ajaxUrl = '/jiny/wajax.aspx?commandtype=SearchResultTooltip'; 1799 1800 this.jquery.ajax({ 1801 //async: false, 1802 dataType: 'json', 1803 type: "Get", 1804 url: ajaxUrl, 1805 cache: false, 1806 timeout: 2000, 1807 success: function (h) { 1808 if (h) { 1809 jinyItemTooltip.nickName = h["C"]; 1810 jinyItemTooltip.jinyItemIdList = h["L"]; 1811 if (jinyItemTooltip.isMobile) { 1812 jinyItemTooltip.tooltipMsg = '<a href="/m/mjiny.aspx?Type=choice"><div class="genie_m_2016_layerwrap_in"> <div class="genie_m_2016_layerwrap_t">ì¶ì²ë§ë²ì¬ê° ì´ ì± ì <font color="#ffea00">' + jinyItemTooltip.nickName + '</font>ëê» ì¶ì²í©ëë¤</div></div><div class="genie_m_2016_arrow"><img src="//image.aladin.co.kr/img/common/drop_02_m.png" alt="" width="12px"></div><div style="clear:both;"></div></a>'; 1813 } else { 1814 jinyItemTooltip.tooltipMsg = '<a href="/jiny/wmain.aspx"><div class="genie_2016_layerwrap"><div class="genie_2016_layerwrap_in"><div class="genie_2016_layerwrap_t">ì¶ì²ë§ë²ì¬ê° ì´ ì± ì <font color="#ffea00">' + jinyItemTooltip.nickName + '</font>ëê» ì¶ì²í©ëë¤</div></div><div class="genie_2016_layerwrap_arrow"></div> </div><div style=" clear:both"></div></a>' 1815 } 1816 jinyItemTooltip.bind(); 1817 } 1818 }, 1819 error: function (xhr, ajaxOptions, thrownError) { 1820 return; 1821 } 1822 }); 1823 }, 1824 bind: function () { 1825 if (!this.jinyItemIdList || this.jinyItemIdList.length <= 0) { 1826 return; 1827 } 1828 1829 var id = this.targetId; 1830 var $ = this.jquery; 1831 1832 $(id).each(function (i, o) { 1833 var $o = $(o); 1834 if ($o.attr("jinyCheck") == "true") { 1835 return; 1836 } 1837 $o.attr("jinyCheck", true); 1838 1839 var itemId = parseInt($o.attr("itemId")); 1840 if (itemId) { 1841 if (jinyItemTooltip.jinyItemIdList.indexOf(itemId) >= 0) { 1842 $o.prepend(jinyItemTooltip.tooltipMsg); 1843 var $cover = $o.find(".i_cover"); 1844 $cover.addClass("genie_imgBorder"); 1845 if (jinyItemTooltip.isMobile) { 1846 $cover.closest("div").css("width", "106px"); 1847 // console.log($o.closest("div")) 1848 }; 1849 } 1850 } 1851 }); 1852 } 1853}; 1854 1855function getJQuery() { 1856 if (window.$ && window.$.fn && window.$.fn.jquery) { 1857 return $; 1858 } 1859 if (window.$j && window.$j.fn && window.$j.fn.jquery) { 1860 return $j; 1861 } 1862 return {}; 1863} 1864 1865// Dateê´ë ¨ Util 1866var _dtUtil = { 1867 // íì¬ ìê° 1868 getNow: function () { 1869 return new Date(); 1870 }, 1871 // í¹ì ìê° (month ê´ë ¨ 모í¸í¨ í´ê²°) 1872 getDate: function (year, month, date) { 1873 return new Date( 1874 parseInt(year, 10), 1875 parseInt(month, 10) - 1, // ì 1876 parseInt(date, 10) 1877 ); 1878 }, 1879 // í¹ì elementë¡ë¶í° ìê°ì êµ¬í¨ 1880 getDateFromElement: function ($, yearId, monthId, dateId) { 1881 return this.getDate( 1882 $(yearId).val(), 1883 $(monthId).val(), 1884 $(dateId).val() 1885 ); 1886 }, 1887 // ë ì§ê° ê°ìì§ íë¨íë¤ (ìê°ì íë¨íì§ ìì) 1888 equalDate: function (d1, d2) { 1889 return d1.getFullYear() == d2.getFullYear() && 1890 d1.getMonth() == d2.getMonth() && 1891 d1.getDate() == d2.getDate(); 1892 }, 1893 // ë ì§ì ìê°ì´ ê°ìì§ íë¨íë¤ (ì´ê¹ì§ë§) 1894 equalDateTime: function (d1, d2) { 1895 return this.equalDate(d1, d2) && 1896 d1.getHours() == d2.getHours() && 1897 d1.getMinutes() == d2.getMinutes() && 1898 d1.getSeconds() == d2.getSeconds(); 1899 }, 1900 // ìê°ì í¹ì í¬ë§·ì 문ìì´ë¡ 1901 getString: function (dt, formatType) { 1902 if (formatType == 1) { 1903 var yyyy = dt.getFullYear(); 1904 var m = (dt.getMonth() + 1); 1905 var d = dt.getDate(); 1906 1907 return yyyy + "ë " + m + "ì " + d + "ì¼"; 1908 } else if (formatType == 2) { 1909 var yyyy = dt.getFullYear(); 1910 var m = (dt.getMonth() + 1); 1911 var d = dt.getDate(); 1912 var mm = m.toString(); 1913 var dd = d.toString(); 1914 1915 if (m < 10) { mm = "0" + m; } 1916 if (d < 10) { dd = "0" + d; } 1917
1918 return yyyy + "ë " + mm + "ì " + dd + "ì¼"; 1919 } 1920 return d.toString(); 1921 } 1922} 1923 1924var checkBoxUtil = { 1925 $ : window.$, 1926 bindAllCheck: function (allCheckboxIdSelector, eachCheckboxClassSelector) { 1927 var $allCheckbox = checkBoxUtil.$(allCheckboxIdSelector); 1928 var $eachCheckboxList = checkBoxUtil.$(eachCheckboxClassSelector); 1929 var allCheckboxCount = $eachCheckboxList.length; 1930 1931 $allCheckbox.click(function (e) { 1932 if (!$eachCheckboxList || $eachCheckboxList.length <= 0) { 1933 return true; 1934 } 1935 1936 var isAllCheck = checkBoxUtil.$(this).is(":checked"); 1937 var filterSelector = (isAllCheck ? ":not(:checked)" : ":checked"); 1938 1939 $eachCheckboxList 1940 .filter(filterSelector) 1941 .each(function (i, o) { o.checked = isAllCheck; }); 1942 1943 return true; 1944 }); 1945 1946 $eachCheckboxList.click(function (e) { 1947 var checkedClaimIdListCount = $eachCheckboxList.filter(":checked").length; 1948 1949 if (checkedClaimIdListCount == allCheckboxCount) { 1950 $allCheckbox.attr("checked", "checked"); 1951 } else { 1952 if ($allCheckbox.attr("checked") == true || $allCheckbox.attr("checked") == "checked" ) { 1953 $allCheckbox.removeAttr("checked"); 1954 } 1955 } 1956 1957 return true; 1958 }); 1959 }, 1960 getCheckedValueList: function (eachCheckboxClassSelector) { 1961 var valueList = []; 1962 1963 checkBoxUtil.$(eachCheckboxClassSelector) 1964 .filter(":checked") 1965 .each(function (index, item) { 1966 valueList.push(item.value); 1967 }); 1968 return valueList; 1969 }, 1970 getCheckedValueListString: function (eachCheckboxClassSelector) { 1971 var valueList = checkBoxUtil.getCheckedValueList(eachCheckboxClassSelector); 1972 return valueList.join(","); 1973 } 1974}; 1975 1976var alanJ = { 1977 _bindGA: function(eventFunction){ 1978 $j = getJQuery(); 1979 1980 $j(document).ready(function () { 1981 if (window.gtag) { 1982 try { 1983 eventFunction(); 1984 } catch (ex) { } 1985 } 1986 }); 1987 }, 1988 viewEventPage: function(eventId, eventName) { 1989 $j = getJQuery(); 1990 1991 $j(document).ready(function () { 1992 if (window.gtag) { 1993 try { 1994 // console.log("view_promotion"); 1995 gtag('event', 'select_content', { 1996 "promotions": [{ id: eventId, name: eventName }] 1997 }); 1998 } catch (ex) { } 1999 } 2000 }); 2001 }, 2002 checkoutProgress: function (eventLabel, items) { 2003 $j = getJQuery(); 2004 2005 $j(document).ready(function () { 2006 if (window.gtag) { 2007 try { 2008 // console.log("checkout_progress"); 2009 gtag('event', 'checkout_progress', { 2010 "event_label": eventLabel, 2011 "items": items 2012 }); 2013 } catch (ex) { } 2014 } 2015 }); 2016 } 2017}; 2018 2019function getModalQueue() { 2020 if (typeof (window.modalQueue) === "undefined") { 2021 window.modalQueue = (function (window, document, $) { 2022 var _que = {}; 2023 var _queIndex = []; 2024 2025 var _checkValid = function () { 2026 // script.contains("/js/jquery.simplemodal.js"); 2027 // css.contains("/js/css/jquery.simplemodal.basic.css"); 2028 // html.contains("#scmModalLayer"); 2029 return true; 2030 }; 2031 2032 var push = function (index, selector, modalOption) { 2033 _que[index] = { 2034 modalObject: selector, 2035 modalOption: modalOption 2036 }; 2037 _queIndex.push(index); 2038 }; 2039 2040 var isEmpty = function () { 2041 return _queIndex.length == 0; 2042 }; 2043 2044 var getMaxIndex = function () { 2045 return isEmpty() ? -1 : Math.max.apply(null, _queIndex); 2046 }; 2047 2048 var getMaxIndexModal = function () { 2049 return _que[getMaxIndex()]; 2050 }; 2051 2052 var isAlreadyShow = function () { 2053 return $.modal.impl.d.data ? true : false;
2054 } 2055 2056 var show = function () { 2057 if (isEmpty()) { 2058 return false; 2059 } 2060 2061 if (isAlreadyShow()) { 2062 console.log("Warn: ë¤ë¥¸Modal"); 2063 return false; 2064 } 2065 2066 var maxIndexModal = getMaxIndexModal(); 2067 var $obj = $(maxIndexModal.modalObject); 2068 var opt = maxIndexModal.modalOption; 2069 2070 return $obj.modal(opt); 2071 }; 2072 2073 return { 2074 _checkValid: _checkValid, 2075 push: push, 2076 getMaxIndex: getMaxIndex, 2077 getMaxIndexModal: getMaxIndexModal, 2078 show: show, 2079 __VERSION: "1.0" 2080 }; 2081 })(window, document, $j); 2082 } 2083 return window.modalQueue; 2084} 2085 2086function setCookie_refereURL() { 2087 var domain = ".aladin.co.kr"; 2088 var endDate = new Date(); 2089 endDate.setDate(endDate.getDate() + 1); 2090 document.cookie = "refererURL=" + document.URL + ";path=/; domain=" + domain + ";expires=" + endDate.toGMTString() + ";" 2091} 2092 2093setCookie_refereURL();
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.