<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<LINK href="stylemain.css" type="text/css" rel="stylesheet">
<LINK href="colors.css" type="text/css" rel="stylesheet">
<script language="javascript" src="util.js"></script>
<script language="javascript">
<!-- hide
var sessionKey='<%ejGetOther(sessionKey)%>'; 

var glbPro = '<%ejGet(currNetService)%>';
if(glbPro == '')
   glbPro = 'http';
else if (glbPro == 'https')
   glbPro = 'htps';

var httpObj =   '<%ejGetOther(netService, http)%>';
var httpsObj =   '<%ejGetOther(netService, https)%>';
var telnetObj =   '<%ejGetOther(netService, telnet)%>';
var sshObj =   '<%ejGetOther(netService, ssh)%>';
var pingObj =   '<%ejGetOther(netService, ping)%>';
var ftpObj =   '<%ejGetOther(netService, ftp)%>';

var httpRulesItems = '<%ejGetObject(MDMOID_DEV2_NET_SERVICE_HTTP_RULE)%>';
var httpsRulesItems = '<%ejGetObject(MDMOID_DEV2_NET_SERVICE_HTTPS_RULE)%>';
var telnetRulesItems = '<%ejGetObject(MDMOID_DEV2_NET_SERVICE_TELNET_RULE)%>';
var sshRulesItems = '<%ejGetObject(MDMOID_DEV2_NET_SERVICE_SSH_RULE)%>';
var pingRulesItems = '<%ejGetObject(MDMOID_DEV2_NET_SERVICE_PING_RULE)%>';
var ftpRulesItems = '<%ejGetObject(MDMOID_DEV2_NET_SERVICE_FTP_RULE)%>';

var httpRows = numOfRow(httpRulesItems);
var httpRulesItems_IDArray = getColFromList(httpRulesItems, "ID");
var httpRulesItems_EnblArray = getColFromList(httpRulesItems, "Enable");
var httpRulesItems_SrcArray = getColFromList(httpRulesItems, "SourceAddress");
var httpRulesItems_MaskArray = getColFromList(httpRulesItems, "SubnetMask");
var httpRulesItems_WanArray = getColFromList(httpRulesItems, "WAN");

var httpsRows = numOfRow(httpsRulesItems);
var httpsRulesItems_IDArray = getColFromList(httpsRulesItems, "ID");
var httpsRulesItems_EnblArray = getColFromList(httpsRulesItems, "Enable");
var httpsRulesItems_SrcArray = getColFromList(httpsRulesItems, "SourceAddress");
var httpsRulesItems_MaskArray = getColFromList(httpsRulesItems, "SubnetMask");
var httpsRulesItems_WanArray = getColFromList(httpsRulesItems, "WAN");

var telnetRows = numOfRow(telnetRulesItems);
var telnetRulesItems_IDArray = getColFromList(telnetRulesItems, "ID");
var telnetRulesItems_EnblArray = getColFromList(telnetRulesItems, "Enable");
var telnetRulesItems_SrcArray = getColFromList(telnetRulesItems, "SourceAddress");
var telnetRulesItems_MaskArray = getColFromList(telnetRulesItems, "SubnetMask");
var telnetRulesItems_WanArray = getColFromList(telnetRulesItems, "WAN");

var sshRows = numOfRow(sshRulesItems);
var sshRulesItems_IDArray = getColFromList(sshRulesItems, "ID");
var sshRulesItems_EnblArray = getColFromList(sshRulesItems, "Enable");
var sshRulesItems_SrcArray = getColFromList(sshRulesItems, "SourceAddress");
var sshRulesItems_MaskArray = getColFromList(sshRulesItems, "SubnetMask");
var sshRulesItems_WanArray = getColFromList(sshRulesItems, "WAN");

var pingRows = numOfRow(pingRulesItems);
var pingRulesItems_IDArray = getColFromList(pingRulesItems, "ID");
var pingRulesItems_EnblArray = getColFromList(pingRulesItems, "Enable");
var pingRulesItems_SrcArray = getColFromList(pingRulesItems, "SourceAddress");
var pingRulesItems_MaskArray = getColFromList(pingRulesItems, "SubnetMask");
var pingRulesItems_WanArray = getColFromList(pingRulesItems, "WAN");

var ftpRows = numOfRow(ftpRulesItems);
var ftpRulesItems_IDArray = getColFromList(ftpRulesItems, "ID");
var ftpRulesItems_EnblArray = getColFromList(ftpRulesItems, "Enable");
var ftpRulesItems_SrcArray = getColFromList(ftpRulesItems, "SourceAddress");
var ftpRulesItems_MaskArray = getColFromList(ftpRulesItems, "SubnetMask");
var ftpRulesItems_WanArray = getColFromList(ftpRulesItems, "WAN");

var httpRuleNum =   Number(httpRows != 0 ? httpRulesItems_IDArray[httpRows -1] : 0)  + 1;
var httpsRuleNum =   Number(httpsRows != 0 ? httpsRulesItems_IDArray[httpsRows -1] : 0) + 1;
var telnetRuleNum =  Number(telnetRows != 0 ? telnetRulesItems_IDArray[telnetRows -1] : 0) + 1;
var sshRuleNum =   Number(sshRows != 0 ? sshRulesItems_IDArray[sshRows -1] : 0) + 1;
var pingRuleNum =  Number(pingRows != 0 ? pingRulesItems_IDArray[pingRows -1] : 0) + 1;
var ftpRuleNum =   Number(ftpRows != 0 ? ftpRulesItems_IDArray[ftpRows -1] : 0) + 1;

function fillRulesItems(){
   var trID;
   var num;
   //HTTP
   if(httpRows != 0){
      for ( i = 0; i < httpRows; i++ ){
         num = 10000 + Number(httpRulesItems_IDArray[i]);
         trID = 'http' + num;
         document.writeln("<tr id=" + trID + ">");
         document.writeln("<td style='display:none'><input type=text value='" + num + "'></td>");
         document.writeln("<td style='display:none'><input type=text value='0'></td>");
         if(httpRulesItems_EnblArray[i] == '1')
            document.writeln("<td><input type=checkbox checked></td>");
         else
            document.writeln("<td><input type=checkbox></td>");
         document.writeln("<td><input type=text value='" + httpRulesItems_SrcArray[i]+"'></td>");
         document.writeln("<td><input type=text value='" + httpRulesItems_MaskArray[i]+"'></td>");
         document.writeln("<td><select>");

         if(httpRulesItems_WanArray[i] == '1'){
            document.writeln("<option value='0'>LAN");
            document.writeln("<option value='1' selected>WAN");
         }
         else{
            document.writeln("<option value='0' selected>LAN");
            document.writeln("<option value='1' >WAN");            
         }
         document.writeln("</select></td>");
         document.writeln("<td><input type=button name=button value=delete onclick='delet(this);' </td>");
         document.writeln("</tr>" );
         
      }
   }
   //HTTPS
   if(httpsRows != 0){
      for ( i = 0; i < httpsRows; i++ ){
         num = 20000 + Number(httpsRulesItems_IDArray[i]);
         trID = 'htps' + num ;
         document.writeln("<tr id=" + trID + ">");
         document.writeln("<td style='display:none'><input type=text value='" + num + "'></td>");
         document.writeln("<td style='display:none'><input type=text value='0'></td>");
         if(httpsRulesItems_EnblArray[i] == '1')
            document.writeln("<td><input type=checkbox checked></td>");
         else
            document.writeln("<td><input type=checkbox></td>");
         document.writeln("<td><input type=text value='" + httpsRulesItems_SrcArray[i]+"'></td>");
         document.writeln("<td><input type=text value='" + httpsRulesItems_MaskArray[i]+"'></td>");
         document.writeln("<td><select>");

         if(httpsRulesItems_WanArray[i] == '1'){
            document.writeln("<option value='0'>LAN");
            document.writeln("<option value='1' selected>WAN");
         }
         else{
            document.writeln("<option value='0' selected>LAN");
            document.writeln("<option value='1' >WAN");            
         }
         document.writeln("</select></td>");
         document.writeln("<td><input type=button name=button value=delete onclick='delet(this);' </td>");

         document.writeln("</tr>" );
         
      }
   }
   
   if(telnetRows != 0){
      for ( i = 0; i < telnetRows; i++ ){
         num = 30000 + Number(telnetRulesItems_IDArray[i]);
         trID = 'telnet' + num;
         document.writeln("<tr id=" + trID + ">");
         document.writeln("<td style='display:none'><input type=text value='" + num + "'></td>");
         document.writeln("<td style='display:none'><input type=text value='0'></td>");
         if(telnetRulesItems_EnblArray[i] == '1')
            document.writeln("<td><input type=checkbox checked></td>");
         else
            document.writeln("<td><input type=checkbox></td>");
         document.writeln("<td><input type=text value='" + telnetRulesItems_SrcArray[i]+"'></td>");
         document.writeln("<td><input type=text value='" + telnetRulesItems_MaskArray[i]+"'></td>");
         document.writeln("<td><select>");

         if(telnetRulesItems_WanArray[i] == '1'){
            document.writeln("<option value='0'>LAN");
            document.writeln("<option value='1' selected>WAN");
         }
         else{
            document.writeln("<option value='0' selected>LAN");
            document.writeln("<option value='1' >WAN");            
         }
         document.writeln("</select></td>");
         document.writeln("<td><input type=button name=button value=delete onclick='delet(this);' </td>");

         document.writeln("</tr>" );
         
      }
   }
   
   if(sshRows != 0){
      for ( i = 0; i < sshRows; i++ ){
         num = 40000 + Number(sshRulesItems_IDArray[i]);
         trID = 'ssh' + num;
         document.writeln("<tr id=" + trID + ">");
         document.writeln("<td style='display:none'><input type=text value='" + num + "'></td>");
         document.writeln("<td style='display:none'><input type=text value='0'></td>");
         if(sshRulesItems_EnblArray[i] == '1')
            document.writeln("<td><input type=checkbox checked></td>");
         else
            document.writeln("<td><input type=checkbox></td>");
         document.writeln("<td><input type=text value='" + sshRulesItems_SrcArray[i]+"'></td>");
         document.writeln("<td><input type=text value='" + sshRulesItems_MaskArray[i]+"'></td>");
         document.writeln("<td><select>");

         if(sshRulesItems_WanArray[i] == '1'){
            document.writeln("<option value='0'>LAN");
            document.writeln("<option value='1' selected>WAN");
         }
         else{
            document.writeln("<option value='0' selected>LAN");
            document.writeln("<option value='1' >WAN");            
         }
         document.writeln("</select></td>");
         document.writeln("<td><input type=button name=button value=delete onclick='delet(this);' </td>");

         document.writeln("</tr>" );
         
      }
   }

   if(pingRows != 0){
      for ( i = 0; i < pingRows; i++ ){
         num = 50000 + Number(pingRulesItems_IDArray[i]);
         trID = 'ping' + num;
         document.writeln("<tr id=" + trID + ">");
         document.writeln("<td style='display:none'><input type=text value='" + num + "'></td>");
         document.writeln("<td style='display:none'><input type=text value='0'></td>");
         if(pingRulesItems_EnblArray[i] == '1')
            document.writeln("<td><input type=checkbox checked></td>");
         else
            document.writeln("<td><input type=checkbox></td>");
         document.writeln("<td><input type=text value='" + pingRulesItems_SrcArray[i]+"'></td>");
         document.writeln("<td><input type=text value='" + pingRulesItems_MaskArray[i]+"'></td>");
         document.writeln("<td><select>");

         if(pingRulesItems_WanArray[i] == '1'){
            document.writeln("<option value='0'>LAN");
            document.writeln("<option value='1' selected>WAN");
         }
         else{
            document.writeln("<option value='0' selected>LAN");
            document.writeln("<option value='1' >WAN");            
         }
         document.writeln("</select></td>");
         document.writeln("<td><input type=button name=button value=delete onclick='delet(this);' </td>");

         document.writeln("</tr>" );
         
      }
   }
   if(ftpRuleNum != 0){
      for ( i = 0; i < ftpRows; i++ ){
         num = 60000 + Number(ftpRulesItems_IDArray[i]);
         trID = 'ftp' + num;
         document.writeln("<tr id=" + trID + ">");
         document.writeln("<td style='display:none'><input type=text value='" + num + "'></td>");
         document.writeln("<td style='display:none'><input type=text value='0'></td>");
         if(ftpRulesItems_EnblArray[i] == '1')
            document.writeln("<td><input type=checkbox checked></td>");
         else
            document.writeln("<td><input type=checkbox></td>");
         document.writeln("<td><input type=text value='" + ftpRulesItems_SrcArray[i]+"'></td>");
         document.writeln("<td><input type=text value='" + ftpRulesItems_MaskArray[i]+"'></td>");
         document.writeln("<td><select>");

         if(ftpRulesItems_WanArray[i] == '1'){
            document.writeln("<option value='0'>LAN");
            document.writeln("<option value='1' selected>WAN");
         }
         else{
            document.writeln("<option value='0' selected>LAN");
            document.writeln("<option value='1' >WAN");            
         }
         document.writeln("</select></td>");
         document.writeln("<td><input type=button name=button value=Delete onclick='delet(this);' </td>");

         document.writeln("</tr>" );
         
      }
   }
   
}

function showRules(protocol){
   glbPro = protocol;

   var tableObj = document.getElementById("ruleTable");

   var trObjArr = tableObj.rows;
   var trObj;
   
   for (var i = 1; i < trObjArr.length; i++){
      if(tableObj.rows[i].cells[1].childNodes[0].value == 1 ||
         tableObj.rows[i].cells[1].childNodes[0].value == 22)
         tableObj.deleteRow(i);
      else if (tableObj.rows[i].cells[1].childNodes[0].value == 2)
         tableObj.rows[i].cells[1].childNodes[0].value = 0;
   }
   
   for (var i = 1; i < trObjArr.length; i++){
      trObj =document.getElementById(trObjArr[i].id);

      if(trObjArr[i].id.indexOf(protocol) != -1){

         if(trObj.style.display=='none') 
            trObj.style.display='table-row';
      }
      else
         trObj.style.display='none';
   }

   var tableObj1 = document.getElementById("protocolTable");

   var trObjArr1 = tableObj1.rows;

   for (var i = 1; i < trObjArr1.length; i++){
      if(trObjArr1[i].id.indexOf(protocol) != -1){
         trObjArr1[i].cells[0].style.backgroundColor = '#F7D358';
         trObjArr1[i].cells[1].style.backgroundColor = '#F7D358';

         trObjArr1[i].cells[2].style.backgroundColor = '#F7D358';

      }
      else {
         trObjArr1[i].cells[0].style.backgroundColor = '';
         trObjArr1[i].cells[1].style.backgroundColor = '';
         trObjArr1[i].cells[2].style.backgroundColor = '';
      }
   }
   
}

function delet(obj){
   var i=obj.parentNode.parentNode.rowIndex;
   var tableObj = document.getElementById("ruleTable");
   var trObj = document.getElementById(tableObj.rows[i].id);
   
   if(tableObj.rows[i].cells[1].childNodes[0].value == 1) //type=1.. means the new rules is deleted after new Add.
      tableObj.rows[i].cells[1].childNodes[0].value = 22;//if delete the rule which is from new add, just mark to 22
   else
      tableObj.rows[i].cells[1].childNodes[0].value = 2; //other type value means the normal delete
   trObj.style.display='none';
}

function createProtocolRuleNum(protocol){
   var num = 0;
   if(glbPro == 'http'){
      num = 10000 + Number(httpRuleNum);
      httpRuleNum++;
   }
   else if (glbPro == 'htps'){
      num = 20000 + Number(httpsRuleNum);
      httpsRuleNum++;
   }
   else if (glbPro == 'telnet'){
      num = 30000 + Number(telnetRuleNum);
      telnetRuleNum++;
   }
   else if (glbPro == 'ssh'){
      num = 40000 + Number(sshRuleNum);
      sshRuleNum++;
   }
   else if (glbPro == 'ping'){
      num = 50000 + Number(pingRuleNum);
      pingRuleNum++;
   }
   else if (glbPro == 'ftp'){
      num = 60000 + Number(ftpRuleNum);
      ftpRuleNum++;
   }   
   return num;
}

function btnAdd() {
   var row, cell;
   var ruleNum = 0;
   var tableLen = document.getElementById("ruleTable").rows.length;
   ruleNum = createProtocolRuleNum(glbPro);

   row = document.getElementById("ruleTable").insertRow(tableLen);
   row.id='id_' + glbPro + '_'+  + ruleNum;
   cell = document.getElementById("ruleTable").rows[tableLen].insertCell(0);
   cell.innerHTML ="<input type='text' value='" + ruleNum +"'>";  
   cell.style.display='none';
   
   cell = document.getElementById("ruleTable").rows[tableLen].insertCell(1);
   cell.innerHTML ="<input type='text' value='" + 1 +"'>";   //rules.type=1, means "Add"
   cell.style.display='none';
      
   cell = document.getElementById("ruleTable").rows[tableLen].insertCell(2);
   cell.innerHTML ="<input type='checkbox'>";
   cell = document.getElementById("ruleTable").rows[tableLen].insertCell(3);
   cell.innerHTML ="<input type='text'>";
   cell = document.getElementById("ruleTable").rows[tableLen].insertCell(4);
   cell.innerHTML ="<input type='text'>";
   cell = document.getElementById("ruleTable").rows[tableLen].insertCell(5);
   cell.innerHTML ="<select><option value='0'>LAN<option value='1'>WAN</select>";
   cell = document.getElementById("ruleTable").rows[tableLen].insertCell(6);
   cell.innerHTML ="<input type='button' value='delete' onclick='delet(this)'>";
   
}
function initPro(){
   with ( document.forms[0] ) {
      var pro = httpObj.split(','); 
      lanHttp.value = pro[1];
      wanHttp.value = pro[2];

      pro = httpsObj.split(','); 
      lanHttps.value = pro[1];
      wanHttps.value = pro[2];
      
      pro = telnetObj.split(','); 
      lanTelnet.value = pro[1];
      wanTelnet.value = pro[2];
      
      pro = sshObj.split(','); 
      lanSSH.value = pro[1];
      wanSSH.value = pro[2];
      
      pro = pingObj.split(','); 
      lanPing.value = pro[1];
      wanPing.value = pro[2];
      
      pro = ftpObj.split(','); 
      lanFtp.value = pro[1];
      wanFtp.value = pro[2];
   }
}


function btnSave() {
   var loc = "netservice.cmd?action=save";
   var locHttpRule = '&httpRule=';
   var locHttpsRule = '&httpsRule=';
   var locTelnetRule = '&telnetRule=';
   var locSSHRule = '&sshRule=';
   var locPingRule = '&pingRule=';
   var locFTPRule = '&ftpRule=';
   var ruleTableLen;
   var ruleID, ruleType, ruleEnbl, ruleSrc, ruleMask, ruleWAN;
   var ruleBuf = '';
   var ruleIDFilter;
   var locRuleTotal = '';
   var ruleTable =  document.getElementById('ruleTable');
   ruleTableLen = ruleTable.rows.length;
   var i, curLine=0, nextLine=0, nextLine_current = 0;

   loc += "&currNetService=" + glbPro;

   with ( document.forms[0] ) {
   
      loc += '&lanHttp=' + lanHttp.value;
      loc += '&wanHttp=' + wanHttp.value;      
      
      loc += '&lanHttps=' + lanHttps.value;
      loc += '&wanHttps=' + wanHttps.value;      

      loc += '&lanTelnet=' + lanTelnet.value;
      loc += '&wanTelnet=' + wanTelnet.value;      

      loc += '&lanSSH=' + lanSSH.value;
      loc += '&wanSSH=' + wanSSH.value;
      
      loc += '&lanPing=' + lanPing.value;
      loc += '&wanPing=' + wanPing.value;  

      loc += '&lanFtp=' + lanFtp.value;
      loc += '&wanFtp=' + wanFtp.value; 
      
      var trObjArr = ruleTable.rows;
      var trObjArr2 = ruleTable.rows;
      
      var trObj, trObj2;

      for (i=1; i < ruleTableLen; i++) 
      {
         trObj =document.getElementById(trObjArr[i].id);
         if(trObjArr[i].id.indexOf(glbPro) == -1){
            continue;
         }
         
         if(trObj.style.display == 'none' && ruleTable.rows[i].cells[1].childNodes[0].value == 22)
         {
            continue;
         }

         curLine++;
         
         ruleID = ruleTable.rows[i].cells[0].childNodes[0].value;		
         ruleType = ruleTable.rows[i].cells[1].childNodes[0].value;        
         ruleEnbl = ruleTable.rows[i].cells[2].childNodes[0].checked == true ? '1' : '0';
         ruleSrc = ruleTable.rows[i].cells[3].childNodes[0].value;
         ruleMask = ruleTable.rows[i].cells[4].childNodes[0].value;
         ruleWAN = ruleTable.rows[i].cells[5].childNodes[0].value;
         ruleBuf = ruleID + "," + ruleType + "," + ruleEnbl + "," + ruleSrc + "," + 
                           ruleMask + "," + ruleWAN + "|";
         ruleIDFilter = parseInt(ruleID / 10000);

         if(ruleSrc == '<%ejGet(ethIpAddress)%>')
         {
            alert('SourceAddress address "' + ruleSrc + '" is same with the  LAN IP address.');
            return;
         }
		 
         if (isValidUnicastIpAddress(ruleSrc) == false)
         {
            alert("The " + curLine + " line's SourceAddress '" + ruleSrc + "' is invalid!");
            return;
         }
         if (isValidSubnetMask(ruleMask) == false)
         {
            alert("The " + curLine + " line's SubnetMask '" + ruleMask + "' is invalid! Only support : Class A: 255.0.0.0; Class B: 255.255.0.0 and Class C: 255.255.255.0/255.255.255.128/255.255.255.192/255.255.255.224/255.255.255.240/255.255.255.248/255.255.255.252/255.255.255.255.");
            return;
         }

         nextLine_current = curLine;
         for (nextLine = i + 1; nextLine < ruleTableLen; nextLine++)
         {
            trObj2 =document.getElementById(trObjArr2[nextLine].id);
            if(trObjArr2[nextLine].id.indexOf(glbPro) == -1){
               continue;
            }
            nextLine_current++;
            if (ruleTable.rows[i].cells[3].childNodes[0].value ==
               ruleTable.rows[nextLine].cells[3].childNodes[0].value)
            {
               alert("The " + curLine + " line's SourceAddress '" + ruleTable.rows[i].cells[3].childNodes[0].value + "' can't not be same to " +
                  "the " + nextLine_current + " line's SourceAddress '" + ruleTable.rows[nextLine].cells[3].childNodes[0].value  + "'");
               return;
            }
         }

         
         if(ruleIDFilter == 1){
            locHttpRule += ruleBuf;
         }
         else if(ruleIDFilter == 2){
            locHttpsRule += ruleBuf;
         }
         else if(ruleIDFilter == 3){
            locTelnetRule += ruleBuf;
         }
         else if(ruleIDFilter == 4){
            locSSHRule += ruleBuf;
         }
         else if(ruleIDFilter == 5){
            locPingRule += ruleBuf;
         }
         else if(ruleIDFilter == 6){
            locFTPRule += ruleBuf;
         }      
      }

      if(glbPro == 'http')
         loc += locHttpRule;
      else if(glbPro == 'htps') 
         loc += locHttpsRule;
      else if(glbPro == 'telnet') 
         loc += locTelnetRule;
      else if(glbPro == 'ssh') 
         loc += locSSHRule;
      else if(glbPro == 'ping') 
         loc += locPingRule;
      else if(glbPro == 'ftp') 
         loc += locFTPRule;
   }   
   loc += '&sessionKey=' + sessionKey;
   var code = 'location="' + loc + '"';
   eval(code);
   
}
function frmLoad(){
   with ( document.forms[0] ) {
      showRules(glbPro);
      initPro();
   }
}
// done hiding -->
</script>
</head>
<body onLoad='frmLoad()'>
<form>
<p><b><font size="3" color="black">Net Service</font></b></p>

<p>If the policy is configured for Deny, rules will be added to allow exceptions.</p>
<p>If the policy is configured to allow, rules can be added for denying exceptions.</p>
<hr>
<CENTER> <b >Net Protocol Table</b> </CENTER> 
<table id=protocolTable border='1' cellpadding='4' cellspacing='0' align=center  > 
<tr class="hd" id='ppro'>
   <td class="hd">Protocol</td>
   <td class="hd">LANAccess Policy</td>
   <td class="hd">WANAccess Policy</td>
</tr>
<tr  id='phttp'>
   <td onclick="showRules('http')" >HTTP</td>
   <td><select name=lanHttp>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
   <td><select name=wanHttp>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
</tr>
<tr id='phtps'>
   <td onclick="showRules('htps')" >HTTPS</td>
   <td><select name=lanHttps>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
   <td><select name=wanHttps>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
</tr>
<tr id='ptelnet'>
   <td onclick="showRules('telnet')" >Telnet</td>
   <td><select name=lanTelnet>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
   <td><select name=wanTelnet>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
</tr>
<tr id='pssh'>
   <td onclick="showRules('ssh')" >SSH</td>
   <td><select name=lanSSH>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
   <td><select name=wanSSH>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
</tr>
<tr id='pping'>
   <td onclick="showRules('ping')" >Ping</td>
   <td><select name=lanPing>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
   <td><select name=wanPing>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
</tr>
<tr id='pftp'>

   <td onclick="showRules('ftp')" >FTP</td>
   <td><select name=lanFtp>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
   <td><select name=wanFtp>
      <option value='0'>Deny
      <option value='1'>Allow
     </select>
   </td>
</tr>
</table>
<BR><br>
<CENTER> <b >Net Rule Table</b> </CENTER> 
<table id=ruleTable border='1' cellpadding='4' cellspacing='0' align=center > 
<tr>
   <td  class="hd" style='display:none'>ID</td>
   <td  class="hd" style='display:none'>Type</td>
   <td class="hd">Enable</td>
   <td class="hd">SourceAddress</td>
   <td class="hd">SubnetMask</td>
   <td class="hd">LAN/WAN</td> 
   <td class="hd">Remove</td>   
   
</tr>
	    <script language='javascript'>
	      <!--hide
	        fillRulesItems();
	      //-->
	    </script>
</table>   <br>
<table  cellpadding='4' cellspacing='0' align=center>
         <tr>
               <td><input type='button' onClick='btnAdd()' value='Add'>
                <td><input type='button' onclick='btnSave()' value='Apply/Save'> </td>
               </tr>
</table>
</form>
</body>
</html>
