/* ********** */ function leerCookie(name) { var nameEQ = name + "="; 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, c.length); if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length, c.length)); } return ""; } /***********/ function crearCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; var domain = window.location.hostname; domain = domain.replace("www.", ""); domain = domain.replace("www2.", ""); document.cookie = name + "=" + value + expires + ";domain=." + domain + ";path=/"; } (function () { "use strict"; var cookieName = "tplCookieConsent"; var cookieLifetime = 60; var _setCookie = function (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 + ";path=/"; }; var _getCookie = function (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) == 0) { return c.substring(name.length, c.length); } } return ""; }; var _shouldShowPopup = function () { if (_getCookie(cookieName)) { return false; } else { return true; } }; if (_shouldShowPopup()) { setTimeout(function () { document.getElementsByClassName("cookieContainer")[0].style.display = "block"; /* setTimeout(function() { document.getElementsByClassName('lh-copy vtex-rich-text-0-x-paragraph vtex-rich-text-0-x-paragraph--footer-pop-up-trigger')[0].click(); }, 1000);*/ }, 2000); } setTimeout(function () { document .getElementsByClassName("link_dismiss")[0] .addEventListener("click", function () { _setCookie(cookieName, 1, cookieLifetime); setTimeout(function () { document.getElementsByClassName("cookieContainer")[0].style.display = "none"; }, 2000); }); document .getElementsByClassName("link_cancel")[0] .addEventListener("click", function () { setTimeout(function () { document.getElementsByClassName("cookieContainer")[0].style.display = "none"; }, 2000); }); }, 3000); })(); /*var is_safari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); setTimeout(function () { if (is_safari == true) { $('#btn-show-modal').attr('style', 'display: none !important'); $('#buy-button-section').attr('style', 'display: block !important'); } }, 300);*/