You could skip the switch and just name the images 'day0.jpg', 'day1.jpg', etc.var d = new Date();d = d.getDay();document.body.style.backgroundIm... = "url('day"+d+".jpg')";