<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

function initTranslation() {
	var idArray = new Array("iperf3Title", "iperf3Note", "iperf3hostname", "buttonSubmit", "buttonCancel");
	setAllIdValue(idArray);
}
var uploadEnable = '<%ejGet(uploadEnable)%>';
var targetIPAddr = '<%ejGet(targetIPAddr)%>';
var trsmintTime = '<%ejGet(trsmintTime)%>';
var proType = '<%ejGet(proType)%>';

function frmLoad() {

	with ( document.forms[0] ) {	
		if(uploadEnable == "Enabled")
		{
			status[0].checked = true;
		}
		else
		{
			status[1].checked = true;			
		}
		if(targetIPAddr != '')
			iperf3serveraddress.value = targetIPAddr;
		else
			iperf3serveraddress.value = "0.0.0.0";
		if(trsmintTime != '')
			iperf3transmit.value = trsmintTime;
		else
			iperf3transmit.value = 10;
		if(proType == "TCP")
			protocolselect.selectedIndex = 0;
		else
			protocolselect.selectedIndex = 1;
	}

initTranslation();
}

function btnApply() {
   var loc = 'iperf3test.cmd?';
	var idx, pro;
   with ( document.forms[0] ) {
      if ( status[0].checked == true )
         loc += 'iperf3Uploadspeed=1';
      else
         loc += 'iperf3Uploadspeed=0';	
		if ( iperf3serveraddress.value == '')
      	{
      		alert("The Server Address can't be empty");
          return;
		}
		loc += '&iperf3serveraddress=' + iperf3serveraddress.value;

		if(iperf3transmit.value == '')
		{
			loc += '&iperf3transmit=' + 10;				
		}
		else
		{
			loc += '&iperf3transmit=' + iperf3transmit.value;
		}
		
		idx = protocolselect.selectedIndex;
		pro = protocolselect.options[idx].value;
		loc += '&protocolselect=' + pro;
   }
   
		
   loc += '&sessionKey=<%ejGetOther(sessionKey)%>';
   var code = 'location="' + loc + '"';
   eval(code);
}

function btnCancel(){
   var loc = 'iperf3.html';

   var code = 'location="' + loc + '"';

   eval(code);

}
// done hiding -->
</script>
</head>

   <body onLoad='frmLoad()'>
      <blockquote>
         <form onSubmit="return false">
            <P>
               <b id="iperf3Title">Iperf speed Diagnostic</b><br><br>
               <b id="iperf3Note">Please type in a host name or an IP Address. Click Submit to check the connection automatically. </b><br><br>
            </P>



            <table border="0" cellpadding="0" cellspacing="0">
               <tr>
                  <td id='iperf3mode'>Iperf mode :</td>
                  <td><input name='status' type='radio'><span id='iperf3Uploadspeed'>Upload</span> &nbsp;&nbsp;<input name='status' type='radio'><span id='iperf3Downloadspeed'>Download</span></td>
               </tr>
               <tr>
                  <td id="iperf3hostname">Target IP address :</td>
                  <td><input type='text' name='iperf3serveraddress' ></td>
               </tr>
               <tr>
                  <td id="iperf3transmittime">Transmit :</td>
                  <td><input type='text' name='iperf3transmit' >(seconds)</td>
               </tr>  
               <tr>
                  <td id="iperf3protocoltype">Protocol type :</td>
						<td colspan="2"><select name='protocolselect' size="1">
                     <option value="0" id='iperf3protcp'>
                     TCP
                     <option value="1" id='iperf3proudp'>
                     UDP
                  </select></td>
               </tr>  
			   
            </table>
            
            <br>
            <br>
               <center>
               <input type='button' id='buttonSubmit' onClick='btnApply()' value='Submit'>
               <input type='button' id='buttonCancel' onClick='btnCancel()' value='Cancel'>
               </center>
         </form>
      </blockquote>
   </body>
</html>
