<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 sessionKey='<%ejGetOther(sessionKey)%>';
var isWirelessEnbld='<%ejGet(enblWireless)%>';

function initTranslation() {
	var idArray = new Array("quickSetup", "skipQuicksetup","inputUsernamePsw", "pppUsername", "ppppassword", "enterWrlSSID", "ssid", "quickApplySave");
	setAllIdValue(idArray);
}
function skipQsetupClick(cb) {
   if ( cb.checked == true ) {
      hideQsetupInfo(1);
      hideWirelessInfo(1);
   }
   else {
      hideQsetupInfo(0);
      if (isWirelessEnbld == 0) 
         hideWirelessInfo(1);
      else
         hideWirelessInfo(0);
   }
}
   
function hideQsetupInfo(hide) {
   var status = 'block';

   if ( hide == 1 )
      status = 'none';

   if (document.getElementById)  // DOM3 = IE5, NS6
      document.getElementById('hideinfo').style.display = status;
   else {
      if (document.layers == false) // IE4
         document.all.hideinfo.style.display = status;
   }
}

function hideWirelessInfo(hide) {
   var status = 'block';

   if ( hide == 1 )
      status = 'none';

   if (document.getElementById)  // DOM3 = IE5, NS6
      document.getElementById('hideWireless').style.display = status;
   else {
      if (document.layers == false) // IE4
         document.all.hideWireless.style.display = status;
   }
}

function frmLoad() {
      initTranslation();
      with ( document.forms[0] ) {
      pppUserName.value = '<%ejGet(pppUserName)%>';
      pppPassword.value = '<%ejGet(pppPassword)%>';
   }

   if(isWirelessEnbld == 0 )
      hideWirelessInfo(1);
   else
      hideWirelessInfo(0);
}

function btnApply() {
   var loc = 'quicksetup.cmd?';

   with ( document.forms[0] ) {

      if(skipQsetup.checked == true){
         loc += 'action=skip';
         loc += '&sessionKey=' + sessionKey;
         var code = 'parent.location="' + loc + '"';
      } else{

         // validate user name
         var len = pppUserName.value.length;
         if ( len > 256 ) {
            msg =_("userNameTooLong_F") + len + _("userNameTooLong_L");
            alert(msg);
            return;
         }
         // validate password
         len = pppPassword.value.length;
         if ( len > 32 ) {
            msg = _("passwordTooLong_F") + len + _("passwordTooLong_L");
            alert(msg);
            return;
         }

         if (isWirelessEnbld == 1 ) {
            if ( wlSsid.value == '' ) {
               alert(_("ssidEmpty"));
               return;
            }

            var str = new String();
            str = wlSsid.value;
            if ( str.length > 32 ) {
               alert('SSID"' + wlSsid.value + '"' + _("ssidTooLong"));
               return;
            }
         }

         loc += 'action=add';

         loc += '&pppUserName=' + encodeUrl(pppUserName.value);
         loc += '&pppPassword=' + encodeUrl(pppPassword.value);
         if (isWirelessEnbld == 1 ) {
         loc += '&wlSsid=' + encodeUrl(wlSsid.value);
         }
         loc += '&sessionKey=' + sessionKey;
        var code = 'location="' + loc + '"';
      }
   }

   // disable save button to avoid bugs while clicking this button too fast
   //document.forms[0].btnSave.disabled = 1;
   eval(code);
}

// done hiding -->

</script>
   </head>
   <body onLoad='frmLoad()'>
      <blockquote>
         <form>
            <b id='quickSetup'>Quick Setup</b><br>
            <table border="0" cellpadding="0" cellspacing="0">
               <tr>
                  <td valign="center" align="middle" colspan="2" width="30" height="30">
                     <input type='checkbox' name='skipQsetup' onClick='skipQsetupClick(this)'></td>
                  <td id='skipQuicksetup' colspan="2"> Skip Quick setup.</td>
               </tr>
            </table>
            <br>
            <br>
            <br>
            <div id='hideinfo'>               
           <span id='inputUsernamePsw'> In the boxes below, enter the PPP user name and password that your ISP 
            has provided to you.</span><br>
            <br>
            <table border="0" cellpadding="0" cellspacing="0">
               <tr>
                  <td id='pppUsername'>PPP Username:&nbsp;&nbsp;</td>
                  <td><input type='text' name='pppUserName'></td>
               </tr>
               <tr>
                  <td id='ppppassword'>PPP Password:&nbsp;&nbsp;</td>
                  <td><input type='password' name='pppPassword'></td>
               </tr>
            </table>
               <br>
               <br>
            <div id='hideWireless'>               
	   <span id='enterWrlSSID'> Enter the wireless SSID</span> <br>
            <table border="0" cellpadding="4" cellspacing="0">
                <tr>
                  <td id='ssid' width="50">SSID:</td>
                  <td>
                     <input type='text' name='wlSsid' maxlength="32" size="32"></td>
                </tr>
               </table>              
            </div>            
            </div>            
            <br>
            <br>
            <br>
            <center>
                <input type='button' onClick='btnApply()' value='Apply/Save' id='quickApplySave'>
            </center>
         </form>
      </blockquote>
   </body>
</html>
