Hello;
First let me start with that I have not done any scripting in a few years, until i landed this job, my first task was to upgrade the company's website, so I thought it would be great to have the head of the site change according to time of day. Well I can't get the page to display anything. I have an external CSS for the formatting of the headings and the body, but nothing display at all.

So i was wondering if someone could lead me in the right direction I will post both the CSS and javascript, although i think the css is right
CODE
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="STYLESHEET" href="New.css" type="text/css"/>
<script language = "javascript">
day=new Date(); //..get the date
hours=day.getHours(); //..get the hour
if(hours>=0 && hours<5)
{
document.write('<img src="night.JPG" width="800" height="600" alt="" border="0">');
}
else
if(hours>=5 && hours<7)
{
document.write("<img src="sunrise2 (2).jpg" width="120" height="90" alt="" border="0">");
}
else
if(hours>=7 && hours<12)
{
document.write("<img src= "morning2.jpg" width= "800" height="534" alt="" border='0'>");
}
else
if(hours>=12 && hours<16)
{
//document.write('<img src="afternoon.jpg" width='300' height='150' border='5'>');
alert("hello");
}
else
if(hours>=16 && hours<20)
{
document.write('<img src="evening.jpg" width="120" height="90" alt="" border="0">');
alert("this is a test");
}
else
if (hours>=20 && hours<24)
{
document.write('<img src="night.JPG" width="800" height="600" alt="" border="0">');
alert("hello");
}
and here is the CSS
CODE
body {
background-color: #FFFFF0;
font-family: Arial, Verdana, sans-serif;
font-size: 18px;
color: #00008B;
}
a { font-family: Arial, Verdana, sans-serif; font-size: 18px; color: #483D8B; text-decoration: underline}
a:hover { font-family: Arial, Verdana, sans-serif; font-size: 18px; color: #A52A2A; background-color: #FAEBD7}
h1 { font-family: Arial, Verdana, sans-serif; font-size: 32px; color: #A52A2A }
h2 { font-family: Arial, Verdana, sans-serif; font-size: 24px; color: #A52A2A }
hr{ color:brown; background-color:tan; width:90%; height:2px; }
table {
font-family: Arial, Verdana, sans-serif;
font-size: 18px;
color: #00008B;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
}
.note {
font-family: Arial, Verdana, sans-serif;
font-size: 14px;
color: purple;
font-weight: bold;
}
This post has been edited by shawnr72: 29 Jul, 2008 - 11:34 AM