<!-- TIME OF DAY BACKGROUND IMAGE --> <!-- This part can go in the HEAD of the html file --> <script language="JavaScript" type="text/javascript"> <!-- Copyright 2005, Sandeep Gangadharan --> <!-- For more free scripts go to http://sivamdesign.com/scripts/ --> <!-- function timeBg() { var morning = "morning.jpg"; // change the name of image on the left to suit your needs var noon = "noon.jpg"; // change the name of image on the left to suit your needs var evening = "evening.jpg"; // change the name of image on the left to suit your needs var night = "night.jpg"; // change the name of image on the left to suit your needs now = new Date(); hour = now.getHours(); if (hour >= "6" && hour < 12) { document.body.background = morning; } else if (hour >= "12" && hour < 15) { document.body.background = noon; } else if (hour >= "15" && hour < 20) { document.body.background = evening; } else { document.body.background = night; } } //--> </script> <!-- Note the script in the BODY tag --> <body onLoad="timeBg()">