function toImage(url) {
let img = new Image();
img.src = url;
return img;
}
let DImages = ["https://thefundraisinggame.nl/kaarten/d1.gif", "https://thefundraisinggame.nl/kaarten/d2.gif", "https://thefundraisinggame.nl/kaarten/d3.gif"].map(toImage);
let AImages = ["https://thefundraisinggame.nl/kaarten/A1.gif", "https://thefundraisinggame.nl/kaarten/A2.gif", "https://thefundraisinggame.nl/kaarten/A3.gif"].map(toImage);
let GImages = ["https://thefundraisinggame.nl/kaarten/g1.gif", "https://thefundraisinggame.nl/kaarten/g2.gif", "https://thefundraisinggame.nl/kaarten/g3.gif"].map(toImage);
let KImages = ["https://thefundraisinggame.nl/kaarten/k1.gif", "https://thefundraisinggame.nl/kaarten/k2.gif", "https://thefundraisinggame.nl/kaarten/k3.gif"].map(toImage);
let MImages = ["https://thefundraisinggame.nl/kaarten/m1.jpg", "https://thefundraisinggame.nl/kaarten/m2.jpg", "https://thefundraisinggame.nl/kaarten/m3.jpg"].map(toImage);
let OImages = ["https://thefundraisinggame.nl/kaarten/o1.gif", "https://thefundraisinggame.nl/kaarten/o2.gif", "https://thefundraisinggame.nl/kaarten/o3.gif"].map(toImage);
let WImages = ["https://thefundraisinggame.nl/kaarten/w1.gif", "https://thefundraisinggame.nl/kaarten/w2.gif", "https://thefundraisinggame.nl/kaarten/w3.gif"].map(toImage);
let ZImages = ["https://thefundraisinggame.nl/kaarten/i1.gif", "https://thefundraisinggame.nl/kaarten/i2.gif", "https://thefundraisinggame.nl/kaarten/i3.gif"].map(toImage);
function pickRandom(imgArray) {
let index = Math.round(Math.random() * (imgArray.length - 1));
return imgArray[index]
}
function shuffle() {
document.images['DCard'].src = pickRandom(DImages).src;
document.images['ACard'].src = pickRandom(AImages).src;
document.images['GCard'].src = pickRandom(GImages).src;
document.images['KCard'].src = pickRandom(KImages).src;
document.images['MCard'].src = pickRandom(MImages).src;
document.images['OCard'].src = pickRandom(OImages).src;
document.images['WCard'].src = pickRandom(WImages).src;
document.images['ZCard'].src = pickRandom(ZImages).src;
}