※ 鬧鐘 ※
|
<body bgcolor="#FFFFFF" onload="init();return true" background="jpg/01_bkg1.jpg"> <div align="center"><center> <table border="0"> <tr> <td><font color="#FFFFFF" size="6"><script language="JavaScript"> <!-- hide script from old browser var shour=0 var sminute=0 var string="Time is up!" function init(){ document.setform.atime.value="0:00:00 AM" clock() } function clock(){ var time = new Date() var hour = time.getHours() var minute = time.getMinutes() var second = time.getSeconds() var timevalue = ""+((hour > 12) ? hour-12:hour) timevalue +=((minute < 10) ? ":0":":")+minute timevalue +=((second < 10) ? ":0":":")+second timevalue +=((hour >12 ) ? " PM":" AM") document.setform.now.value = timevalue if ((hour==shour) && (minute==sminute) && (second==0) && (document.setform.alarm[0].checked)) alert(string) else if ((minute==0) && (second==0) && (document.setform.hourbeep[0].checked)) alert("Hourly Beep!") setTimeout("clock()",1000) } function setup(){ if ((document.setform.sethour.value<0) || (document.setform.sethour.value>23)) alert("Hour設定超出範圍") else if ((document.setform.setminute.value<0) || (document.setform.setminute.value>59)) alert("Minute設定超出範圍") else { if (document.setform.sethour.value!="") shour=document.setform.sethour.value if (document.setform.setminute.value!="") sminute=document.setform.setminute.value var alarmvalue = ""+((shour > 12) ? shour-12:shour) alarmvalue +=((sminute < 10) ? ":0":":")+sminute+":00" alarmvalue +=((shour > 12 ) ? " PM":" AM") document.setform.atime.value = alarmvalue document.setform.sethour.value="" document.setform.setminute.value="" } } function setmessage() { if (document.setform.message.value!="") string=document.setform.message.value document.setform.message.value="" } // end hiding --> </script><script language="JavaScript"> <!-- hide script from old browser var shour=0 var sminute=0 var string="Time is up!" function init(){ document.setform.atime.value="0:00:00 AM" clock() } function clock(){ var time = new Date() var hour = time.getHours() var minute = time.getMinutes() var second = time.getSeconds() var timevalue = ""+((hour > 12) ? hour-12:hour) timevalue +=((minute < 10) ? ":0":":")+minute timevalue +=((second < 10) ? ":0":":")+second timevalue +=((hour >12 ) ? " PM":" AM") document.setform.now.value = timevalue if ((hour==shour) && (minute==sminute) && (second==0) && (document.setform.alarm[0].checked)) alert(string) else if ((minute==0) && (second==0) && (document.setform.hourbeep[0].checked)) alert("Hourly Beep!") setTimeout("clock()",1000) } function setup(){ if ((document.setform.sethour.value<0) || (document.setform.sethour.value>23)) alert("Hour設定超出範圍") else if ((document.setform.setminute.value<0) || (document.setform.setminute.value>59)) alert("Minute設定超出範圍") else { if (document.setform.sethour.value!="") shour=document.setform.sethour.value if (document.setform.setminute.value!="") sminute=document.setform.setminute.value var alarmvalue = ""+((shour > 12) ? shour-12:shour) alarmvalue +=((sminute < 10) ? ":0":":")+sminute+":00" alarmvalue +=((shour > 12 ) ? " PM":" AM") document.setform.atime.value = alarmvalue document.setform.sethour.value="" document.setform.setminute.value="" } } function setmessage() { if (document.setform.message.value!="") string=document.setform.message.value document.setform.message.value="" } // end hiding --> </script></font></td> </tr> </table> </center></div> <hr> <form method="POST" name="setform"> <p align="center">現在時間<input type="text" size="11" name="now" onfocus="blur()"> Hourly Beep<input type="radio" checked name="hourbeep">On <input type="radio" name="hourbeep">Off<br> 鬧鐘時間<input type="text" size="11" name="atime" onfocus="blur()"> Alarm <input type="radio" name="alarm">On <input type="radio" checked name="alarm">Off</p> <hr> <p align="center">設定鬧鐘時間 : Hour <input type="text" size="2" name="sethour"> Minute <input type="text" size="2" name="setminute"> <input type="button" name="button1" value="Set" onclick="setup()"><br> 設定鬧鐘訊息 : <input type="text" size="30" name="message" onchange="setmessage()"></p> </form> <hr> |