<!-- THREE STEPS TO INSTALL WEB CAM TIME:
1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Chris Herrod ([email protected]) -->
<!-- Web Site: http://members.nbci.com/chris_herrod -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var x = 121;
var y = 1;
function Reload() {
x = x - y;
document.form1.clock.value = "reload in " + x + " seconds";
timerID = setTimeout("Reload()", 1000);
}
var timerID = null;
var timerRunning = false;
function stopclock() {
if(timerRunning) clearTimeout(timerID);
timerRunning = false;
}
function showtime() {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var timeValue = "" + ((hours >12) ? hours -12 :hours);
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += (hours >= 12) ? " P.M." : " A.M.";
document.form2.time.value = "The current time is " + timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY onLoad="Reload();startclock()">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<table border=10 width="320">
<tr align=center valign=center>
<td align=center valign=center width="320" height="240">
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Chris Herrod ([email protected]) -->
<!-- Web Site: http://members.nbci.com/chris_herrod -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var address ="" ;
var time = new Date();
var ab = time.getHours();
if ( ab >= 6 && ab < 22) {
address = "http://yourdomain.com/online.jpg";
}
else {
address = "http://yourdomain.com/offline.jpg";
}
document.write("<img src='" + address + "'>");
// End -->
</script>
</td>
</tr>
<tr align=center valign=center>
<td align=center valign=center width="320">
<form name="form1">
<input type=text name="clock" size=30 value="Web Cam is Loading...">
</form>
</td>
</tr>
<tr align=center valign=center>
<td align=center valign=center width="320">
<form name="form2">
<input type=text name="time" size=30>
</form>
</td>
</tr>
</table>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 2.95 KB -->