<!DOCTYPE HTML>
<!-- Copyright (c) 2014-2015 Texas Instruments Incorporated.  All rights reserved. -->
<html>
  <head>
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
    <title>Stellaris S2E Module Miscellaneous Settings</title>
    <link rel="stylesheet" type="text/css" href="styles.css"/>
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>
    <!--#ipvars--><!--#snvars--><!--#gwvars-->
    <script type="text/javascript" language="JavaScript"><!--
      function CheckDefaults(myForm)
      {
        var answer = confirm("This will erase all existing configuration changes and restore factory default settings. Click OK if you are sure you want to do this or Cancel to retain existing settings.");
        if(answer == false)
        {
          alert("Existing configuration settings have been retained.");
        }
        return(answer);
      }
      function FindAndSelect(selectBox, value)
      {
        var i = 0;
        for(i = 0; i < selectBox.length; i++)
        {
          if(selectBox.options[i].value == value)
          {
            selectBox.selectedIndex = i;
            return;
          }
        }
      }
      function SetIPState()
      {
        var staticip = document.ip.staticip.value;
        var disable;
        if(staticip == 0)
        {
          disable = true;
        }
        else
        {
          disable = false;
        }
        document.ip.sip1.disabled = disable;
        document.ip.sip2.disabled = disable;
        document.ip.sip3.disabled = disable;
        document.ip.sip4.disabled = disable;
        document.ip.mip1.disabled = disable;
        document.ip.mip2.disabled = disable;
        document.ip.mip3.disabled = disable;
        document.ip.mip4.disabled = disable;
        document.ip.gip1.disabled = disable;
        document.ip.gip2.disabled = disable;
        document.ip.gip3.disabled = disable;
        document.ip.gip4.disabled = disable;
      }
      function SetFormDefaults()
      {
        FindAndSelect(document.ip.staticip, staticip);
        document.ip.sip1.value = sip1;
        document.ip.sip2.value = sip2;
        document.ip.sip3.value = sip3;
        document.ip.sip4.value = sip4;
        document.ip.mip1.value = mip1;
        document.ip.mip2.value = mip2;
        document.ip.mip3.value = mip3;
        document.ip.mip4.value = mip4;
        document.ip.gip1.value = gip1;
        document.ip.gip2.value = gip2;
        document.ip.gip3.value = gip3;
        document.ip.gip4.value = gip4;
        if(staticip == 1)
        {
          SetIPState(false);
        }
        else
        {
          SetIPState(true);
        }
      }
      //-->
    </script>
  </head>
  <body onload="SetFormDefaults();">
    <table width="100%">
      <tbody>
        <tr>
          <td align="left" valign="top" width="75%">
            <center>
              <h2 align="center">S2E Miscellaneous Settings</h2>
            </center>
            <hr size="2" width="100%">
            <table>
              <tbody>
                <tr>
                  <td class="gr">Name:</td>
                  <td><b><!--#modname--></b></td>
                </tr>
                <tr>
                  <td class="gr" width="25%">IP Address:</td>
                  <td><!--#ipaddr--></td>
                </tr>
                <tr>
                  <td class="gr">MAC Address:</td>
                  <td><!--#macaddr--></td>
                </tr>
              </tbody>
            </table>

            <h3>IP Address Selection</h3>
            <form action="ip.cgi" method="get" name="ip">
              <table border="1" cellpadding="2" cellspacing="2" width="100%">
                <tbody>
                  <tr>
                    <td class="gr">Address Type:&nbsp;</td>
                    <td>
                      <select size="1" name="staticip" onchange="SetIPState();">
                        <option value="0">DHCP/AutoIP</option>
                        <option value="1">Static IP</option>
                      </select>
                    </td>
                  </tr>
                  <tr>
                    <td class="gr">Static IP Address:&nbsp;</td>
                    <td>
                      <input maxlength="3" size="3" name="sip1">.
                      <input maxlength="3" size="3" name="sip2">.
                      <input maxlength="3" size="3" name="sip3">.
                      <input maxlength="3" size="3" name="sip4">
                    </td>
                  </tr>
                  <tr>
                    <td class="gr">Subnet Mask:&nbsp; </td>
                    <td>
                      <input maxlength="3" size="3" name="mip1">.
                      <input maxlength="3" size="3" name="mip2">.
                      <input maxlength="3" size="3" name="mip3">.
                      <input maxlength="3" size="3" name="mip4">
                    </td>
                  </tr>
                  <tr>
                    <td class="gr">Default Gateway:&nbsp; </td>
                    <td><input maxlength="3" size="3" name="gip1">.
                      <input maxlength="3" size="3" name="gip2">.
                      <input maxlength="3" size="3" name="gip3">.
                      <input maxlength="3" size="3" name="gip4">
                    </td>
                  </tr>
                  <tr>
                    <td colspan="2" rowspan="1" align="center">
                      <input value="Update Settings" type="submit">
                    </td>
                  </tr>
                </tbody>
              </table>
            </form>

            <h3>General Configuration Settings</h3>
            <form action="misc.cgi" method="get">
              <table border="1" cellpadding="2" cellspacing="2" width="100%">
                <tbody>
                  <tr>
                    <td class="gr">Module Name:</td>
                    <td><!--#modninp--></td>
                  </tr>
                  <tr>
                    <td colspan="2" rowspan="1" align="center">
                      <input value="Update Settings" type="submit">
                    </td>
                  </tr>
                </tbody>
              </table>
            </form>

            <h3>Restore Factory Defaults</h3>
            <form method="get" action="defaults.cgi" name="defaultform">
              <table border="1" cellpadding="2" cellspacing="2" width="100%">
                <tbody>
                  <tr>
                    <td class="gr">Restore all options to their factory default states:</td>
                    <td colspan="2" rowspan="1" align="center">
                      <input name="mysubmit" value="Restore Defaults" onclick="return CheckDefaults(document.defaultform);" type="submit">
                    </td>
                  </tr>
                </tbody>
              </table>
            </form>
          </td>
        </tr>
      </tbody>
    </table>
  </body>
</html>
