Difference between revisions of "MediaWiki:Common.js"

From MunichBeerGardens.com
Jump to: navigation, search
m
m
 
(29 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
  };
 
  };
  
/* start rotating banner */
 
/* Banner 160x600 */
 
/* Add image and URL in array and upload/protect image and preload
 
  (first letter or image name must be capitalised) */
 
  
/* define the images directory including trailing slash */
+
/* GDPR */
var beergarden_banner_dir = '/images/beer/';
 
  
var beergarden_banners = new Array("Muhlenpark_01.jpg",
+
if (window.addEventListener)
                                  "Aujaeger_03.jpg",
+
{
                                  "Aujaeger_04_en.jpg",
+
window.addEventListener('load', run_onload, false);
                                  "Alter_Wirt_Etterschlag_01.jpg",
+
}
                                  "Kneissl_04.jpg",
 
                                  "Hofbrauhaus_Keller_Freising_03.jpg",
 
                                  "Zur_Einkehr_03.jpg");
 
  
/*
+
function accept_cookies(){
  
Quick workaround without UTF8 aware redirect: Set up page with ASCII and create
+
/* if GDPR_table_rejected exists, remove it */
a js-link and wiki redirect page, e.g.: Biergarten_Muehlenpark REDIRECT [[Biergarten_Mühlenpark]]
+
var GDPR_table_rejected = document.getElementById("GDPR_table_rejected");
alternatively and easier, by-pass the redirect page and don't log clicks
+
if (typeof(GDPR_table_rejected) !== 'undefined' && GDPR_table_rejected!== null){
 +
GDPR_table_rejected.remove();
 +
}
  
*/
+
/* if GDPR_table_undecided exists, remove it */
 +
var GDPR_table_undecided = document.getElementById("GDPR_table_undecided");
 +
if (typeof(GDPR_table_undecided) !== 'undefined' && GDPR_table_undecided!== null){
 +
GDPR_table_undecided.remove();
 +
}
  
+
var GDPR_cookie = "GDPR=accepted";
var beergarden_links = new Array("/admin/munichbeergardens.com/redirect.cgi?url=/Biergarten_Muehlenpark",
 
                                "/Aujäger",
 
                                "/Aujäger",
 
                                "/Alter_Wirt_Etterschlag",
 
                                "/Räuber-Kneißl-Garten",
 
                                "/admin/munichbeergardens.com/redirect.cgi?url=/Hofbrauhaus-Keller_Freising",
 
                                "/admin/munichbeergardens.com/redirect.cgi?url=/Rothmeyer%27s_Zur_Einkehr");
 
  
function start_animation(){
+
var GDPR_year = new Date(); // create date
setTimeout('beergarden_blender()',15000); /* 15 second */
+
GDPR_year.setFullYear(GDPR_year.getFullYear() +1) // add 1 year from now
}
+
var GDPR_end = "expires=" + GDPR_year.toGMTString() + ";path=/; samesite=strict";  // make endcookie and path variable
 +
// var GDPR_end = "expires=0;path=/; samesite=strict";  // make endcookie and path variable
  
beergarden_banner1 = new Image(160,600);
+
document.cookie = GDPR_cookie + ";" + GDPR_end;
beergarden_banner1.src = beergarden_banner_dir + "Muhlenpark_01.jpg";
+
console.log("Added cookie: " + document.cookie);
  
beergarden_banner2 = new Image(160,600);
+
accepted();
beergarden_banner2.src = beergarden_banner_dir + "Aujaeger_03.jpg";
+
}
  
beergarden_banner3 = new Image(160,600);
+
function reject_cookies(){
beergarden_banner3.src = beergarden_banner_dir + "Aujaeger_04_en.jpg";
+
var GDPR_cookie = "GDPR=rejected"
  
beergarden_banner4 = new Image(160,600);
+
var GDPR_year = new Date(); // create date
beergarden_banner4.src = beergarden_banner_dir + "Alter_Wirt_Etterschlag_01.jpg";
+
GDPR_year.setFullYear(GDPR_year.getFullYear() +1) // add 1 year from now
 +
var GDPR_end = "expires=" + GDPR_year.toGMTString() + ";path=/; samesite=strict";  // make endcookie and path variable
 +
// var GDPR_end = "expires=0;path=/; samesite=strict"; // make endcookie and path variable
  
beergarden_banner5 = new Image(160,600);
+
document.cookie = GDPR_cookie + ";" + GDPR_end;
beergarden_banner5.src = beergarden_banner_dir + "Kneissl_04.jpg";
+
console.log("Added cookie: " + document.cookie);
  
beergarden_banner6 = new Image(160,600);
+
GDPR_table_undecided.remove();
beergarden_banner6.src = beergarden_banner_dir + "Zur_Einkehr_03.jpg";
+
rejected();
 +
}
  
beergarden_banner7 = new Image(160,600);
+
// read cookie and set action here
beergarden_banner7.src = beergarden_banner_dir + "Hofbrauhaus_Keller_Freising_03.jpg";
+
function run_onload(){
  
 +
GDPR_state_value = "undecided";
  
function beergarden_swap(){
+
if(document.cookie.indexOf("GDPR") != -1){
opacity = 0;
 
IE_opacity = 0;
 
  
if (navigator.appVersion.indexOf("MSIE") != -1){
+
var state_pos = document.cookie.indexOf("GDPR=");
document.getElementById("blendinger").style.filter = "alpha(opacity=0)";
+
var state_start = state_pos + 5;
interval = setInterval("blendinger_IE()",50)
+
var state_end = state_start + 8;
 +
GDPR_state_value = document.cookie.substring(state_start,state_end);
 +
console.log(GDPR_state_value);
 +
console.log(document.cookie);
 +
}
  
 +
if (GDPR_state_value == "accepted"){
 +
accepted();
 
}
 
}
else {
+
 
document.getElementById("blendinger").style.opacity=0;
+
if (GDPR_state_value == "rejected"){
interval = setInterval("blendinger_opacity()",50)
+
rejected();
 
}
 
}
 +
 +
 +
if (GDPR_state_value == "undecided"){
 +
undecided();
 
}
 
}
  
function blendinger_IE(){
 
if (IE_opacity < 100){
 
IE_opacity = IE_opacity +4;
 
document.getElementById("blendinger").style.filter = "alpha(opacity="+IE_opacity+")";
 
  
 
}
 
}
  
else{
+
 
clearInterval(interval);
+
function undecided(){
IE_count = 0;
+
 
 +
var GDPR_table_undecided = document.createElement("table");
 +
GDPR_table_undecided.setAttribute("id","GDPR_table_undecided");
 +
var GDPR_row = document.createElement("tr");
 +
var GDPR_cell = document.createElement("td");
 +
 
 +
var GDPR_reject_button = document.createElement("span");
 +
GDPR_reject_button.setAttribute("id","GDPR_reject_button");
 +
GDPR_reject_button.style.cursor="pointer";
 +
GDPR_reject_button.appendChild(document.createTextNode("REJECT COOKIES"));
 +
 
 +
var GDPR_accept_button = document.createElement("span");
 +
GDPR_accept_button.setAttribute("id","GDPR_accept_button");
 +
GDPR_accept_button.style.cursor="pointer";
 +
GDPR_accept_button.appendChild(document.createTextNode("ACCEPT COOKIES"));
 +
 
 +
GDPR_reject_button.onclick=reject_cookies;
 +
GDPR_accept_button.onclick=accept_cookies;
 +
 
 +
GDPR_table_undecided.appendChild(GDPR_row);
 +
GDPR_row.appendChild(GDPR_cell);
 +
 
 +
GDPR_cell.appendChild(document.createElement("br"));
 +
 
 +
 
 +
GDPR_cell.appendChild(document.createTextNode("This site requires the use of cookies to comply with the "));
 +
 
 +
var a = document.createElement('a');
 +
var GDPR_link = document.createTextNode("GDPR ");
 +
a.appendChild(GDPR_link);
 +
a.href = "https://en.wikipedia.org/wiki/General_Data_Protection_Regulation";
 +
a.title = a.href;
 +
GDPR_cell.appendChild(a);
 +
 
 +
GDPR_cell.appendChild(document.createTextNode(" and "));
 +
 
 +
var a = document.createElement('a');
 +
var GOOGLE_link = document.createTextNode("Google's privacy policy");
 +
a.appendChild(GOOGLE_link);
 +
a.href = "https://policies.google.com/privacy";
 +
a.title = a.href;
 +
GDPR_cell.appendChild(a);
 +
GDPR_cell.appendChild(document.createTextNode(". Cookies are used for "));
 +
 
 +
var a = document.createElement('a');
 +
var GOOGLE_ADS_link = document.createTextNode("ads personaliation");
 +
a.appendChild(GOOGLE_ADS_link);
 +
a.href = "https://policies.google.com/technologies/partner-sites";
 +
a.title = a.href;
 +
GDPR_cell.appendChild(a);
 +
GDPR_cell.appendChild(document.createTextNode("."));
 +
 
 +
GDPR_cell.appendChild(document.createElement("br"));
 +
 
 +
 
 +
GDPR_cell.appendChild(GDPR_reject_button);
 +
GDPR_cell.appendChild(GDPR_accept_button);
 +
 
 +
 
 +
 
 +
document.body.appendChild(GDPR_table_undecided);
 +
 
 +
GDPR_table_undecided.style.width="100%";
 +
GDPR_table_undecided.style.backgroundColor="#f4d500"; /* yellow */
 +
GDPR_table_undecided.style.backgroundColor="#f9f9f9";
 +
GDPR_table_undecided.style.borderTop="dashed 1px #3f8a50";
 +
GDPR_table_undecided.style.opacity="95%";
 +
GDPR_table_undecided.style.textAlign="center";
 +
GDPR_table_undecided.style.position="fixed";
 +
GDPR_table_undecided.style.bottom="0";
 +
GDPR_table_undecided.style.verticalAlign="middle"; /* some old IE convention */
 +
/* reject button styles */
 +
GDPR_reject_button.style.backgroundColor="#d34603";
 +
GDPR_reject_button.style.color="#fffcf3";
 +
GDPR_reject_button.style.padding="12px 20px";
 +
GDPR_reject_button.style.border="none";
 +
GDPR_reject_button.style.textAlign="center";
 +
GDPR_reject_button.style.borderRadius=" 20px";
 +
GDPR_reject_button.style.cursor="pointer";
 +
GDPR_reject_button.style.fontSize="105%";
 +
GDPR_reject_button.style.fontWeight="bold";
 +
GDPR_reject_button.style.minWidth="160px";
 +
GDPR_reject_button.style.display="inline-block";
 +
GDPR_reject_button.style.margin="10px";
 +
/* accept button styles */
 +
GDPR_accept_button.style.backgroundColor="#3f8a50";
 +
GDPR_accept_button.style.color="#fffcf3";
 +
GDPR_accept_button.style.padding="12px 20px";
 +
GDPR_accept_button.style.border="none";
 +
GDPR_accept_button.style.textAlign="center";
 +
GDPR_accept_button.style.borderRadius=" 20px";
 +
GDPR_accept_button.style.cursor="pointer";
 +
GDPR_accept_button.style.fontSize="105%";
 +
GDPR_accept_button.style.fontWeight="bold";
 +
GDPR_accept_button.style.minWidth="160px";
 +
GDPR_accept_button.style.display="inline-block";
 +
GDPR_accept_button.style.margin="10px";
 
}
 
}
 +
 +
function remove_GDPR_cookie(){
 +
console.log("Removed cookie: " + document.cookie);
 +
document.cookie = "GDPR=; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/; samesite=strict";
 +
 
}
 
}
  
function blendinger_opacity(){
+
 
+
function accepted(){
if (opacity < 1){
+
var cookie_img = document.createElement("img");
opacity = (Math.floor(opacity * 100) +4) / 100;
+
 
document.getElementById("blendinger").style.opacity=opacity;
+
cookie_img.setAttribute("id","cookie_img"); /* used for link */
 +
cookie_img.onclick=undecided; /* create click event */
 +
cookie_img.addEventListener('click', cookie_img.remove); /* add second click event, removing cookie image */
 +
cookie_img.addEventListener('click', remove_GDPR_cookie); /* add third click event, removing cookie */
 +
 
 +
cookie_img.style.cursor="pointer";
 +
cookie_img.src = "https://www.munichbeergardens.com/images/beer/Cookie.png";
 +
document.body.appendChild(cookie_img);
 +
 
 +
cookie_img.style.position="fixed";
 +
cookie_img.style.bottom="5px";
 +
cookie_img.style.right="5px";
  
 
}
 
}
else{
 
clearInterval(interval);
 
  
}
+
function rejected(){
}
+
 
 +
var GDPR_table_rejected = document.createElement("table");
 +
GDPR_table_rejected.setAttribute("id","GDPR_table_rejected");
 +
var GDPR_row = document.createElement("tr");
 +
var GDPR_cell = document.createElement("td");
 +
 
 +
var GDPR_accept_button = document.createElement("span");
 +
GDPR_accept_button.setAttribute("id","GDPR_accept_button");
 +
GDPR_accept_button.style.cursor="pointer";
 +
GDPR_accept_button.appendChild(document.createTextNode("ACCEPT COOKIES"));
  
var beergarden_array_index = beergarden_links.length -1;
+
GDPR_accept_button.onclick=accept_cookies;
var first_beergarden_index = Math.round(beergarden_array_index * Math.random())
 
  
var beergarden_cycle = first_beergarden_index;
+
GDPR_table_rejected.appendChild(GDPR_row);
var beergarden_total = beergarden_banners.length -1;
+
GDPR_row.appendChild(GDPR_cell);
var beergarden_link = beergarden_links[beergarden_cycle]; /* initially the first */
 
  
function beergarden_blender(){
+
GDPR_cell.appendChild(GDPR_accept_button);
  
/* first set current image as background */
 
  
document.getElementById('background_image').style.backgroundImage='url('+beergarden_banner_dir+beergarden_banners[beergarden_cycle]+')';
+
GDPR_cell.appendChild(document.createElement("br"));
  
beergarden_cycle++;
+
GDPR_cell.appendChild(document.createTextNode("This site requires the use of cookies to comply with the "));
  
if (beergarden_cycle == beergarden_banners.length){
+
var a = document.createElement('a');
beergarden_cycle = 0;
+
var GDPR_link = document.createTextNode("GDPR ");
}
+
a.appendChild(GDPR_link);
+
a.href = "https://en.wikipedia.org/wiki/General_Data_Protection_Regulation";
beergarden_swap();
+
a.title = a.href;
 +
GDPR_cell.appendChild(a);
  
setTimeout("document.images.beergarden_animation.src=beergarden_banner_dir + beergarden_banners[beergarden_cycle];",10)
+
GDPR_cell.appendChild(document.createTextNode(" and "));
             
 
beergarden_link = beergarden_links[beergarden_cycle] /* update link values */
 
 
}
 
  
/* end rotaing banner */
+
var a = document.createElement('a');
 +
var GOOGLE_link = document.createTextNode("Google's privacy policy");
 +
a.appendChild(GOOGLE_link);
 +
a.href = "https://policies.google.com/privacy";
 +
a.title = a.href;
 +
GDPR_cell.appendChild(a);
 +
GDPR_cell.appendChild(document.createTextNode(". Cookies are used for "));
  
 +
var a = document.createElement('a');
 +
var GOOGLE_ADS_link = document.createTextNode("ads personaliation");
 +
a.appendChild(GOOGLE_ADS_link);
 +
a.href = "https://policies.google.com/technologies/partner-sites";
 +
a.title = a.href;
 +
GDPR_cell.appendChild(a);
 +
GDPR_cell.appendChild(document.createTextNode("."));
  
 +
GDPR_cell.appendChild(document.createElement("br"));
  
/* emulate sticky CSS */
+
document.body.appendChild(GDPR_table_rejected);
if (document.getElementById('p-Matched_content') !=null) {
 
window.onscroll = function()
 
var header_height = document.getElementById("p-Matched_content").scrollHeight;
 
if (window.scrollY + 330 > header_height){
 
document.getElementById("p-Matched_content").style.position="fixed";
 
document.getElementById("p-Matched_content").style.top="0px";
 
}
 
else{
 
document.getElementById("p-Matched_content").style.position="static";
 
}
 
}
 
}
 
  
if (document.getElementById('p-advertisement') !=null) {
+
GDPR_table_rejected.style.width="100%";
window.onscroll = function() { 
+
GDPR_table_rejected.style.height="100%";
var header_height = document.getElementById("p-advertisement").scrollHeight;
+
GDPR_table_rejected.style.backgroundColor="#f9f9f9";
if (window.scrollY + 330 > header_height){
+
GDPR_table_rejected.style.opacity="95%";
document.getElementById("p-advertisement").style.position="fixed";
+
GDPR_table_rejected.style.textAlign="center";
document.getElementById("p-advertisement").style.top="0px";
+
GDPR_table_rejected.style.position="fixed";
}
+
GDPR_table_rejected.style.bottom="0";
else{
+
GDPR_table_rejected.style.verticalAlign="middle"; /* some old IE convention */
document.getElementById("p-advertisement").style.position="static";
+
/* accept button styles */
}
+
GDPR_accept_button.style.backgroundColor="#3f8a50";
}
+
GDPR_accept_button.style.color="#fffcf3";
 +
GDPR_accept_button.style.padding="12px 20px";
 +
GDPR_accept_button.style.border="none";
 +
GDPR_accept_button.style.textAlign="center";
 +
GDPR_accept_button.style.borderRadius=" 20px";
 +
GDPR_accept_button.style.cursor="pointer";
 +
GDPR_accept_button.style.fontSize="105%";
 +
GDPR_accept_button.style.fontWeight="bold";
 +
GDPR_accept_button.style.minWidth="160px";
 +
GDPR_accept_button.style.display="inline-block";
 +
GDPR_accept_button.style.margin="10px";
 
}
 
}

Latest revision as of 16:49, 27 June 2023

/* Any JavaScript here will be loaded for all users on every page load. */

//setTimeout("alert('test')",10000);

//document.getElementsByTagName('body')[0].style.margin = '110px';

var RecaptchaOptions = {
    theme : 'white'
 };


/* GDPR */

if (window.addEventListener)
{
window.addEventListener('load', run_onload, false);
}

function accept_cookies(){

/* if GDPR_table_rejected exists, remove it */
var GDPR_table_rejected = document.getElementById("GDPR_table_rejected");
if (typeof(GDPR_table_rejected) !== 'undefined' && GDPR_table_rejected!== null){
GDPR_table_rejected.remove();
}

/* if GDPR_table_undecided exists, remove it */
var GDPR_table_undecided = document.getElementById("GDPR_table_undecided");
if (typeof(GDPR_table_undecided) !== 'undefined' && GDPR_table_undecided!== null){
GDPR_table_undecided.remove();
}

var GDPR_cookie = "GDPR=accepted";

var GDPR_year = new Date(); // create date
GDPR_year.setFullYear(GDPR_year.getFullYear() +1) // add 1 year from now
var GDPR_end = "expires=" + GDPR_year.toGMTString() + ";path=/; samesite=strict";  // make endcookie and path variable
// var GDPR_end = "expires=0;path=/; samesite=strict";  // make endcookie and path variable

document.cookie = GDPR_cookie + ";" + GDPR_end;
console.log("Added cookie: " + document.cookie);

accepted();
}

function reject_cookies(){
var GDPR_cookie = "GDPR=rejected"

var GDPR_year = new Date(); // create date
GDPR_year.setFullYear(GDPR_year.getFullYear() +1) // add 1 year from now
var GDPR_end = "expires=" + GDPR_year.toGMTString() + ";path=/; samesite=strict";  // make endcookie and path variable
// var GDPR_end = "expires=0;path=/; samesite=strict";  // make endcookie and path variable

document.cookie = GDPR_cookie + ";" + GDPR_end;
console.log("Added cookie: " + document.cookie);

GDPR_table_undecided.remove();
rejected();
}

// read cookie and set action here
function run_onload(){

GDPR_state_value = "undecided";

if(document.cookie.indexOf("GDPR") != -1){

var state_pos = document.cookie.indexOf("GDPR=");
var state_start = state_pos + 5;
var state_end =  state_start + 8;
GDPR_state_value = document.cookie.substring(state_start,state_end);
console.log(GDPR_state_value);
console.log(document.cookie);
}

if (GDPR_state_value == "accepted"){
accepted();
}

if (GDPR_state_value == "rejected"){
rejected();
}


if (GDPR_state_value == "undecided"){
undecided();
}


}


function undecided(){

var GDPR_table_undecided = document.createElement("table");
GDPR_table_undecided.setAttribute("id","GDPR_table_undecided");
var GDPR_row = document.createElement("tr");
var GDPR_cell = document.createElement("td");

var GDPR_reject_button = document.createElement("span");
GDPR_reject_button.setAttribute("id","GDPR_reject_button");
GDPR_reject_button.style.cursor="pointer";
GDPR_reject_button.appendChild(document.createTextNode("REJECT COOKIES"));

var GDPR_accept_button = document.createElement("span");
GDPR_accept_button.setAttribute("id","GDPR_accept_button");
GDPR_accept_button.style.cursor="pointer";
GDPR_accept_button.appendChild(document.createTextNode("ACCEPT COOKIES"));

GDPR_reject_button.onclick=reject_cookies;
GDPR_accept_button.onclick=accept_cookies;

GDPR_table_undecided.appendChild(GDPR_row);
GDPR_row.appendChild(GDPR_cell);

GDPR_cell.appendChild(document.createElement("br"));


GDPR_cell.appendChild(document.createTextNode("This site requires the use of cookies to comply with the "));

var a = document.createElement('a');
var GDPR_link = document.createTextNode("GDPR ");
a.appendChild(GDPR_link);
a.href = "https://en.wikipedia.org/wiki/General_Data_Protection_Regulation";
a.title = a.href;
GDPR_cell.appendChild(a);

GDPR_cell.appendChild(document.createTextNode(" and "));

var a = document.createElement('a');
var GOOGLE_link = document.createTextNode("Google's privacy policy");
a.appendChild(GOOGLE_link);
a.href = "https://policies.google.com/privacy";
a.title = a.href;
GDPR_cell.appendChild(a);
GDPR_cell.appendChild(document.createTextNode(". Cookies are used for "));

var a = document.createElement('a');
var GOOGLE_ADS_link = document.createTextNode("ads personaliation");
a.appendChild(GOOGLE_ADS_link);
a.href = "https://policies.google.com/technologies/partner-sites";
a.title = a.href;
GDPR_cell.appendChild(a);
GDPR_cell.appendChild(document.createTextNode("."));

GDPR_cell.appendChild(document.createElement("br"));


GDPR_cell.appendChild(GDPR_reject_button);
GDPR_cell.appendChild(GDPR_accept_button);



document.body.appendChild(GDPR_table_undecided);

GDPR_table_undecided.style.width="100%";
GDPR_table_undecided.style.backgroundColor="#f4d500"; /* yellow */
GDPR_table_undecided.style.backgroundColor="#f9f9f9";
GDPR_table_undecided.style.borderTop="dashed 1px #3f8a50";
GDPR_table_undecided.style.opacity="95%";
GDPR_table_undecided.style.textAlign="center";
GDPR_table_undecided.style.position="fixed";
GDPR_table_undecided.style.bottom="0";
GDPR_table_undecided.style.verticalAlign="middle"; /* some old IE convention */
/* reject button styles */
GDPR_reject_button.style.backgroundColor="#d34603";
GDPR_reject_button.style.color="#fffcf3";
GDPR_reject_button.style.padding="12px 20px";
GDPR_reject_button.style.border="none";
GDPR_reject_button.style.textAlign="center";
GDPR_reject_button.style.borderRadius=" 20px";
GDPR_reject_button.style.cursor="pointer";
GDPR_reject_button.style.fontSize="105%";
GDPR_reject_button.style.fontWeight="bold";
GDPR_reject_button.style.minWidth="160px";
GDPR_reject_button.style.display="inline-block";
GDPR_reject_button.style.margin="10px";
/* accept button styles */
GDPR_accept_button.style.backgroundColor="#3f8a50";
GDPR_accept_button.style.color="#fffcf3";
GDPR_accept_button.style.padding="12px 20px";
GDPR_accept_button.style.border="none";
GDPR_accept_button.style.textAlign="center";
GDPR_accept_button.style.borderRadius=" 20px";
GDPR_accept_button.style.cursor="pointer";
GDPR_accept_button.style.fontSize="105%";
GDPR_accept_button.style.fontWeight="bold";
GDPR_accept_button.style.minWidth="160px";
GDPR_accept_button.style.display="inline-block";
GDPR_accept_button.style.margin="10px";
}

function remove_GDPR_cookie(){
console.log("Removed cookie: " + document.cookie);
document.cookie = "GDPR=; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/; samesite=strict";

}


function accepted(){
var cookie_img = document.createElement("img");

cookie_img.setAttribute("id","cookie_img"); /* used for link */
cookie_img.onclick=undecided; /* create click event */
cookie_img.addEventListener('click', cookie_img.remove); /* add second click event, removing cookie image */
cookie_img.addEventListener('click', remove_GDPR_cookie); /* add third click event, removing cookie */

cookie_img.style.cursor="pointer";
cookie_img.src = "https://www.munichbeergardens.com/images/beer/Cookie.png";
document.body.appendChild(cookie_img);

cookie_img.style.position="fixed";
cookie_img.style.bottom="5px";
cookie_img.style.right="5px";

}

function rejected(){

var GDPR_table_rejected = document.createElement("table");
GDPR_table_rejected.setAttribute("id","GDPR_table_rejected");
var GDPR_row = document.createElement("tr");
var GDPR_cell = document.createElement("td");

var GDPR_accept_button = document.createElement("span");
GDPR_accept_button.setAttribute("id","GDPR_accept_button");
GDPR_accept_button.style.cursor="pointer";
GDPR_accept_button.appendChild(document.createTextNode("ACCEPT COOKIES"));

GDPR_accept_button.onclick=accept_cookies;

GDPR_table_rejected.appendChild(GDPR_row);
GDPR_row.appendChild(GDPR_cell);

GDPR_cell.appendChild(GDPR_accept_button);


GDPR_cell.appendChild(document.createElement("br"));

GDPR_cell.appendChild(document.createTextNode("This site requires the use of cookies to comply with the "));

var a = document.createElement('a');
var GDPR_link = document.createTextNode("GDPR ");
a.appendChild(GDPR_link);
a.href = "https://en.wikipedia.org/wiki/General_Data_Protection_Regulation";
a.title = a.href;
GDPR_cell.appendChild(a);

GDPR_cell.appendChild(document.createTextNode(" and "));

var a = document.createElement('a');
var GOOGLE_link = document.createTextNode("Google's privacy policy");
a.appendChild(GOOGLE_link);
a.href = "https://policies.google.com/privacy";
a.title = a.href;
GDPR_cell.appendChild(a);
GDPR_cell.appendChild(document.createTextNode(". Cookies are used for "));

var a = document.createElement('a');
var GOOGLE_ADS_link = document.createTextNode("ads personaliation");
a.appendChild(GOOGLE_ADS_link);
a.href = "https://policies.google.com/technologies/partner-sites";
a.title = a.href;
GDPR_cell.appendChild(a);
GDPR_cell.appendChild(document.createTextNode("."));

GDPR_cell.appendChild(document.createElement("br"));

document.body.appendChild(GDPR_table_rejected);

GDPR_table_rejected.style.width="100%";
GDPR_table_rejected.style.height="100%";
GDPR_table_rejected.style.backgroundColor="#f9f9f9";
GDPR_table_rejected.style.opacity="95%";
GDPR_table_rejected.style.textAlign="center";
GDPR_table_rejected.style.position="fixed";
GDPR_table_rejected.style.bottom="0";
GDPR_table_rejected.style.verticalAlign="middle"; /* some old IE convention */
/* accept button styles */
GDPR_accept_button.style.backgroundColor="#3f8a50";
GDPR_accept_button.style.color="#fffcf3";
GDPR_accept_button.style.padding="12px 20px";
GDPR_accept_button.style.border="none";
GDPR_accept_button.style.textAlign="center";
GDPR_accept_button.style.borderRadius=" 20px";
GDPR_accept_button.style.cursor="pointer";
GDPR_accept_button.style.fontSize="105%";
GDPR_accept_button.style.fontWeight="bold";
GDPR_accept_button.style.minWidth="160px";
GDPR_accept_button.style.display="inline-block";
GDPR_accept_button.style.margin="10px";
}