PageSourceSearch

https://www.yes24.com/Javascript/Common.js?v=20260624

js yes24.com collected 2026-09-24 08:36:40 UTC 39,792 bytes, 1,226 lines download raw bytes

1
2// ****************************************************************************************************
3//  기능   : layered 팝업을 위한 변수 선언
4// ****************************************************************************************************
5var yesLayerPopId = "";
6var yesLayerPopObjId = "";
7var yesLayerClientW = "";
8
9// ****************************************************************************************************
10//  함수명 : fnRePosYesLayer
11//  기능   : window resize event 발생시 tooltop resize해주는 함수
12// ****************************************************************************************************
13function fnRePosYesLayer()
14{
15    if (yesLayerPopId != "")
16    {
17        fnShowYesLayerPop(yesLayerPopId, yesLayerPopObjId)
18    }
19}
20
21// ****************************************************************************************************
22//  함수명 : fnOffsetPosY
23//  기능   : 툴팁의 Y좌표값을 리턴
24// ****************************************************************************************************
25function fnOffsetPosY(obj)
26{
27    var currentY = 0;
28    if (obj.offsetParent)
29    {
30        currentY = obj.offsetTop;
31        while (obj = obj.offsetParent)
32        {
33            currentY += obj.offsetTop;
34        }
35    }
36    return currentY;
37}
38
39// ****************************************************************************************************
40//  함수명 : fnOffsetPosX
41//  기능   : 툴팁의 X좌표값을 리턴
42// ****************************************************************************************************
43function fnOffsetPosX(obj)
44{
45    var currentX = 0;
46    var objW = Math.round(obj.offsetWidth / 2);
47    if (obj.offsetParent)
48    {
49        currentX = obj.offsetLeft;
50
51        while (obj = obj.offsetParent)
52        {
53            currentX += obj.offsetLeft;
54        }
55    }
56    currentX = currentX + objW - 3;
57    return currentX;
58}
59
60// ****************************************************************************************************
61//  함수명 : fnShowYesLayerPop
62//  기능   : 툴팁 오류  수정된 layered popup
63// ****************************************************************************************************
64function fnShowYesLayerPop(popupid, obj, offsetW, offsetH)
65{
66	if(offsetW == undefined) {
67		offsetW = 0;
68	}
69
70	if(offsetH == undefined) {
71		offsetH = 0;
72	}
73
74    if (yesLayerPopId != "")
75    {
76        fnPopupLayerHide(yesLayerPopId);
77    }
78
79    yesLayerPopId = popupid;
80    yesLayerPopObjId = obj;
81    yesLayerClientW = $(document).width();
82    var posT = fnOffsetPosY(obj);
83    var posX = fnOffsetPosX(obj);
84    var popW = $("#" + popupid).width();
85    var topPosition = posT + 25;
86    var lftPosition = ((posX - (popW / 2)) | 0);
87    var limitMaxX = ((960 + ((yesLayerClientW - 980) / 2)) | 0);
88    var limitMinX = (((yesLayerClientW - 960) / 2) | 0);
89    var posMove;
90
91    if (lftPosition + popW >= limitMaxX)
92    {
93        posMove = ((lftPosition + popW) - limitMaxX);
94        lftPosition -= posMove;
95        $("#" + popupid).find('.cock').each(function (i)
96        {
97            $(this).css("margin-left", +posMove)
98        });
99    } else if (lftPosition < limitMinX)
100    {
101        posMove = limitMinX - lftPosition;
102        lftPosition += posMove;
103        $("#" + popupid).find('.cock').each(function (i)
104        {
105            $(this).css("margin-left", -posMove)
106        });
107    } else
108    {
109        $("#" + popupid).find('.cock').each(function (i)
110        {
111            $(this).css("margin-left", "0")
112        });
113    }
114
115	topPosition += offsetH;
116	lftPosition += offsetW;
117
118    $("#" + popupid).css({
119        "display": "",
120        "position": "absolute",
121        "left": lftPosition,
122        "top": topPosition,
123        "z-index": "1000000"
124    });
125}
126
127function fnShowYesLayerPopFrm(frm, obj, w, h, offsetW, offsetH, scrollOption) {
128	if(offsetW == undefined) {
129		offsetW = 0;
130	}
131
132	if(offsetH == undefined) {
133		offsetH = 0;
134	}
135
136	if(scrollOption == undefined) {
137		scrollOption = false;
138	}
139
140    yesDiv = "";
141    yesDiv += '<div id="divYesPopIFrm" style="position:absolute;">';
142    yesDiv += '<div style="position:relative;background-color:#FFF;">';
143    yesDiv += '<div class="cockFrm" style="position:absolute;
143left:50%;top:-4px;width:8px;height:6px;font-size:1px;line-height:1px;background:url(https://secimage.yes24.com/sysimage/orderN/icon.gif) center -670px no-repeat;"></div>';
144    yesDiv += '<iframe id="ifrmYesLayerPop" style="border:solid 2px #3a96d7;" frameborder="0" marginwidth="0" marginheight="0" scrolling="';
145    if (scrollOption) {
146        yesDiv += 'auto';
147    } else {
148        yesDiv += '';
149    }
150    yesDiv += '"></iframe>';
151    yesDiv += '</div></div>';
152
153    if (yesLayerPopId != "") {
154        fnPopupLayerHide(yesLayerPopId);
155    }
156
157    if ($("#divYesPopIFrm").length == 0) {
158        $('body').append(yesDiv);
159    }
160
161    yesLayerPopId = "divYesPopIFrm";
162    yesLayerPopObjId = obj;
163
164    yesLayerClientW = $(document).width();
165
166    var posT = fnOffsetPosY(obj);
167    var posX = fnOffsetPosX(obj);
168    var popW = w;
169    var topPosition = posT + 25;
170    var lftPosition = posX - (popW / 2);
171    var limitMaxX = (960 + ((yesLayerClientW - 980) / 2));
172    var limitMinX = (yesLayerClientW - 960) / 2;
173    var posMove;
174
175    if (lftPosition + popW >= limitMaxX) {
176        posMove = ((lftPosition + popW) - limitMaxX);
177        lftPosition -= posMove;
178        $("#divYesPopIFrm").find('.cockFrm').each(function (i) {
179            $(this).css("margin-left", +posMove)
180        });
181    } else if (lftPosition < limitMinX) {
182        posMove = limitMinX - lftPosition;
183        lftPosition += posMove;
184        $("#divYesPopIFrm").find('.cockFrm').each(function (i) {
185            $(this).css("margin-left", -posMove)
186        });
187    } else {
188        $("#divYesPopIFrm").find('.cockFrm').each(function (i) {
189            $(this).css("margin-left", "0")
190        });
191    }
192
193	topPosition += offsetH;
194	lftPosition += offsetW;
195
196    $("#divYesPopIFrm").css({
197        "display": "",
198        "position": "absolute",
199        "left": lftPosition,
200        "top": topPosition,
201        "z-index": "1000000",
202        "width": w,
203        "height": h
204    });
205
206    $("#ifrmYesLayerPop").attr("src", frm);
207
208    $("#ifrmYesLayerPop").css({
209        "width": "100%",
210        "height": h
211    });
212}
213
214function fnShowYesLayerPopLoad(tp, tar, obj, w , offsetW, offsetH)
215{
216	if (offsetW == undefined)
217    {
218        offsetW = 0;
219    }
220    
221    if (offsetH == undefined)
222    {
223        offsetH = 0;
224    }
225    
226    if (yesLayerPopId != "")
227    {
228        fnPopupLayerHide(yesLayerPopId);
229    }
230        
231    yesDiv = "";
232	yesDiv += '<div id="divYesPopLoad" style="position:absolute;"><div id="loadHtmlYesLayerPop">d';
233	yesDiv += '</div></div>';
234
235	if(yesLayerPopId != "")
236	{
237		fnPopupLayerHide(yesLayerPopId);
238	}
239
240	if($("#divYesPopLoad").length == 0)
241	{
242		$('body').append(yesDiv);
243	}
244
245	yesLayerPopId = "divYesPopLoad";
246	yesLayerPopObjId = obj;
247
248	yesLayerClientW = $(document).width();
249
250	var posT = fnOffsetPosY(obj);
251	var posX = fnOffsetPosX(obj);
252	var popW = w;
253	var topPosition = posT + 25;
254	var lftPosition = ((posX - (popW / 2)) | 0);
255	var limitMaxX = (((960 + ((yesLayerClientW - 980)/2))) | 0);
256	var limitMinX = (((yesLayerClientW - 960)/2) | 0);
257	var posMove;
258
259	switch(tp)
260	{
261		case "get":
262			$("#loadHtmlYesLayerPop").load(tar, function(){
263				if(lftPosition + popW >= limitMaxX)
264				{
265					posMove = ((lftPosition + popW) - limitMaxX);
266					lftPosition -= posMove;
267					$("#divYesPopLoad").find('.cock').each(function(i){
268						$(this).css("margin-left",+posMove)
269					});
270				}else if(lftPosition < limitMinX){
271					posMove = limitMinX - lftPosition;
272					lftPosition += posMove;
273					$("#divYesPopLoad").find('.cock').each(function(i){
274						$(this).css("margin-left",-posMove)
275					});
276				}else{
277					$("#divYesPopLoad").find('.cock').each(function(i){
278						$(this).css("margin-left","0")
279					});
280				}
281
282                topPosition += offsetH;
283                lftPosition += offsetW;
284
285				$("#divYesPopLoad").css({
286					"display": "",
287					"position": "absolute",
288					"left": lftPosition,
289					"top": topPosition,
290					"z-index":"1000000",
291					"width":w
292				});
293			});
294		break;
295	}
296}
297
298
299// ****************************************************************************************************
300//  함수명 : fnLoadChkThumb
301//  기능   : 이미지 로드시 썸네일 이미지 출력하기 위한 함수(카트와 사은품선택화면 적용)
302// ****************************************************************************************************
303
304function fnLoadChkThumb(obj)
305{
306    var objW = Math.floor(obj.width);
307    var objH = Math.floor(obj.height);
308    if (objW > 140)
309    {
310        var tarH = Math.floor(14000 / objW)
311        obj.height = tarH;
312        obj.width = 140;
313    }
314}
315
316
317// ****************************************************************************************************
318//  함수명 : fnIsNaturalNumber
319//  기능   : 값의 자연수 여부를 확인 한다.
320// ****************************************************************************************************
321function fnIsNaturalNumber(number)
322{
323    for (var i = 0; i < number.length; i++)
324    {
325        if (number.charCodeAt(i) < 48 || number.charCodeAt(i) > 57)
326        {
327            return false;
328        }
329    }
330
331    return true;
332}
333
334// ****************************************************************************************************
335//  함수명 : fnCheckedChangeChild
336//  기능   : Header CheckBox의 상태 값 변화에 따라 하위 모든 CheckBox의 상태 값을 바꾼다
337// ****************************************************************************************************
338function fnCheckedChangeChild(checkBoxName, checkBoxHeaderId)
339{
340    var checked = false;
341    if ($("#" + checkBoxHeaderId).attr("checked") == "checked")
342    {
343        checked = true;
344    }
345    $('input:checkbox[name="' + checkBoxName + '"]').each(
346        function (index)
347        {
348            if ($(this).attr("disabled") != "disabled")
349            {
350                $(this).attr("checked", checked);
351            }
352        }
353    );
354}
355
356// ****************************************************************************************************
357//  함수명 : fnCheckedChangeHeader
358//  기능   : 하위 CheckBox의 상태 값 변화에 따라 Header CheckBox의 상태 값을 바꾼다
359// ****************************************************************************************************
360function fnCheckedChangeHeader(checkBoxName, checkBoxHeaderId)
361{
362    var $ckeckboxes = $('input:checkbox[name="' + checkBoxName + '"]');
363    var checked = false;
364    if ($ckeckboxes.length == $ckeckboxes.filter(':checked').length)
365    {
366        checked = true;
367    }
368    $("#" + checkBoxHeaderId).attr("checked", checked);
369}
370
371// ****************************************************************************************************
372//  함수명 : fnAjaxLoaderLayerShow
373//  기능   : AJAX Loding Image 보이기
374// ****************************************************************************************************
375function fnAjaxLoaderLayerShow(divAjaxLoaderId, isCenterPosition, mouse, myEvent, isMain)
376{
377    if (myEvent == undefined)
378    {
379        myEvent = window.event;
380    }
381
382    $("#" + divAjaxLoaderId).css("display", "");
383    try
384    {
385        if (isMain == undefined)
386        {
387            $("#" + divAjaxLoaderId).html("<img src='/Resource/Images/ajax-loader.gif' align='center' alt='' />");
388            $("#" + divAjaxLoaderId).css("position", "absolute");
389        }
390        else
391        {
392            $("#" + divAjaxLoaderId).html("<img src='https://image.yes24.com/sysimage/orderN/pay_loading.gif' alt='' />");
393            $("#" + divAjaxLoaderId).css("position", "relative");
394            $("#" + divAjaxLoaderId).css("left", 0);
395        }
396
397        $("#" + divAjaxLoaderId).css("z-index", "100000");
398        if (isMain == undefined)
399        {
400            $("#" + divAjaxLoaderId).css("left", document.body.clientWidth / 2);
401            if (isCenterPosition == true)
402            {
403                $("#" + divAjaxLoaderId).css("top", document.body.clientHeight / 2);
404            }
405            else
406            {
407                $("#" + divAjaxLoaderId).css("top", parseInt(document.body.scrollTop) + parseInt(myEvent.clientY) + 10);
408            }
409            if (mouse == true)
410            {
411                $("#" + divAjaxLoaderId).css("top", parseInt(document.body.scrollTop) + myEvent.y);
412                $("#" + divAjaxLoaderId).css("left", parseInt(document.body.scrollLeft) + myEvent.x);
413                var pos = abspos(myEvent);
414                $("#" + divAjaxLoaderId).css("left", pos.x + "px");
415                $("#" + divAjaxLoaderId).css("top", (pos.y + 10) + "px");
416            }
417        }
418    }
419    catch (ex)
420    { }
421}
422
423
424function abspos(e)
425{
426    this.x = e.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
427    this.y = e.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
428    return this;
429}
430// ****************************************************************************************************
431//  함수명 : fnAjaxLoaderLayerHide
432//  기능   : AJAX Loding Image 숨기기
433// ****************************************************************************************************
434function fnAjaxLoaderLayerHide(divAjaxLoaderId)
435{
436    $("#" + divAjaxLoaderId).empty();
437    $("#" + divAjaxLoaderId).css("display", "none");
438}
439
440// ****************************************************************************************************
441//  함수명 : fnPopupLayerShow
442//  기능   : Popup 성격의 Layer 보이기
443// ****************************************************************************************************
444function fnPopupLayerShow(layerName, isCenterPositionX, myEvent)
445{
446    if (myEvent == undefined)
447    {
448        myEvent = window.event;
449    }
450
451    $("#" + layerName).css("display", "");
452    var width = $("#" + layerName).css("width").replace("px", "");
453    var height = $("#" + layerName).css("height").replace("px", "");
454
455    if (isCenterPositionX == true)
456    {
457        $("#" + layerName).css("left", ((document.body.clientWidth / 2) - (parseInt(width) / 2)) + 'px');
458        $("#" + layerName).css("top", (parseInt($(window).scrollTop()) + parseInt(myEvent.clientY)) + 'px');
459    }
460    else
461    {
462        $("#" + layerName).css("left", ((parseInt(myEvent.clientX) - (parseInt(width) / 2)) | 0) + 'px');
463        $("#" + layerName).css("top", ((parseInt($(window).scrollTop()) + parseInt(myEvent.clientY) + 10) | 0) + 'px');
464
465        if (layerName == "divGiftPackInfo")
466        {
467            $("#" + layerName).css("left", ((parseInt(myEvent.clientX) - (parseInt(width) / 2) - 230) | 0) + 'px');
468        }
469    }
470}
471
472// ****************************************************************************************************
473//  함수명 : fnPopupLayerShowPosition
474//  기능   : Popup 성격의 Layer 보이기 - 위치 지정
475// ****************************************************************************************************
476function fnPopupLayerShowPosition(layerName, left, top, myEvent)
477{
478    if (myEvent == undefined)
479    {
480        myEvent = window.event;
481    }
482
483    $("#" + layerName).css("display", "");
484    var width = $("#" + layerName).css("width").replace("px", "");
485    var height = $("#" + layerName).css("height").replace("px", "");
486    $("#" + layerName).css("left", parseInt(myEvent.clientX) - (parseInt(width) / 2) + parseInt(left));
487    $("#" + layerName).css("top", parseInt(document.body.scrollTop) + parseInt(myEvent.clientY) + parseInt(top));
488}
489
490// ****************************************************************************************************
491//  함수명 : fnPopupLayerShowFixedPosition
492//  기능   : Popup 성격의 Layer 보이기 - 위치 불변 지정  / milestoneName 기준이되는 id
493// ****************************************************************************************************
494function fnPopupLayerShowFixedPosition(milestoneName, layerName)
495{
496    var mHeight = parseInt($("#" + milestoneName).css("height").replace("px", ""));
497    var mWidth = parseInt($("#" + milestoneName).css("width").replace("px", ""));
498
499    var top = $("#" + milestoneName).offset().top + mHeight + 5;
500    var left = $("#" + milestoneName).offset().left + ((mWidth / 2) | 0);
501
502    $("#" + layerName).css("position", "absolute");
503    $("#" + layerName).css("display", "");
504
505    var width = parseInt($("#" + layerName).css("width").replace("px", "")) / 2;
506    $("#" + layerName).offset({ top: top, left: left - width });
507}
508
509// ****************************************************************************************************
510//  함수명 : fnPopupLayerHide
511//  기능   : Popup 성격의 Layer 숨기기
512// ****************************************************************************************************
513function fnPopupLayerHide(layerName)
514{
515    $("#" + layerName).css("display", "none");
516}
517
518// ****************************************************************************************************
519//  함수명 : fnWindowOpen
520//  기능   : Popup 성격의 Layer 보이기
521// ****************************************************************************************************
522function fnWindowOpen(url, popupName, width, height, isCenterPosition, left, top)
523{
524    if (isCenterPosition == true)
525    {
526        left = (((document.body.clientWidth / 2) - (width / 2)) | 0);
527        top = (((document.body.clientHeight / 2) - (height / 2)) | 0);
528    }
529    var features = "width=" + width +
530                    ",height=" + height +
531                    ",left=" + left +
532                    ",top=" + top +
533                    ",toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,status=no";
534
535    return window.open(url, popupName, features);
536}
537
538// ****************************************************************************************************
539//  함수명 : fnWindowOpenFeatures
540//  기능   : Popup 성격의 Layer 보이기
541// ****************************************************************************************************
542function fnWindowOpenFeatures(url, popupName, width, height, isCenterPosition, left, top, etcFeatures)
543{
544    if (isCenterPosition == true)
545    {
546        left = (document.body.clientWidth / 2) - (width / 2);
547        top = (document.body.clientHeight / 2) - (height / 2);
548    }
549    var features = "width=" + width +
550                    ",height=" + height +
551                    ",left=" + left +
552                    ",top=" + top + "," +
553                    etcFeatures;
554    return window.open(url, popupName, features);
555}
556
557// ****************************************************************************************************
558//  함수명 : fnReplaceAll
559//  기능   : 문자열에서 지정한 문자열을 특정 문자열로 치환
560// ****************************************************************************************************
561function fnReplaceAll(value, character, replaceCharacter)
562{
563    if (value == null)
564    {
565        return value;
566    }
567
568    value = value.replace(character, replaceCharacter);
569
570    if (value.indexOf(character) > -1)      // 바꿀 문자가 존재하면 재귀 호출
571    {
572        return fnReplaceAll(value, character, replaceCharacter);
573    }
574    else
575    {
576        return value;
577    }
578}
579
580// ****************************************************************************************************
581//  함수명 : fnNumberFomatTextbox
582//  기능   : Input Control에서 1000단위 구분자(,) 제거
583// ****************************************************************************************************
584function fnNumberFomatTextbox(textBox)
585{
586    $(textBox).attr("value", fnReplaceAll($(textBox).attr("value"), ",", ""));
587    $(textBox).select();
588}
589
590// ****************************************************************************************************
591//  함수명 : fnNumberFomat
592//  기능   : 문자열에서 1000단위 구분자(,) 제거
593// ****************************************************************************************************
594function fnNumberFomat(number)
595{
596    return fnReplaceAll(number, ",", "");
597}
598
599function is_number(x)
600{
601    var reg = /^\d+$/;
602
603    return reg.test(x);
604}
605
606// ****************************************************************************************************
607//  함수명 : fnNumberFomat
608//  기능   : 문자열에서 1000단위 구분자(,) 제거
609// ****************************************************************************************************
610function fnNumberFomatObject(obj)
611{
612    var inputVal = $(obj).attr("value");
613
614    inputVal = fnReplaceAll(inputVal, ",", "");
615
616    if (!is_number(inputVal))
617    {
618        $(obj).attr("value", "");
619    }
620
621    $(obj).attr("value", ($(obj).attr("value") == "" ? "0" : $(obj).attr("value")));
622
623    return fnReplaceAll($(obj).attr("value"), ",", "");
624}
625
626// ****************************************************************************************************
627//  함수명 : fnCurrencyFomat
628//  기능   : 문자열에 1000단위 구분자(,)를 설정
629// ****************************************************************************************************
630function fnCurrencyFomat(number)
631{
632    if (number.toString() == "")
633        return number;
634
635    if (isNaN(number))
636        return number;
637
638    var positiveNumberPart = "";
639    var lastDotIndex = number.toString().lastIndexOf(".");
640    if (lastDotIndex > -1)
641    {
642        positiveNumberPart = number.toString().substring(0, lastDotIndex);
643    }
644    else
645    {
646        positiveNumberPart = parseInt(number, 10).toString();
647    }
648
649    var value = "";
650    var temp = "";
651    for (var i = 0; i < positiveNumberPart.length; i++)
652    {
653        temp = positiveNumberPart.length - (i + 1);
654        if (i % 3 == 0 && i != 0)
655            value = "," + value;
656
657        value = positiveNumberPart.charAt(temp) + value
658    }
659
660    return value;
661}
662
663// ****************************************************************************************************
664//  함수명 : fnCurrencyFomatTextbox
665//  기능   : Input control에 1000단위 구분자(,)를 설정
666// ****************************************************************************************************
667function fnCurrencyFomatTextbox(textBox)
668{
669    var number = $(textBox).attr("value");
670    $(textBox).attr("value", fnCurrencyFomat(number));
671}
672
673// ****************************************************************************************************
674//  함수명 : fnTextBoxNumericUp
675//  기능   : Input control의 값을 1 증가
676// ****************************************************************************************************
677function fnTextBoxNumericUp(textBoxControllId, maxValue)
678{
679    var isValueChanged = false;
680
681    if (maxValue == 0)
682    {
683        maxValue = 9999;
684    }
685    var number = fnNumberFomat($("#" + textBoxControllId).attr("value"));
686    if (number < 0)
687    {
688        number = 0;
689    }
690    if (parseInt(number) + 1 > maxValue)
691    {
692        number = maxValue;
693    }
694    else
695    {
696        number = parseInt(number) + 1;
697        isValueChanged = true;
698    }
699    $("#" + textBoxControllId).attr("value", fnCurrencyFomat(number));
700
701    return isValueChanged;
702}
703
704// ****************************************************************************************************
705//  함수명 : fnTextBoxNumericDown
706//  기능   : Input control의 값을 1 감소
707// ****************************************************************************************************
708function fnTextBoxNumericDown(textBoxControllId)
709{
710    var isValueChanged = false;
711
712    var number = fnNumberFomat($("#" + textBoxControllId).attr("value"));
713    if (number < 2)
714    {
715        number = 1;
716    }
717    else
718    {
719        number = parseInt(number) - 1;
720        isValueChanged = true;
721    }
722    $("#" + textBoxControllId).attr("value", fnCurrencyFomat(number));
723
724    return isValueChanged;
725}
726
727// ****************************************************************************************************
728//  함수명 : fnInputValueCheckAscii1
729//  기능   : 문자열이 허용 Ascii Code 범위 인지 확인(숫자, 영문 대소문자, [ ], [.], [,], ['], ["], [-], [/]
730// ****************************************************************************************************
731function fnInputValueCheckAscii1(address)
732{
733    for (var i = 0; i < address.length; i++)
734    {
735        if ((address.charAt(i) < "0" || address.charAt(i) > "9") &&
736            (address.charAt(i) < "A" || address.charAt(i) > "Z") &&
737            (address.charAt(i) < "a" || address.charAt(i) > "z") &&
738            address.charAt(i) != " " &&
739            address.charAt(i) != "." &&
740            address.charAt(i) != "," &&
741            address.charAt(i) != "'" &&
742            address.charAt(i) != '"' &&
743            address.charAt(i) != "-" &&
744            address.charAt(i) != "/")
745        {
746            return false;
747        }
748    }
749    return true;
750}
751
752// ****************************************************************************************************
753//  함수명 : fnCalculationLeapYear
754//  기능   : 2월의 말일을 계산
755// ****************************************************************************************************
756function fnCalculationLeapYear(year)
757{
758    var maxDayInMonth = 28;
759    if (year % 4 == 0)
760    {
761        if (year % 100 == 0)
762        {
763            if (year % 400 == 0)
764            {
765                maxDayInMonth = 29;
766            }
767        }
768        else
769        {
770            maxDayInMonth = 29;
771        }
772    }
773
774    return maxDayInMonth;
775}
776
777// ****************************************************************************************************
778//  함수명 : fnLoadChkThumb
779//  기능   : Image의 Size를 특정 넓이 기준으로 재 조정
780// ****************************************************************************************************
781function fnLoadChkThumb(obj)
782{
783    var objWidth = Math.floor(obj.width);
784    var objHeight = Math.floor(obj.height);
785    var ratio = parseFloat(100) / parseFloat(objHeight);
786
787    obj.height = Math.floor(parseFloat(objHeight) * parseFloat(ratio));
788    obj.width = Math.floor(parseFloat(objWidth) * parseFloat(ratio));
789}
790
791// ****************************************************************************************************
792//  함수명 : fnMoveFocus
793//  기능   : 지정한 Control로 Focus 이동
794// ****************************************************************************************************
795function fnMoveFocus(currentControl, nextControlName, size)
796{
797    if (currentControl.value.length == size)
798    {
799        if (document.getElementById(nextControlName) != undefined)
800        {
801            document.getElementById(nextControlName).focus();
802            document.getElementById(nextControlName).select();
803        }
804    }
805}
806
807// ****************************************************************************************************
808//  함수명 : fnMoveFocusSelToText
809//  기능   : 지정한 Control로 Focus 이동
810// ****************************************************************************************************
811function fnMoveFocusSelToText(currentControl, nextControlName)
812{
813    if (document.getElementById(nextControlName) != undefined)
814    {
815        document.getElementById(nextControlName).focus();
816        document.getElementById(nextControlName).select();
817    }
818}
819
820// ****************************************************************************************************
821//  함수명 : fnPopupLayerShowGrdGoodsInfoCommon
822//  기능   : 사은품 정보 Html 영역의 Interface를 호출
823// ****************************************************************************************************
824function fnPopupLayerShowGrdGoodsInfoCommon(goodsNo, eveNo, ordNo, onlineGb)
825{
826    fnPopupLayerShowPosition("divGrdGoodsInfo", 340, 10, event);
827    $.post(
828        "/Interface/GrdGoodsInfoDisplay",
829        {
830            "goodsNo": goodsNo,
831            "eveNo": eveNo,
832            "ordNo": ordNo,
833            "onlineGb": onlineGb
834        },
835        function (data)
836        {
837            $("#divGrdGoodsInfoIfrm").html(data);
838        }
839    );
840}
841
842// ****************************************************************************************************
843//  함수명 : fnShowGiftMessagePreview
844//  기능   : 선물 포장 Message 보기
845// ****************************************************************************************************
846function fnShowGiftMessagePreview()
847{
848    var url = "/WebForm/OrderPayment/Popup/popup_giftMessage.aspx";
849    fnWindowOpen(url, "GiftMessagePreview", 750, 485, true);
850}  
851
852
853// ****************************************************************************************************
854//  함수명 : window resize event callback 함수
855// ****************************************************************************************************
856setTimeout(eval('window.onresize = function () { fnRePosYesLayer(); };'), 1000);
857
858
859
860// clickcode : 클릭로그를 남긴다.
861function setWcode(Wcode) {
862
863    if (Wcode != null) {
864       try{ 
865           clickstream.setClickstreamLog(Wcode);
866       }
867       catch(e){}
868    }
869}
870
871// clickcode : 클릭로그를 남긴다.
872function setBBcode(code) {
873    if (code != null) {
874        try {
875            clickstream.setClickstreamLog(code);
876        }
877        catch (e) { }
878    }
879}
880
881// clickcode : 클릭로그를 남긴다.
882function setBScode(code) {
883    if (code != null) {
884        try {
885            clickstream.setClickstreamLog(code);
886        }
887        catch (e) { }
888    }
889}
890
891// clickcode 후 페이지 이동
892function setWcodeNRedirection(url, Wcode) {
893    setWcode(Wcode);
894
895    document.location.href = url;  
896}
897
898// clickcode : 클릭로그를 남긴다.
899function setPcode(Pcode, extra_code) {
900    if (Pcode != null) {
901        try {
902            clickstream.setClickstreamLog(Pcode, extra_code);
903        }
904        catch (e) { }
905    }
906}
907// clickcode extra : 확장클릭로그를 남긴다.
908function setPcodeExtraLog(codeNo, extraKindCode, hashTagNo, keywordName, goodsNo) {
909    var keyword = '';
910
911    if (extraKindCode == "recommend_goods_click") {
912        //추천상품 영역인 경우, keyword에 현재 페이지의 상품번호 전송
913        keyword = goods_no;
914    }
915    else {
916        //해시태그
917        keyword = encodeURIComponent(keywordName);
918    }
919
920    var extra_code = {
921        ExtraKindCode: extraKindCode,
922        keyword: keyword,
923        GoodsNo: goodsNo,
924        TagNo: hashTagNo
925    };
926
927    try {
928        setPcode(codeNo, extra_code);
929    }
930    catch (e) {
931    }
932}
933
934// clickcode : 클릭로그를 남긴다.
935function setHcode(Hcode) {
936
937    if (Hcode != null) {
938        try {
939            clickstream.setClickstreamLog(Hcode);
940        }
941        catch (e) { }
942    }
943}
944
945// clickcode : 클릭로그를 남긴다.
946function setNcode(Ncode) {
947
948    if (Ncode != null) {
949        try {
950            clickstream.setClickstreamLog(Ncode);
951        }
952        catch (e) { }
953    }
954}
955
956// clickcode : 클릭로그를 남긴다.
957function setOcode(Ocode) {
958    if (Ocode != null) {
959        try {
960            clickstream.setClickstreamLog(Ocode);
961        }
962        catch (e) { }
963    }
964}
965
966// clickcode : 클릭로그를 남긴다.
967function SetCdCode(Ocode) {
968    if (Ocode != null) {
969        try {
970            clickstream.setClickstreamLog(Ocode);
971        }
972        catch (e) { }
973    }
974}
975
976// clickcode : 클릭로그를 남긴다.
977function setPsCode(psCode) {
978    if (psCode != null) {
979        try {
980            clickstream.setClickstreamLog(psCode);
981        }
982        catch (e) { }
983    }
984}
985
986// clickcode : 클릭로그를 남긴다.
987function setCUHCode(CUHCode) {
988    if (CUHCode != null) {
989        try {
990            clickstream.setClickstreamLog(CUHCode);
991        }
992        catch (e) { }
993    }
994}
995
996// clickcode : 클릭로그를 남긴다.
997function setCUSCode(CUSCode) {
998    if (CUSCode != null) {
999        try {
1000            clickstream.setClickstreamLog(CUSCode);
1001        }
1002        catch (e) { }
1003    }
1004}
1005
1006// clickcode : 클릭로그를 남긴다.
1007function setSCode(sCode) {
1008    if (sCode != null) {
1009        try {
1010            clickstream.setClickstreamLog(sCode);
1011        }
1012        catch (e) { }
1013    }
1014}
1015
1016// clickcode : 클릭로그를 남긴다.
1017function setMCcode(MCcode) {
1018    if (MCcode != null) {
1019        try {
1020            clickstream.setclickstreamlog(MCcode);
1021        }
1022        catch (e) { }
1023    }
1024}
1025
1026// clickcode : 클릭로그를 남긴다.
1027function setSCcode(SCcode) {
1028    if (SCcode != null) {
1029        try {
1030            clickstream.setClickstreamLog(SCcode);
1031        }
1032        catch (e) { }
1033    }
1034}
1035
1036// clickcode : 클릭로그를 남긴다.
1037function setGTcode(GTcode) {
1038    if (GTcode != null) {
1039        try {
1040            clickstream.setClickstreamLog(GTcode);
1041        }
1042        catch (e) { }
1043    }
1044}
1045
1046// clickcode : 클릭로그를 남긴다.
1047function setMScode(MScode) {
1048    if (MScode != null) {
1049        try {
1050            clickstream.setClickstreamLog(MScode);
1051        }
1052        catch (e) { }
1053    }
1054}
1055
1056//클릭스트림 수동 전송
1057function sendClickstreamExtraLog(click_code, extra_kind_code, keyword, goods_no, hashtag_no) {
1058    try {
1059        var extra_code = {
1060            ExtraKindCode: extra_kind_code,
1061            keyword: keyword,
1062            GoodsNo: goods_no,
1063            TagNo: hashtag_no
1064        };
1065        clickstream.setClickstreamLog(click_code, extra_code)
1066    }
1067    catch (e) { }
1068}
1069
1070function setScodeWithExtraCode(code, keyWord, goods_no, tag_no, sender) {
1071    if (code != null) {
1072        try {
1073            var iyNo = $(sender).closest('li').data('iy-no');
1074            if (iyNo) {
1075                var keyword_extra_code = {
1076                    ExtraKindCode: "keywordAD_goods_click",
1077                    keyword: keyWord,
1078                    GoodsNo: goods_no,
1079                    TagNo: iyNo
1080                };
1081                clickstream.setClickstreamLog(code, keyword_extra_code)
1082            }
1083          
1084            var extra_code = {
1085                ExtraKindCode: 'search_goods_click',
1086                keyword: keyWord,
1087                GoodsNo: goods_no,
1088                TagNo: tag_no
1089            };
1090            clickstream.setClickstreamLog(code, extra_code);
1091        }
1092        catch (e) { }
1093    }
1094}
1095
1096function setTagClickExtraCode(code, keyWord, goods_no, tag_no) {
1097    if (code != null) {
1098        try {
1099            var extra_code = {
1100                ExtraKindCode: 'tag_click',
1101                keyword: keyWord,
1102                GoodsNo: goods_no,
1103                TagNo: tag_no
1104            };
1105            clickstream.setClickstreamLog(code, extra_code);
1106        }
1107        catch (e) { }
1108    }
1109}
1110
1111function loginPage() {
1112    var url = document.location.href;
1113
1114    var urls = url.split('?');
1115    var page = urls[0];
1116    var params = urls.length > 1 ? urls[1] : '';
1117
1118    var urlU = new URLUtil();
1119
1120    var loginUrl = "/Templates/FTLogin.aspx?ReturnURL=" + urlU.getURL();
1121    var returnParams = urlU.getQueryString();
1122
1123    if (returnParams != '') loginUrl += "&ReturnParams=" + returnParams.replace(/&/g, "`");
1124
1125    document.location = loginUrl;
1126}
1127
1128//Get QueryString(대소문자 구분 안함)
1129function getQuerystringParam(name) {
1130    var url = window.location.href.toLowerCase();
1131    name = name.replace(/[\[\]]/g, "\\$&").toLowerCase();
1132    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
1133        results = regex.exec(url);
1134    if (!results) return null;
1135    if (!results[2]) return '';
1136    return decodeURIComponent(results[2].replace(/\+/g, " "));
1137}
1138
1139//클릭스크림 로그만 전송 
1140function setCustomClickstreamLog(eventType, goodsNo) {
1141    var eventNo = getQuerystringParam("eventno") > 0 ? getQuerystringParam("eventno") : $('meta[property="eventno"]').attr("content");
1142    goodsNo = typeof (goodsNo) == "undefined" ? "" : goodsNo;
1143
1144    //페이지진입로그
1145    if (eventType == "page_init") {
1146        clickstream.setClickstreamLog('000_000_000')
1147    }
1148
1149    //이벤트 페이지 클릭스트림 전송
1150    if (eventNo > 0) {
1151        //이벤트 페이지 클릭코드
1152        var eventClickCode = eventNo;
1153
1154        //페이지 진입 파라미터 세팅
1155        if (eventType == "page_init") {
1156            eventType = "event_page_init";
1157        }
1158
1159        //클릭스트림 로그 전송
1160        var extra_code = {
1161            ExtraKindCode: eventType,
1162            keyword: "",
1163            GoodsNo: goodsNo,
1164            TagNo: eventNo
1165        };
1166        clickstream.setClickstreamLog(eventClickCode, extra_code);
1167    }
1168}
1169
1170//이벤트 템플릿 여부 체크(이벤트/사은품/출판사)
1171function checkEventTemplate() {
1172    var isEvent = false;
1173    var currentPage = document.location.pathname.toLocaleLowerCase();
1174    if (currentPage.indexOf("yespresent.aspx") > -1 || currentPage.indexOf("dirpresent.aspx") > -1 || currentPage.indexOf("eworld/eventworld/event") > -1 || currentPage.indexOf("campaign/") > -1) {
1175        isEvent = true;
1176    }
1177    return isEvent;
1178}
1179
1180//모바일기기 여부
1181function getIsMobileDevice() {
1182    var mobileDevices = /Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i;
1183    return (mobileDevices).test(navigator.userAgent);
1184}
1185
1186//사업자 등록번호 체크
1187function checkValidBusinessNumber(number) {
1188    var bReturn = false;
1189    var sRetMsg = "";
1190
1191    number = number.replaceAll('-','');
1192
1193    // 사업자등록번호 형식 확인 (숫자 10자리)
1194    var regex = /^\d{10}$/;
1195
1196    if (!regex.test(number)) {
1197        return { Success: bReturn, Message: sRetMsg };
1198    } else {
1199        sRetMsg = number.replace(/-/g, '');
1200
1201        // 사업자등록번호 유효성 검증을 위한 가중치
1202        var weights = [1, 3, 7, 1, 3, 7, 1, 3, 5];
1203
1204        // 가중치 적용 및 합산
1205        var sum = 0;
1206        for (var i = 0; i < weights.length; i++) {
1207            sum += number[i] * weights[i];
1208        }
1209
1210        // 9번째 자리 수와 가중치를 곱한 값의 1의 자리를 구하고 10에서 뺀 값을 sum에 더함
1211        sum += Math.floor((number[8] * 5) / 10);
1212
1213        // 검증코드 (마지막 자리 수)
1214        var checkDigit = (10 - (sum % 10)) % 10;
1215
1216        // 마지막 자리와 검증코드 비교
1217        bReturn = checkDigit === parseInt(number[9]);
1218
1219        if (bReturn) {
1220            // 유효한 경우, 형식에 맞게 '-'를 추가
1221            sRetMsg = number.substring(0, 3) + '-' + number.substring(3, 5) + '-' + number.substring(5);
1222        }
1223
1224        return { Success: bReturn, Message: sRetMsg };
1225    }
1226}

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.