﻿var backgroundSrcs = new Array("1.png", "2.png", "3.png", "4.png", "5.png", "6.png", "7.png")

function pickimage() {
    if (siteId == 1) {
    document.getElementById("contenttop").style.backgroundImage = "url(/images/contenttop.png)";
    }
    // skutslus
    else if (siteId == 2) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/skutslus/" + bgimage + ")";
    }
    //barte
    else if (siteId == 3) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
    // brege
    else if (siteId == 4) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
    //bolster
    else if (siteId == 5) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/bolster/" + bgimage + ")";
    }
    //finster
    else if (siteId == 6) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
    //klinkert
    else if (siteId == 7) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
    //terp
    else if (siteId == 8) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/opeterp/" + bgimage + ")";
    }
    //regenboog
    else if (siteId == 9) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
    //skeakel
    else if (siteId == 10) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
    //skoalfinne
    else if (siteId ==11) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
    //grovestins
    else if (siteId == 12) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/grovestin/" + bgimage + ")";
    }
    //stapstien
    else if (siteId == 13) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
    //swannenest
    else if (siteId == 14) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
    //nijegea
    else if (siteId == 15) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
    //walikker
    else if (siteId == 16) {
        var bgimage = backgroundSrcs[(Math.floor(Math.random() * (backgroundSrcs.length - 1)))]
        document.getElementById("contenttop").style.backgroundImage = "url(/images/" + bgimage + ")";
    }
}


