Kod:
<!-- START OF SCRIPT -->
<!-- For more scripts visit http://www.netpedia.com -->
<script>
<!--**HIDE ME FROM THAT BROWSER**-- !>
var timerID = null
var timerRunning = false
function stopclock(){
****// cannot directly test timerID on DEC OSF/1 in beta 4.
****if(timerRunning)
********clearTimeout(timerID)
****timerRunning = false
}
function startclock(){
**** // Make sure the clock is stopped
****stopclock()
****showtime()
}
function showtime(){
****var now = new Date()
****var hours = now.getHours()
****var minutes = now.getMinutes()
****var seconds = now.getSeconds()
****var month = now.getMonth()
****var datum = now.getDate()
****var year = now.getYear()
****var timeValue = ((hours<4)?"Good night":(hours<10)?"Good morning":((hours<12)?"Good day":((hours<18)?"Good afternoon":((hours<23)?"Good evening":"Good night"))))
****var timeValue2 = "The time is: " + ((hours > 12) ? hours - 12 : hours)
****timeValue2 += ((minutes < 10) ? ":0" : ":") + minutes
****timeValue2 += ((seconds < 10) ? ":0" : ":") + seconds
****timeValue2 += (hours >= 12) ? " P.M." : " A.M."
****var timeValue3 = "On " + datum + "/"
****timeValue3 += (((month + 1) < 10) ? "0" : "") + (month + 1)
//****timeValue3 += ((month=0)?"January":((month=1)?"February":((month=2)?"March":((month=3)?"April":((month=4)?"May":((month=5)?"June":((month=6)?"July":((month=7)?"August":((month=8)?"September":((month=9)?"October":((month=10)?"November":((month=11)?"December":(("month=12"))))))))))))
****** timeValue3 += "/" + "'" + year
//****timeValue3 += ((seconds < 10) ? ":0" : ":") + seconds
//****timeValue3 += (hours >= 12) ? " P.M." : " A.M."
****
****document.clock.face.value = timeValue
****document.clock.face2.value = timeValue2
****document.clock.face3.value = timeValue3
****timerID = setTimeout("showtime()",1000)
****timerRunning = true
}
//-->
</SCRIPT>
</HEAD>
<BODY TEXT="#000080" onLoad="startclock()">
<FORM NAME="clock" onSubmit="0">
<INPUT TYPE="text" NAME="face" SIZE=20 VALUE ="">
<INPUT TYPE="text" NAME="face2" SIZE=20 VALUE ="">
<INPUT TYPE="text" NAME="face3" SIZE=20 VALUE ="">
</FORM>
<!-- END OF SCRIPT -->