// maximum of background pictures for the day and the night
var maxDay = 5;
var maxNight = 5;

// when do we see the daytime pictures?
var sunRise = 5;
var sunDown = 17;

// related to styles_backgrounds.css
function changeBackground()
{
   // determine the current hour
   var hours = (new Date()).getHours();
   var dayTime = hours >= sunRise && hours <= sunDown;

   // randomly choose a day or night background css class
   var randomNumber = Math.random() * (dayTime ? maxDay : maxNight);
   var bgId = Math.floor(randomNumber) + 1;
   var bgClassName = ( dayTime ? "day" : "night" ) + "_bg_" + bgId;

   // assign the background to the container
   var container = document.getElementById("niki-container");

   container.className = "niki-container " + bgClassName;
}

