<html>

<head>
   <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
   <style>
      body {
         font-size: x-small;
         font-family: "tahoma", "sans-serif", "arial", "helvetica";
         color: #5f5f5f;
         background-color: #ffffff;
      }
   </style>
   <script language="javascript">
      var msg = new Array();
      msg[0] = 'Uploading is in progress. The Broadband Router will reboot upon completion. This process will take about 2 minutes.';
      msg[1] = 'Image uploading failed. The system is out of memory. The Broadband Router is rebooting.';
      msg[2] = 'Image uploading failed. No image file was selected.';
      msg[3] = 'Image uploading failed. The selected file contains an illegal image.';
      msg[4] = 'PMD calibration file was updated. The Broadband Router needs to be rebooted for the update to take effect.';
      msg[5] = 'PMD temp2apd file was updated. The Broadband Router needs to be rebooted for the update to take effect.';
      msg[6] = 'PMD json file was updated. The Broadband Router needs to be rebooted for the update to take effect.';
      msg[7] = "Decryption of configuration file failed.The uploaded configuration file cannot be decrypted using the current encryption Key.";
      msg[8] = 'Fatal error during image uploading.';

      var idxStr = '<%ejGetOther(sysInfo, upldSts)%>';

      function getMsgIndex() {
         var idxNum = parseInt(idxStr);
         if (isNaN(idxNum) || idxNum < 0 || idxNum > 8)
            idxNum = 8;

         return idxNum;
      }

      function reboot() {
         var enblPopWin = '<%ejGet(enblPopWin)%>';
         var loc = 'main.html';
         var code = 'window.top.location="' + loc + '"';

         if (enblPopWin == '1') {
            loc = 'index.html';
            code = 'location="' + loc + '"';
         }

         eval(code);
      }

      function frmLoad() {
         // only reboot if upload progress is successful
         if (getMsgIndex() == 0)
            setTimeout('reboot()', 40000);
      }

      function btnBack() {
         var code = 'location="' + 'upload.html';

         if (<% ejGet(glbUploadMode) %> == 2)
            code = 'location="' + 'updatesettings.html';
         if (getMsgIndex() == 4)
            code = 'location="' + 'pmdcalibrationupload.cgi';
         if (getMsgIndex() == 5)
            code = 'location="' + 'pmdtemp2apdupload.cgi';
         if (getMsgIndex() == 6)
            code = 'location="' + 'pmdjsonupload.cgi';

         code += '"';
         eval(code);
      }
   </script>
</head>

<body onLoad='frmLoad()'>
   <blockquote> <b>Broadband Router Update</b><br>
      <br>
      <script language="javascript">
         document.write(msg[getMsgIndex()]);
      </script>
      <br>
      <br>
      <center>
         <input type='button' onClick='btnBack()' value='Back'>
      </center>
   </blockquote>
</body>

</html>