1 window.addEventListener("load", function () {
2 var cookiename = 'cncookiesaccepted'
3 var cookie = getCookie(cookiename);
6 document.getElementById('cookienotice-box').style.display = 'block';
7 document.getElementById('cookienotice-ok-button').onclick = function () {
8 setCookie(cookiename, 1, 365);
9 document.getElementById('cookienotice-box').style.display = 'none';
13 function setCookie(cname, cvalue, exdays) {
15 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
16 var expires = "expires=" + d.toUTCString();
17 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
20 function getCookie(cname) {
21 var name = cname + "=";
22 var decodedCookie = decodeURIComponent(document.cookie);
23 var ca = decodedCookie.split(';');
24 for (var i = 0; i < ca.length; i++) {
26 while (c.charAt(0) == ' ') {
29 if (c.indexOf(name) == 0) {
30 return c.substring(name.length, c.length);