// 쿠키 가져오기 function getPopCookie(name) { let nameOfCookie = name + "="; let x = 0; while (x <= document.cookie.length) { let y = (x + nameOfCookie.length); if (document.cookie.substring(x, y) == nameOfCookie) { if ((endOfCookie = document.cookie.indexOf(";", y)) == -1) endOfCookie = document.cookie.length; return unescape(document.cookie.substring(y, endOfCookie)); } x = document.cookie.indexOf(" ", x) + 1; if (x == 0) { break; } } return ""; } // 쿠키 넣기 function setPopCookie(name, value, expiredays) { let todayDate = new Date(); todayDate.setDate(todayDate.getDate() + expiredays); document.cookie = name + '=' + escape(value) + '; path=/; expires=' + todayDate.toGMTString() + ';' return; } // 레이어 팝업 닫기 function closePopup(num, allday) { $("#pop-" + num).css("display", "none"); if (allday == 'Y') setPopCookie("pop-" + num, "Y", 1); //오늘 하루 열지 않기 } // 레이어 팝업 열기 function openWin(winName) { let blnCookie = getPopCookie(winName); let obj = eval("window." + winName); if (!blnCookie) $("#" + winName).fadeIn(); } // // 레이어 초기화 // $(document).ready(function () { // $(".open_popup_wrap").each(function () { // openWin($(this).attr("id")); // // 쿠키값을 잠시 삭제시 주석 제거. // //document.cookie = $(this).attr("id") + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"; // }); // });