$(document).ready(function () { //popup slider js var popslider = $('.popupSlider').bxSlider({ mode: 'fade', pager: false, auto: true, controls : false, onSliderLoad: function () { $(".popupSlider").css("visibility", "visible").animate({ opacity: 1 }); } }); $(".popmodal a").on("click", function () { event.preventDefault(); $(this).parent("div").parent(".popmodal").fadeOut(); }); // cookie push function set_cookie(name, value, expirehours, domain) { var today = new Date(); today.setTime(today.getTime() + (60 * 60 * 1000 * expirehours)); document.cookie = name + "=" + escape(value) + "; path=/; expires=" + today.toGMTString() + ";"; if (domain) { document.cookie += "domain=" + domain + ";"; } } // cookie get function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1); if (c.indexOf(name) != -1) return c.substring(name.length, c.length); } return ""; } function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = cname + "=" + cvalue + "; " + expires; } function couponClose() { if ($("input[name='chkbox']").is(":checked") == true) { setCookie("close", "Y", 1); } $("#pop").hide(); } $(document).ready(function () { cookiedata = document.cookie; if (cookiedata.indexOf("close=Y") < 0) { $("#pop").show(); } else { $("#pop").hide(); } $("#close").click(function () { couponClose(); }); }); });