this me
12-08-2006, 05:14 PM
this is a talking clock for IE but i want it to work with fire fox, any one knows how?
<html>
<head>
<title>Talking clock javascript example.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="talking clock, talking clock javascript, javascript, clock javascript, time interval, time spoken.">
<meta name="description" content="This is an example of the talking clock javascript. The time is spoken at a time interval of 10 seconds. You can set this to whatever time interval you like.">
</head>
<body bgcolor="#FFFFFF">
<script>
// Edit speaking interval (seconds)
var speakinginterval=10
// Do not edit the code below this line
var thistime= new Date()
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var ampm
speakinginterval=1000*speakinginterval
if (hours<12) {
ampm="am"
}
else if (hours>=12) {
ampm="pm"
if (hours!=12) {
hours=hours-12
}
}
function speakthetimeis() {
document.all.typesound.src="http://www.**************/games/soundfiles/the_time_is.wav"
var timer=setTimeout("speakhours()",1200)
}
function speakhours() {
document.all.typesound.src="http://www.**************/games/soundfiles/"+hours+".wav"
if (minutes<10) {
var timer=setTimeout("speakzerominutes()",1200)
}
else {
var timer=setTimeout("speakminutes()",1200)
}
}
function speakzerominutes() {
document.all.typesound.src="soundfiles/0.wav"
var timer=setTimeout("speakminutes()",600)
}
function speakminutes() {
document.all.typesound.src="http://www.**************/games/soundfiles/"+minutes+".wav"
var timer=setTimeout("speakampm()",1200)
}
function speakampm() {
document.all.typesound.src="http://www.**************/games/soundfiles/"+ampm+".wav"
thistime= new Date()
hours=thistime.getHours()
minutes=thistime.getMinutes()
if (hours<12) {
ampm="am"
}
else if (hours>=12) {
ampm="pm"
if (hours!=12) {
hours=hours-12
}
}
var content="<embed src=\"soundfiles/"+hours+".wav\" autostart=\"false\" hidden=\"true\">"
content+="<embed src=\"soundfiles/"+minutes+".wav\" autostart=\"false\" hidden=\"true\">"
soundcontainer.innerHTML=content
var timer=setTimeout("speakthetimeis()",speakinginterval)
}
if (document.all) {
document.write("<span id=\"soundcontainer\" style=\"position:relative;\">")
document.write("<embed src=\"soundfiles/"+hours+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("<embed src=\"soundfiles/"+minutes+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("<embed src=\"soundfiles/"+ampm+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("</span>")
document.write("<embed src=\"soundfiles/0.wav\" autostart=\"false\" hidden=\"true\">")
document.write("</span>")
window.onload=speakthetimeis
}
</script> <embed src="http://www.**************/games/soundfiles/the_time_is.wav" autostart="false" hidden="true">
<bgsound id="typesound"> </embed>
</body>
</html>
<html>
<head>
<title>Talking clock javascript example.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="talking clock, talking clock javascript, javascript, clock javascript, time interval, time spoken.">
<meta name="description" content="This is an example of the talking clock javascript. The time is spoken at a time interval of 10 seconds. You can set this to whatever time interval you like.">
</head>
<body bgcolor="#FFFFFF">
<script>
// Edit speaking interval (seconds)
var speakinginterval=10
// Do not edit the code below this line
var thistime= new Date()
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var ampm
speakinginterval=1000*speakinginterval
if (hours<12) {
ampm="am"
}
else if (hours>=12) {
ampm="pm"
if (hours!=12) {
hours=hours-12
}
}
function speakthetimeis() {
document.all.typesound.src="http://www.**************/games/soundfiles/the_time_is.wav"
var timer=setTimeout("speakhours()",1200)
}
function speakhours() {
document.all.typesound.src="http://www.**************/games/soundfiles/"+hours+".wav"
if (minutes<10) {
var timer=setTimeout("speakzerominutes()",1200)
}
else {
var timer=setTimeout("speakminutes()",1200)
}
}
function speakzerominutes() {
document.all.typesound.src="soundfiles/0.wav"
var timer=setTimeout("speakminutes()",600)
}
function speakminutes() {
document.all.typesound.src="http://www.**************/games/soundfiles/"+minutes+".wav"
var timer=setTimeout("speakampm()",1200)
}
function speakampm() {
document.all.typesound.src="http://www.**************/games/soundfiles/"+ampm+".wav"
thistime= new Date()
hours=thistime.getHours()
minutes=thistime.getMinutes()
if (hours<12) {
ampm="am"
}
else if (hours>=12) {
ampm="pm"
if (hours!=12) {
hours=hours-12
}
}
var content="<embed src=\"soundfiles/"+hours+".wav\" autostart=\"false\" hidden=\"true\">"
content+="<embed src=\"soundfiles/"+minutes+".wav\" autostart=\"false\" hidden=\"true\">"
soundcontainer.innerHTML=content
var timer=setTimeout("speakthetimeis()",speakinginterval)
}
if (document.all) {
document.write("<span id=\"soundcontainer\" style=\"position:relative;\">")
document.write("<embed src=\"soundfiles/"+hours+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("<embed src=\"soundfiles/"+minutes+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("<embed src=\"soundfiles/"+ampm+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("</span>")
document.write("<embed src=\"soundfiles/0.wav\" autostart=\"false\" hidden=\"true\">")
document.write("</span>")
window.onload=speakthetimeis
}
</script> <embed src="http://www.**************/games/soundfiles/the_time_is.wav" autostart="false" hidden="true">
<bgsound id="typesound"> </embed>
</body>
</html>