function setCookiebannerCookie(val) {
  document.cookie = cookiebanner_cookie +"="+val+"; expires=Fry, 01 Jan 2038 00:00:00 UTC; path=/;";
  document.getElementById('cookiebanner').remove();
}

(function() {
  function getCookie(name) {
    const value = `; ${document.cookie}`;
    const parts = value.split(`; ${name}=`);
    if (parts.length === 2) 
      return parts.pop().split(';').shift();
    return false;
  }
  
  //
  
  if(!getCookie(cookiebanner_cookie)) {
    var cookiebanner = document.createElement('div');
    cookiebanner.setAttribute('id','cookiebanner');
    cookiebanner.append(document.createTextNode(cookiebanner_text));
    cookiebanner.append(document.createElement('br'));
    
    var ack = document.createElement('button');
    ack.setAttribute('onclick','setCookiebannerCookie("ok");');
    ack.append(document.createTextNode('Ja'));
    cookiebanner.append(ack);
    
    var nak = document.createElement('button');
    nak.setAttribute('onclick','setCookiebannerCookie("nope");');
    nak.append(document.createTextNode('Nein'));
    cookiebanner.append(nak);
    
    document.body.appendChild(cookiebanner);
  }
})();