lt;script type="text/javascript">
var cancel_flag = 0;
var already = 0;
/* 網頁一載入執行的操作*/
window.onload = reboot();
/* 重啟按鈕的點選動作*/
function reboot(){
if(confirm("這個操作會斷開現在所有的連接,並且重新啟動您的設備,確定要繼續操作嗎? ")){
document.getElementById("reboot_pre_time").innerHTML = 4;
document.getElementById("reboot_ing_time").innerHTML = 14;
document.all.promress_reML. ;
download_flag = 0;
cancel_flag = 0;
already = 0;
setTimeout("showDiv('reboot_pre')",500);
delayayPreboot(Dayay" 🎜>}
}
/* 重啟準備彈窗計時5秒*/
function delayPre_reboot(str) {
if(!cancel_flag){
var delay = document.getElementBycancel_flag){
var delay = document. ).innerHTML;
if(delay > 0) {
delay--;
document.getElementById(str).innerHTML = delay;
setTimeout("delayPre_reboot('reboot_pre_time'reboot_pre_time)" );
} else {
hideDiv("reboot_pre");
setTimeout("showDiv('reboot_ing')",500);
delayDo_reboot("reboot_ing_time"); 🎜>}
}
/* 重新啟動進行中彈窗計時15秒*/
function delayDo_reboot(str){
display_reboot(100);
var delay = strument.Elementb = document. ).innerHTML;
if(delay > 0) {
delay--;
document.getElementById(str).innerHTML = delay;
setTimeout("delayDo_reboot('reboot_ing_time'reboot_ing_time')" );
} else {
hideDiv("reboot_ing");
alert("重啟成功! ");
}
}
/* 重新啟動準備時取消按鈕的事件*/
function reboot_cancel(){
cancel_flag = 1;
hideDiv("reboot_pre");
alert("您已經成功取消了重啟操作!");
}
/* 顯示彈窗*/
function showDiv (str){
document.getElementById(str). style.visibility = "visible";
}
/* 隱藏彈窗*/
function hideDiv (str){
document.getElementById(str).style.visibility = "hidden";
}
/* 重啟進行中彈窗計時,緩衝條的移動*/
function display_reboot(max){
already ;
var dispObj = document.all
dispObj.style.width = 100.0*already/max "px";
document.all.progress_reboot.innerHTML = "|||||";
var timer = window.setTimeout("display( " max ")",1000);
if (already >= max){
window.clearTimeout(timer);
}
}