<!--TIME OF DAY GREETING--> <!-- 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 sivamtime() { now=new Date(); hour=now.getHours(); var morning = "Good morning!"; // Users can modify the messages at left to best suit their needs var noon = "It's noon!"; var afternoon = "Good afternoon!"; var evening = "Good evening!"; var late_night = "Don't you think you need to get some sleep?"; if (hour >= 7 && hour < 12) { alert(morning); return; } if (hour == 12) { alert(noon); return; } if (hour > 12 && hour < 17) { alert(afternoon); return; } if (hour >= 17 && hour < 22) { alert(evening); return; } else { alert(late_night); return; } } sivamtime() // --> </script> <body>