Time rotating images

liunx

Guest
I have a script on my site 1100kfnx.com that shows different images depending on the visitor's clock (I think). As seen below, it varis from hour to hour. But how can I make it so the images seen below are shown during their respective times Monday-Friday only, and either a separate set of images or just one generic one is shown on weekends? You can see example at the site.<br />
<br />
<script><br />
<br />
//Time of day message script- by javascriptkit.com<br />
//Visit JavaScript Kit (<!-- m --><a class="postlink" href="http://javascriptkit.com">http://javascriptkit.com</a><!-- m -->) for script<br />
//Credit must stay intact for use<br />
<br />
var Digital=new Date()<br />
var hours=Digital.getHours()<br />
<br />
//Configure message below to your own.<br />
if (hours>=6&&hours<9) //MORNING<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/morning.gif" border=0>')<br />
else if (hours>=9&&hours<10) //SAM<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/drsam.gif" border=0>')<br />
else if (hours>=10&&hours<11) //SYDNEY<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/sydney.gif" border=0>')<br />
else if (hours>=11&&hours<13) //MOHAN<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/mohan.gif" border=0>')<br />
else if (hours>=13&&hours<15) //CHARLES<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/charles.gif" border=0>')<br />
else if (hours>=15&&hours<18) //NEWCOMB<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/newcomb.gif" border=0>')<br />
else if (hours>=18&&hours<20) //DAYL<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/dayl.gif" border=0>')<br />
else if (hours>=20&&hours<22) //BOLLING<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/bolling.gif" border=0>')<br />
else if (hours>=22&&hours<1) //VORTEX<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/vortex.gif" border=0>')<br />
else if (hours>=1&&hours<5) //HOT<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/hottalk.gif" border=0>')<br />
<br />
</script><br />
<br />
Thanks<!--content-->Please try the following, you will need an image for sat & sun<br />
<br />
<br />
<script><br />
<br />
//Time of day message script- by javascriptkit.com<br />
//Visit JavaScript Kit (<!-- m --><a class="postlink" href="http://javascriptkit.com">http://javascriptkit.com</a><!-- m -->) for script<br />
//Credit must stay intact for use<br />
<br />
var Digital=new Date()<br />
var hours=Digital.getHours()<br />
var day=Digital.getDay()<br />
<br />
if(day>0&&day<6){<br />
//Configure message below to your own.<br />
if (hours>=6&&hours<9) //MORNING<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/morning.gif" border=0>')<br />
else if (hours>=9&&hours<10) //SAM<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/drsam.gif" border=0>')<br />
else if (hours>=10&&hours<11) //SYDNEY<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/sydney.gif" border=0>')<br />
else if (hours>=11&&hours<13) //MOHAN<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/mohan.gif" border=0>')<br />
else if (hours>=13&&hours<15) //CHARLES<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/charles.gif" border=0>')<br />
else if (hours>=15&&hours<18) //NEWCOMB<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/newcomb.gif" border=0>')<br />
else if (hours>=18&&hours<20) //DAYL<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/dayl.gif" border=0>')<br />
else if (hours>=20&&hours<22) //BOLLING<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/bolling.gif" border=0>')<br />
else if (hours>=22&&hours<1) //VORTEX<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/vortex.gif" border=0>')<br />
else if (hours>=1&&hours<5) //HOT<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/kfnx/images/onair/hottalk.gif" border=0>')<br />
}<br />
<br />
if(day==6||day==0){<br />
document.write('<img src=http://www.webdeveloper.com/forum/archive/index.php/"/SATURDAY AND SUNDAY IMAGE.gif" border=0>')<br />
}<br />
</script><!--content-->Works on dummy site, will transfer. Thanks a lot, I've been trying to figure that out for a looong time<!--content-->
 
Back
Top