<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

function btnNext() {
  var loc = 'pppoe.cgi?cfgL2tpAc=1&cfgPptpAc=0&ntwkPrtcl=0&serviceId=0&enblNat=0&enblFirewall=1&enblAdvDmz=0&useStaticIpAddress=0&pppUserName=&pppPassword=';
  loc += '&enblFullcone=0&enblOnDemand=0&enblIpVer=0&pppToBridge=0';
  with( document.forms[0] ) {
      if ( (tunnelName.value.length == 0) || (tunnelName.value.length > 64) ) {
        alert('Tunnel Name is invalid [1-64].');
        return;
      }
      loc += '&tunnelName='+tunnelName.value;

      if(lnsIpAddress.value == '<%ejGet(ethIpAddress)%>')
      {
         alert('LNS Ip Adress "' + lnsIpAddress.value + '" is same with the  LAN IP address.');
         return;
      }
	
      if (!isValidUnicastIpAddress(lnsIpAddress.value)) {
        alert('LNS Ip Address "' + lnsIpAddress.value + '" is invalid.');		  
        return;
      }
	  
	  loc += '&X_BROADCOM_COM_AssociatedWanIfName=' + encodeUrl(associatedWanIfName.value);
      loc += '&lnsIpAddress='+lnsIpAddress.value;
  }
  loc += '&sessionKey=<%ejGetOther(sessionKey)%>';
  var code = 'location="' + loc + '"';
  eval(code);
}


function frmLoad() {
  with (document.forms[0]) {
  }
}

// done hiding -->
    </script>
  </head>
  <body onLoad='frmLoad()'>
    <blockquote>
      <form>
        <b>Add a L2TP Client Side PPP Connection (PPPoL2TP WAN Service)</b><br><br>
        <br><br>
        <br><br>
        <div id="l2tpAc">
          <table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width='150'>Tunnel Name</td>
              <td><input type='text' name='tunnelName'></td>
            </tr>
            <tr>
              <td width='150'>L2TP Server Ip Address</td>
              <td><input type='text' name='lnsIpAddress'></td>
            </tr>
			
		   <tr>
			  <td> <span id='greassociatedWanIfName'>Wan Interface</span>:&nbsp;&nbsp;</td>
			  <td><select name='associatedWanIfName' onChange='changeSelect()'>
			  
			<script language="javascript">
			<!-- hide
				   var interfaceInfo = '<%ejGetOther(wanInterfaceInfo, route)%>';

				{
						  var i = 0;
						  var interfaces = interfaceInfo.split('|');
					   
						  for ( i = 0; i < interfaces.length; i++ ) {
							 var names = interfaces[i].split('/');
							 if(names[1]=='ppp0' || names[1]=='pptp0')
							 	continue;								 
							 document.write("  <option value='" + names[1] + "'>");
							 document.writeln(interfaces[i]);
						  } 
					   }
			// done hiding -->
			</script>
			   </select>
		   </td>
		   </tr>
			   
          </table>
        </div>
        <br><br>
        <center>
        <input type="button" value="Next" onClick='btnNext()'>
        </center>
      </form>
    </blockquote>
  </body>
</html>
