function setCookie(name, value, expire) { document.cookie = name + "=" + escape(value) + ((expire == null)? "" : ("; expires=" + expire.toGMTString())); } function checkCookie(name) { if (document.cookie != "") { var toCookie = document.cookie.split("; "); for (i = 0; i < toCookie.length; i++) { var CookieName = toCookie[i].split("=")[0]; var CookieValue = toCookie[i].split("=")[1]; if (CookieName == name) return unescape(CookieValue); } } } function removeCookieAlert() { var CookieAlert = document.getElementById('CookieAlert'); document.body.removeChild(CookieAlert); var expire = new Date(); expire.setMonth(expire.getMonth() + 1); setCookie('agreeCookies', 'yes', expire); } $(document).ready(function () { var CookieAlert = document.createElement('div'); var style ='background-color:rgba(0,0,0,1);position:fixed;text-align:center;width:100%;z-index:1000;color:#FFF;padding:10px;font-family:Arial;font-size:12px;'; var html = '
Ta witryna używa plików cookie. Więcej informacji o ich zastosowaniu, modyfikacji i akceptacji można znaleźć tutaj.
'; CookieAlert.setAttribute('id', 'CookieAlert'); CookieAlert.setAttribute('style', style); CookieAlert.innerHTML = html; if (checkCookie('agreeCookies') != 'yes') { document.body.appendChild(CookieAlert); } });