home *** CD-ROM | disk | FTP | other *** search
/ 221.214.14.186 / 221.214.14.186.tar / 221.214.14.186 / ly / tancheng / clock.js < prev    next >
Text File  |  2003-09-22  |  2KB  |  68 lines

  1. function Year_Month(){ 
  2.     var now = new Date(); 
  3.     var yy = now.getYear(); 
  4.     var mm = now.getMonth()+1; 
  5.     var cl = '<font color="#0000df">'; 
  6.     if (now.getDay() == 0) cl = '<font color="#c00000">'; 
  7.     if (now.getDay() == 6) cl = '<font color="#00c000">'; 
  8.     return(cl +  yy + '─Ω' + mm + '╘┬</font>'); 
  9.  
  10. function Date_of_Today(){ 
  11.     var now = new Date(); 
  12.     var cl = '<font color="#0000df">'; 
  13.     if (now.getDay() == 0) cl = '<font color="#c00000">'; 
  14.     if (now.getDay() == 6) cl = '<font color="#00c000">'; 
  15.     return(cl +  now.getDate() + '</font>'); 
  16.  
  17. function Day_of_Today(){ 
  18.     var day = new Array(); 
  19.     day[0] = "╨╟╞┌╚╒"; 
  20.     day[1] = "╨╟╞┌╥╗"; 
  21.     day[2] = "╨╟╞┌╢■"; 
  22.     day[3] = "╨╟╞┌╚²"; 
  23.     day[4] = "╨╟╞┌╦─"; 
  24.     day[5] = "╨╟╞┌╬σ"; 
  25.     day[6] = "╨╟╞┌┴∙"; 
  26.     var now = new Date(); 
  27.     var cl = '<font color="#0000df">'; 
  28.     if (now.getDay() == 0) cl = '<font color="#c00000">'; 
  29.     if (now.getDay() == 6) cl = '<font color="#00c000">'; 
  30.     return(cl +  day[now.getDay()] + '</font>'); 
  31.  
  32. function CurentTime(){ 
  33.     var now = new Date(); 
  34.     var hh = now.getHours(); 
  35.     var mm = now.getMinutes(); 
  36.     var ss = now.getTime() % 60000; 
  37.     ss = (ss - (ss % 1000)) / 1000; 
  38.     var clock = hh+':'; 
  39.     if (mm < 10) clock += '0'; 
  40.     clock += mm+':'; 
  41.     if (ss < 10) clock += '0'; 
  42.     clock += ss; 
  43.     return(clock); 
  44.  
  45. function refreshCalendarClock(){ 
  46. document.all.calendarClock1.innerHTML = Year_Month(); 
  47. document.all.calendarClock2.innerHTML = Date_of_Today(); 
  48. document.all.calendarClock3.innerHTML = Day_of_Today(); 
  49. document.all.calendarClock4.innerHTML = CurentTime(); 
  50.  
  51. function getCalendarClockFreeCodeMsg(nn){ 
  52.     if (nn == 'off') CalendarClockFreeCode.style.visibility = 'hidden'; 
  53.     else { 
  54.        CalendarClockFreeCode.style.visibility = 'visible'; 
  55.        setTimeout("getCalendarClockFreeCodeMsg('off')",10000); 
  56.     } 
  57.  
  58. document.write('<font id="calendarClock1" style="font-family:╦╬╠σ;font-size:7pt;line-height:120%"></font><br>');
  59. document.write('<font id="calendarClock2" style="font-family:Arial;font-size:14pt;line-height:120%"> </font><br>');
  60. document.write('<font id="calendarClock3" style="font-family:╦╬╠σ;font-size:9pt;line-height:120%"> </font><br>');
  61. document.write('<font id="calendarClock4" style="color:#100080;font-family:╦╬╠σ;font-size:8pt;line-height:120%"></font>');
  62. setInterval('refreshCalendarClock()',1000);