<html>
  <head>
    <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
    <link rel="stylesheet" href='stylemain.css' type='text/css'>
      <link rel="stylesheet" href='colors.css' type='text/css'>
        <script language="javascript" src="util.js"></script>
        <script type="text/javascript" src="lang/b28n.js"></script>
        <script language="javascript"><%ejGetOther(forbidHTMLCode)%></script>        
        <script language="javascript">
<!-- hide

var certstart = '-----BEGIN CERTIFICATE-----';
var certinsert = '\n<insert certificate here>\n';
var certend = '-----END CERTIFICATE-----';
var sessionKey='<%ejGetOther(sessionKey)%>';

setLanguage('<%ejGet(webUILanguage)%>'); 

function initTranslation() {
	var idArray = new Array("certImportCATile", "certImportCATips","certImportCANotice","certImportCACertName","certImportCACertificate", "certImportCABtnAply");
	setAllIdValue(idArray);
}
function frmLoad() {
  initTranslation();
  document.importForm.action = 'certca.cmd?action=import&sessionKey=' + sessionKey;
  with ( document.forms[0] ) {
    certPublic.value = certstart + certinsert + certend + '\n';
  }
}

function applyClick() {
  var idx;
 
  with ( document.forms[0] ) {
    if ( certName.value == '' ) {
      alert(_("certImportCAAlert1"));
      return;
    }
    if ( certPublic.value == '' ) {
      alert(_("certImportCAAlert2"));
      return;
    }
  }
  document.importForm.submit();
}
// done hiding -->
</script>
  </head>
  <body onLoad='frmLoad()'>
    <blockquote>
      <form name="importForm" method="post">
        <b id="certImportCATile">Import CA certificate<br>
        </b>
        <br>
        <span id="certImportCATips">Enter certificate name and paste certificate content.</span><br>
    <font color="#FF0000" id="certImportCANotice">Notice: If certificate use for tr069, the Certificate 
    Name must be "acscert"</font> <br>        
        <br>
        <table border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="180" id="certImportCACertName">Certificate Name:</td>
            <td><input type='text' name='certName' size='20' maxlength="63"></td>
          </tr>
            <tr>
              <td width="180" id="certImportCACertificate">Certificate:</td>
              <td>
                <P>
                  <TEXTAREA name='certPublic' rows='20' cols='80'>
              </TEXTAREA>
                </P>
              </td>
            </tr>
          </table>
        </div>
        <br>
        <br>
        <br>
        <center>
          <input type='button' value='Apply' onclick="applyClick()" id="certImportCABtnAply">
        </center>
      </form>
    </blockquote>
  </body>
</html>
