PageSourceSearch

https://www.aladin.co.kr/js/common.js

js aladin.co.kr collected 2026-09-24 08:26:49 UTC 67,839 bytes, 2,093 lines download raw bytes

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+"&amp;height="+height+"&amp;type="+xType+"&amp;src="+urlEn(url)+"\"></s"+"cript>");    
1006    // document.write("<s"+"cript type=\"text/javascript\" src=\"/js/wxobject.aspx?width=425&amp;height=355&amp;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+"&amp;height="+height+"&amp;type="+xType+"&amp;src="+urlEn(url)+"&amp;autoplay=" + autoplay + " \"></s"+"cript>");    
1017    // document.write("<s"+"cript type=\"text/javascript\" src=\"/js/wxobject.aspx?width=425&amp;height=355&amp;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.