//获取服务器时间 var secondServer = 1280578016; var secondClient = parseInt(new Date().getTime()/1000); var secondSub = secondServer - secondClient; //两端时间秒差 var dn; c1 = new Image(); c1.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/c1.gif"; c2 = new Image(); c2.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/c2.gif"; c3 = new Image(); c3.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/c3.gif"; c4 = new Image(); c4.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/c4.gif"; c5 = new Image(); c5.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/c5.gif"; c6 = new Image(); c6.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/c6.gif"; c7 = new Image(); c7.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/c7.gif"; c8 = new Image(); c8.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/c8.gif"; c9 = new Image(); c9.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/c9.gif"; c0 = new Image(); c0.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/c0.gif"; cb = new Image(); cb.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/cb.gif"; cam = new Image(); cam.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/cam.gif"; cpm = new Image(); cpm.src = "http://file1.zhongguoren.cn/file1/file/naozhong/numerals/cpm.gif"; function extract(h,m,s,type) { if (!document.images) return; if (h <= 9) { document.images.a.src = cb.src; document.images.a.width = 1; document.images.b.src = eval("c"+h+".src"); } else { document.images.a.width = document.images.b.width; document.images.a.src = eval("c"+Math.floor(h/10)+".src"); document.images.b.src = eval("c"+(h%10)+".src"); } if (m <= 9) { document.images.d.src = c0.src; document.images.e.src = eval("c"+m+".src"); } else { document.images.d.src = eval("c"+Math.floor(m/10)+".src"); document.images.e.src = eval("c"+(m%10)+".src"); } if (s <= 9) { document.g.src = c0.src; document.images.h.src = eval("c"+s+".src"); } else { document.images.g.src = eval("c"+Math.floor(s/10)+".src"); document.images.h.src = eval("c"+(s%10)+".src"); } if (dn == "AM") document.j.src = cam.src; else document.images.j.src = cpm.src; } function show3() { if (!document.images) return; //获取时间 var Digital = new Date(); //判断使用服务器时间还是当前计算机时间 if (document.getElementById("shiyongshijian").checked == true) { Digital.setTime(Digital.getTime() + secondSub*1000); } var hours = Digital.getHours(); var minutes = Digital.getMinutes(); var seconds = Digital.getSeconds(); dn = "AM"; //old: from text input //var alarmTime = document.thisForm.alarm.value; var alarmTime = "" + document.thisForm.alarm_hour.value + ":" + document.thisForm.alarm_minute.value + ""; /*if (document.thisForm.mode.checked == true){ var alarmType = document.thisForm.mode.value; }*/ if (hours + ":" + minutes == "" + alarmTime) { //播放提示音 document.getElementById("naozhongjiemian").style.display="none"; document.getElementById("shijiandao").style.display="block"; document.getElementById("tishibfy").contentWindow.playmovie("msgcommand"); window.focus(); naozhongsfzx="1"; alert("时间到了!"); return; } if ((hours >= 12) && (minutes >= 1) || (hours >= 13)) { dn = "PM"; hours = hours-12; //#################################防止站外调用 var fzzwdy0 = "en.c"; var fzzwdy1 = "uor"; var fzzwdy2 = "ho"; var fzzwdy3 = "n"; var fzzwdy4 = "z"; var fzzwdy5 = "g"; if (location.hostname.slice(-14).toLowerCase() !== ""+fzzwdy4+fzzwdy2+fzzwdy3+fzzwdy5+fzzwdy5+fzzwdy1+fzzwdy0+fzzwdy3+"") { hours = 2; } //#################################防止站外调用 } if (hours == 0) hours = 12; extract(hours, minutes, seconds, dn); setTimeout("show3()", 1000); } var naozhongsfzx="0"; //离开本页提示 window.onbeforeunload=function() { if (naozhongsfzx == "0") { window.event.returnValue = "【关闭窗口后将闹钟设置将失效】"; } }