<script language="JavaScript">
<!--
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)?"You're up late!":(hours<10)?"Good morning!":((hours<12)?"Good day!":((hours<18)?"Good afternoon!":((hours<23)?"Good evening!":"You're up late!"))))

    var timeValue2 = "The time is: " + ((hours > 12) ? hours - 12 : hours)

    timeValue2 += ((minutes < 10) ? ":0" : ":") + minutes

    timeValue2 += ((seconds < 10) ? ":0" : ":") + seconds

    timeValue2 += (hours >= 12) ? " PM" : " AM"

    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) ? " PM" : " AM"

    
    document.clock.face.value = timeValue

    document.clock.face2.value = timeValue2

    document.clock.face3.value = timeValue3

    timerID = setTimeout("showtime()",1000)

    timerRunning = true

}
//-->
</script></head>
<body onload="startclock()">
<center><h1>Clock and Greeting</h1></center>
<center><form name="clock">
<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></center>
