You'll need to substitute your URLs to the images as I have done for this week...
<html>
<head>
<title> Week of Year Display </title>
<script type="text/javascript">
// For: http://www.webdeveloper.com/forum/showthread.php?t=244093
Date.prototype.getWeek = function() {
var onejan = new Date(this.getFullYear(),0,1);
return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
}
var imgList = [
'url.image0.jpg', 'url.image1.jpg', 'url.image2.jpg', 'url.image3.jpg', 'url.image4.jpg',
'url.image5.jpg', 'url.image6.jpg', 'url.image7.jpg', 'url.image8.jpg', 'url.image9.jpg',
'url.image10.jpg', 'url.image11.jpg', 'url.image12.jpg', 'http://www.nova.edu/hpd/otm/pics/4fun/PANIC.JPG', 'url.image14.jpg',
'url.image15.jpg', 'url.image16.jpg', 'url.image17.jpg', 'url.image18.jpg', 'url.image19.jpg',
'url.image20.jpg', 'url.image21.jpg', 'url.image22.jpg', 'url.image23.jpg', 'url.image24.jpg',
'url.image25.jpg', 'url.image26.jpg', 'url.image27.jpg', 'url.image28.jpg', 'url.image29.jpg',
'url.image30.jpg', 'url.image31.jpg', 'url.image32.jpg', 'url.image33.jpg', 'url.image34.jpg',
'url.image35.jpg', 'url.image36.jpg', 'url.image37.jpg', 'url.image38.jpg', 'url.image39.jpg',
'url.image40.jpg', 'url.image41.jpg', 'url.image42.jpg', 'url.image43.jpg', 'url.image44.jpg',
'url.image45.jpg', 'url.image46.jpg', 'url.image47.jpg', 'url.image48.jpg', 'url.image49.jpg',
'url.image50.jpg', 'url.image51.jpg' // Note: No comma after last entry
];
function showImage() {
var today = new Date();
var weekno = today.getWeek();
document.getElementById('WeeklyImage').src = imgList[weekno];
document.getElementById('WeeklyImage').alt = imgList[weekno];
// alert(weekno+'\t'+imgList[weekno]);
}
</script>
</head>
<body onload="showImage()">
<img id="WeeklyImage" src="" alt="Image of the Week" style="height:100px; width:100px">
</body>
</html>
... and if the change of image on MONDAY is critical to you,
you'll need to add some extra logic for this to happen.
Good Luck!
