<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 language="javascript">
<!-- hide

var supportBuildWarning ='<%ejGetOther(sysInfo, buildVDFWarning)%>';

function btnApply() {
  var loc = 'ippcfg.cmd?action=savapply&ippEnabled=';

  with( document.forms[0] ) {
    if( ippEnabled.checked ) {

      loc += '1';
      if ( (ippMake.value.length == 0)  ||  (ippMake.value.length > 80) ) {
        alert('Make and model length is invalid [1-80].');
        return;
      }
      loc += '&ippMake='+ippMake.value;
      
      if ( (ippName.value.length == 0) || (ippName.value.length > 80) ) {
        alert('Make and model length is invalid [1-80].');
        return;
      }
      loc += '&ippName='+ippName.value;
    }
    else {
      loc += '0';
    }
  }
  loc += '&sessionKey=<%ejGetOther(sessionKey)%>';
  var code = 'location="' + loc + '"';
   
  eval(code);
}

function ippEnblChange() {
	if(supportBuildWarning == "1") {
		with( document.forms[0] ) {
			if(ippEnabled.checked == true)
			{
				var tempValue = confirm("Are you sure enable it?");
				if(tempValue == false)
				{
					ippEnabled.checked = false;
					return;
				}
			}
		}
	}
  if( document.forms[0].ippEnabled.checked )
    hideIppConfig(0);
  else
    hideIppConfig(1);
}

function hideIppConfig(hide) {
  var status = 'block';
                                                                                
  if(hide)
    status = 'none';
                                                                                
  if( document.getElementById )
    document.getElementById('ippConfig').style.display = status;
  else
    if(!document.layers)
      document.all.ippConfig.style.display = status;
}


function frmLoad() {
  var i = 0;
  var enable = "<%ejGetOther(sysInfo, ippEnabled)%>";

  with (document.forms[0]) {
    ippMake.value = "<%ejGetOther(sysInfo, ippMake)%>";
    ippName.value = "<%ejGetOther(sysInfo, ippName)%>";
    if (enable == "1" ) {
      ippEnabled.checked = true;
    } else {
      ippEnabled.checked = false;
    }
  }
  if( document.forms[0].ippEnabled.checked )
    hideIppConfig(0);
  else
    hideIppConfig(1);
}

// done hiding -->
    </script>
  </head>
  <body onLoad='frmLoad()'>
    <blockquote>
      <form>
        <b>Printer Server settings</b><br><br>
		<script>
			if( '<%ejGetOther(sysInfo, buildVDFWarning)%>' == "1")
			{
				document.writeln("<b style='color:red'>For security reasons, it is recommended that these services remain deactivated when not in use.</b>");
				document.writeln("<br><br>");
			}
		</script>
        
        This page allows you to enable / disable printer support.
        <br><br>
        <input type='checkbox' name='ippEnabled' onClick='ippEnblChange()'> Enable on-board printer server.
        <br><br>
        <div id="ippConfig">
          <table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width='150'>Printer name</td>
              <td><input type='text' name='ippName'></td>
            </tr>
            <tr>
              <td width='150'>Make and model</td>
              <td><input type='text' name='ippMake'></td>
            </tr>
            <tr>
            <script language="Javascript">
            var ip_pname =  '<%ejGetOther(sysInfo, ippName)%>';
            var ip_pMake =  '<%ejGetOther(sysInfo, ippMake)%>';
            var ip_address = '<%ejGet(ethIpAddress)%>';
            if(ip_pMake == '')
            {
                document.write("<td colspan=2>http://"+ ip_address+":631/printers" + "</td>"); 	 
            }
            else
            {
                document.write("<td colspan=2>http://" + ip_address+":631/printers" + "/" + ip_pname+"</td>");
            }
            </script> 
            </tr>
          </table>
        </div>
        <br><br>
        <center>
        <input type="button" value="Apply/Save" onClick='btnApply()'>
        </center>
      </form>
    </blockquote>
  </body>
</html>
