<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("wlcfgadv1", "wlcfgadv2", "wlcfgadv3", "wlcfgadv4", "wlcfgadv5", "wlcfgadv6", "wlcfgadv7", "wlcfgadv8", "wlcfgadv9", "wlcfgadv10", "wlcfgadv11", "wlcfgadv12", "wlcfgadv13", "wlcfgadv14", "wlcfgadv15", "wlcfgadv16", "wlcfgadv17", "wlcfgadv18", "wlcfgadv19", "wlcfgadv20", "wlcfgadv21", "wlcfgadv22", "wlcfgadv23", "wlcfgadv24", "wlcfgadv25", "wlcfgadv26", "wlcfgadv27", "wlcfgadv28", "wlcfgadv29", "wlcfgadv30", "wlcfgadv31", "wlcfgadv32", "wlcfgadvRadioPowerSave", "strDisable", "strEnable", "wlcfgadvRadioPowerSaveQuietTime", "wlcfgadvRadioPowerSavePps", "wlcfgadvRadioPowerSaveOnTime", "wlcfgadv33", "wlcfgadv34", "wlcfgadv35", "wlcfgadv36", "wlcfgadv37", "wlcfgadv38", "wlcfgadv39", "wlcfgadv40", "wlcfgadv41", "wlcfgadv42", "wlcfgadv43", "wlcfgadv44", "wlcfgadv45", "wlcfgadv46", "wlcfgadv47", "wlcfgadv48", "wlcfgadv49", "wlcfgadv50", "wlcfgadv51", "wlcfgadv52", "wlcfgadv53", "wlcfgadv54", "wlcfgadv55", "wlcfgadv56", "wlcfgadv57", "wlcfgadv58", "wlcfgadv59", "wlcfgadv60", "wlcfgadv61", "wlcfgadv62", "wlcfgadv63", "wlcfgadv64", "wlcfgadv65", "wlcfgadv66", "wlcfgadv67", "wlcfgadv68", "wlcfgadv69", "wlcfgadv70", "wlcfgadv71", "wlcfgadv72", "wlcfgadv73", "wlcfgadv74", "wlcfgadv75", "wlcfgadv76", "wlcfgadv77", "wlcfgadv78", "wlcfgadv79", "wlcfgadv80", "wlcfgadv81", "wlcfgadv82", "wlcfgadv83", "wlcfgadv84", "wlcfgadv85", "wlcfgadv86","wlcfgadv87","wlcfgadv88","wlcfgadv89","wlcfgadv90", 
	"wlcfgadv91", "wlcfgadv92", "wlcfgadv93", "wlcfgadv94", "wlcfgadv95", "wlcfgadv96", "wlcfgadv97", "wlcfgadv98", "wlcfgadv99", "wlcfgadv100",  "lowpower", "fullpower",
	"wlcfgadv101", "wlcfgadv102", "wlcfgadv103", "wlcfgadv104", "wlcfgadv105", "wlcfgadv106", "wlcfgadv107", 
	"wlcfgadv108", "wlcfgadv109", "wlcfgadv_apply");
	setAllIdValue(idArray);
}
var brdId = '<%ejGet(boardID)%>';
var syncNvram = '<%ejGetWl(wlSyncNvram)%>';
var enbl = '<%ejGetWl(wlEnbl_wl0v0)%>';
var country = '<%ejGetWl(wlCountry)%>';
var channel = '<%ejGetWl(wlChannel)%>';
var rate = '<%ejGetWl(wlRate)%>';
var frg = '<%ejGetWl(wlFrgThrshld)%>';
var rts = '<%ejGetWl(wlRtsThrshld)%>';
var dtm = '<%ejGetWl(wlDtmIntvl)%>';
var bcn = '<%ejGetWl(wlBcnIntvl)%>';
var phy = '<%ejGetWl(wlPhyType)%>';
var brate = '<%ejGetWl(wlBasicRate)%>';
var fburst = '<%ejGetWl(wlFrameBurst)%>';
var gmode = '<%ejGetWl(wlgMode)%>';
var pro = '<%ejGetWl(wlProtection)%>';
var pre = '<%ejGetWl(wlPreambleType)%>';
var band= '<%ejGetWl(wlBand)%>';
var mcastrate = '<%ejGetWl(wlMCastRate)%>';
var hasafterburner = '<%ejGetWl(wlHasAfterburner)%>';
var afterburneren = '<%ejGetWl(wlAfterBurnerEn)%>';
var bands = '<%ejGetWl(wlBands)%>';
var wlmode_str = "<%ejGetWl(wlMode)%>";
var wlRefresh = '<%ejGetWl(wlRefresh)%>';
var TxPwrPcnt = '<%ejGetWl(wlTxPwrPcnt)%>';
var reg_mode = '<%ejGetWl(wlRegMode)%>';
var dfs_preism = '<%ejGetWl(wlDfsPreIsm)%>';
var dfs_postism = '<%ejGetWl(wlDfsPostIsm)%>';
var tpcDb = '<%ejGetWl(wlTpcDb)%>';
var wme = '<%ejGetWl(wlWme)%>';
var wlCurrentChannel = '<%ejGetWl(wlCurrentChannel)%>';
var acscsscantimer = '<%ejGetWl(wlAcsCsScanTimer)%>';
var nctrlsb = '<%ejGetWl(wlNCtrlsb)%>';
var corerev = '<%ejGetWl(wlCoreRev)%>';
var npro = '<%ejGetWl(wlNProtection)%>';
var nmcsidx = '<%ejGetWl(wlNMcsidx)%>';
var curr_sb_str = '<%ejGetWl(wlCurrentSb)%>';
var currbw = '<%ejGetWl(wlCurrentBw)%>';
var nmode = '<%ejGetWl(wlNmode)%>'; 
var nreqd = '<%ejGetWl(wlNReqd)%>'; 
var wmenoack= '<%ejGetWl(wlWmeNoAck)%>';
var wmeapsd= '<%ejGetWl(wlWmeApsd)%>';
var nbwcap= '<%ejGetWl(wlNBwCap)%>'; 
var haswme= '<%ejGetWl(wlHasWme)%>';
var globalmaxassoc= '<%ejGetWl(wlGlobalMaxAssoc)%>';
var curr_bw_str = "";
var hasvec = '<%ejGetWl(wlHasVec)%>';
var iperf = '<%ejGetWl(wlIperf)%>';
var vec = '<%ejGetWl(wlVec)%>';
var wpa = '<%ejGetWl(wlWpa)%>';
var chanimstate = '<%ejGetWl(wlChanImState)%>';
var rifsadvert = '<%ejGetWl(wlRifsAdvert)%>';
var obsscoex = '<%ejGetWl(wlObssCoex)%>';
var rxchain_pwrsave_enable = '<%ejGetWl(wlRxChainPwrSaveEnable)%>';
var rxchain_pwrsave_quiet_time = '<%ejGetWl(wlRxChainPwrSaveQuietTime)%>';
var rxchain_pwrsave_pps = '<%ejGetWl(wlRxChainPwrSavePps)%>';

var TXBFCapable = '<%ejGetWl(wlTXBFCapable)%>';
var enableBFR = '<%ejGetWl(wlEnableBFR)%>';
var enableBFE = '<%ejGetWl(wlEnableBFE)%>';

var bsd_role = '<%ejGetWl(bsdRole)%>';
var bsd_hport = '<%ejGetWl(bsdHport)%>';
var bsd_pport = '<%ejGetWl(bsdPport)%>';
var bsd_helper = '<%ejGetWl(bsdHelper)%>';
var bsd_primary = '<%ejGetWl(bsdPrimary)%>';

var wl_taf_enable = '<%ejGetWl(wlTafEnable)%>';
var wl_ebos_enable = '<%ejGetWl(wlEbosEnable)%>';
var wl_atf = '<%ejGetWl(wlAtf)%>';

var wl_pspretend_threshold = '<%ejGetWl(wlPspretendThreshold)%>';
var wl_pspretend_retry_limit = '<%ejGetWl(wlPspretendRetryLimit)%>';
var wl_acs_fcs_mode = '<%ejGetWl(wlAcsFcsMode)%>';
var wl_acs_dfs = '<%ejGetWl(wlAcsDfs)%>';
var wl_acs_ci_scan_timer = '<%ejGetWl(wlAcsCiScanTimer)%>';
var wl_acs_ci_scan_timeout = '<%ejGetWl(wlAcsCiScanTimeout)%>';
var wl_acs_scan_entry_expire = '<%ejGetWl(wlAcsScanEntryExpire)%>';
var wl_acs_tx_idle_cnt = '<%ejGetWl(wlAcsTxIdleCnt)%>';
var wl_acs_chan_dwell_time = '<%ejGetWl(wlAcsChanDwellTime)%>';
var wl_acs_chan_flop_period = '<%ejGetWl(wlAcsChanFlopPeriod)%>';
var wl_intfer_period = '<%ejGetWl(wlIntferPeriod)%>';
var wl_intfer_cnt = '<%ejGetWl(wlIntferCnt)%>';
var wl_intfer_txfail = '<%ejGetWl(wlIntferTxfail)%>';
var wl_intfer_tcptxfail = '<%ejGetWl(wlIntferTcptxfail)%>';
var wl_acs_dfsr_immediate = '<%ejGetWl(wlAcsDfsrImmediate)%>';
var wl_acs_dfsr_deferred = '<%ejGetWl(wlAcsDfsrDeferred)%>';
var wl_acs_dfsr_activity = '<%ejGetWl(wlAcsDfsrActivity)%>';

<!-- var radio_pwrsave_enable = '<%ejGetWl(wlRadioPwrSaveEnable)%>'; -->
<!-- var radio_pwrsave_quiet_time = '<%ejGetWl(wlRadioPwrSaveQuietTime)%>'; -->
<!-- var radio_pwrsave_pps        = '<%ejGetWl(wlRadioPwrSavePps)%>'; -->
<!-- var radio_pwrsave_level	  =  '<%ejGetWl(wlRadioPwrSaveLevel)%>'; -->

var hasapsta = '<%ejGetWl(wlHasApsta)%>';
var enbl_wl0v1 = '<%ejGetWl(wlEnbl_wl0v1)%>';
var enableUre = '<%ejGetWl(wlEnableUre)%>';
var sta_retry_time = '<%ejGetWl(wlStaRetryTime)%>';

var show= '<%ejGetWl(wlshow)%>';

function acs_fcs_mode_change()
{
	set_fcs_items(document.forms[0].wlAcsFcsMode.value == 1);
	acs_dfs_change();
}

function acs_dfs_change()
{
	set_dfs_items((document.forms[0].wlAcsFcsMode.value == 1) &&
		(document.forms[0].wlAcsDfs.value == 2));
}

function set_dfs_items(b)
{
	// b=1 means "enable". Need to reverse that to set ".disabled".
	b = !b;

	document.forms[0].wlAcsDfsrImmediateSec.disabled= b;
	document.forms[0].wlAcsDfsrDeferredSec.disabled	= b;
	document.forms[0].wlAcsDfsrActivitySec.disabled	= b;
	document.forms[0].wlAcsDfsrImmediateThr.disabled= b;
	document.forms[0].wlAcsDfsrDeferredThr.disabled	= b;
	document.forms[0].wlAcsDfsrActivityThr.disabled	= b;
}

function set_fcs_items(b)
{
	b = !b;

	document.forms[0].wlAcsDfs.disabled = b;
	document.forms[0].wlAcsCiScanTimer.disabled = b;
	document.forms[0].wlAcsCiScanTimeout.disabled = b;
	document.forms[0].wlAcsScanEntryExpire.disabled = b;
	document.forms[0].wlAcsTxIdleCnt.disabled = b;
	document.forms[0].wlAcsChanDwellTime.disabled = b;
	document.forms[0].wlAcsChanFlopPeriod.disabled = b;
	document.forms[0].wlIntferPeriod.disabled = b;
	document.forms[0].wlIntferCnt.disabled = b;
	document.forms[0].wlIntferTxfail.disabled = b;
	document.forms[0].wlIntferTcptxfail.disabled = b;

}

function wl_acs_dfsr_options(OnPageLoad) {
  if (!OnPageLoad)
        return;

  with ( document.forms[0] ) {
	var acs_fcs	= (wl_acs_fcs_mode == "1");//1 = FCS	
        var dfs_reentry	= (wl_acs_dfs == "2");	// 2 = DFS Reentry
        var taf_mode	= (wl_taf_enable == "1");

        wlAcsFcsMode.selectedIndex = acs_fcs; 
        wlAcsDfs.selectedIndex = (wl_acs_dfs=="2"?2:(wl_acs_dfs=="1"?1:0));        
        wlAcsCiScanTimer.value=wl_acs_ci_scan_timer;
        wlAcsCiScanTimeout.value=wl_acs_ci_scan_timeout;
        wlAcsScanEntryExpire.value=wl_acs_scan_entry_expire;
        wlAcsTxIdleCnt.value=wl_acs_tx_idle_cnt;
        wlAcsChanDwellTime.value=wl_acs_chan_dwell_time;
        wlAcsChanFlopPeriod.value=wl_acs_chan_flop_period;
        wlIntferPeriod.value=wl_intfer_period;
        wlIntferCnt.value=wl_intfer_cnt;
        wlIntferTxfail.value=wl_intfer_txfail;
        wlIntferTcptxfail.value=wl_intfer_tcptxfail;

        var acs_dfsr_immediate=wl_acs_dfsr_immediate.split(" ");
        wlAcsDfsrImmediateSec.value=acs_dfsr_immediate[0];
        wlAcsDfsrImmediateThr.value=acs_dfsr_immediate[1];

        var acs_dfsr_deferred=wl_acs_dfsr_deferred.split(" ")
        wlAcsDfsrDeferredSec.value=acs_dfsr_deferred[0];
        wlAcsDfsrDeferredThr.value=acs_dfsr_deferred[1];

        var acs_dfsr_activity=wl_acs_dfsr_activity.split(" ");
        wlAcsDfsrActivitySec.value=acs_dfsr_activity[0];
        wlAcsDfsrActivityThr.value=acs_dfsr_activity[1];

        set_fcs_items(acs_fcs);
        set_dfs_items(acs_fcs && dfs_reentry);
   }
}

function bsd_role_change(){
   if((document.forms[0].bsdRole.value != "1") && (document.forms[0].bsdRole.value != "2")) {
      document.forms[0].bsdPrimary.disabled = 1;
      document.forms[0].bsdPport.disabled = 1;
      document.forms[0].bsdHelper.disabled = 1;
      document.forms[0].bsdHport.disabled = 1;
   }
   else{
      document.forms[0].bsdPrimary.disabled = 0;      
      document.forms[0].bsdPport.disabled = 0;
      document.forms[0].bsdHelper.disabled = 0;
      document.forms[0].bsdHport.disabled = 0;
   } 
}

if ( wlRefresh == '1' ) {
   var code = 'location="wlcfgadvrefresh.wl?wlRefresh=0"';
   eval(code);   
}
   
function getGmodeIndex(mode) {
   var ret = 0;
   switch(mode) {
   case '0':
      ret = 3;
      break;
   case '4':
      ret = 1;
      break;
   case '5':
      ret = 2;
      break;
   default:
      ret = 0;
      break;
   }
   return ret;
}

function getNmodeIndex(mode) {
   var i;

   for (i = 0; i < document.forms[0].wlNmode.length; i++)
   {
      if (document.forms[0].wlNmode[i].value == mode)
        return i;
   }

   return 0;
}

function genericChange(OnPageLoad) {

   with ( document.forms[0] ) {    
      if(OnPageLoad) { 
         wlRate.selectedIndex = getRateIndex(rate);
         wlMCastRate.selectedIndex = getRateIndex(mcastrate);
         wlBasicRate.selectedIndex = getBasicRateIndex(brate);
         wlFrameBurst.selectedIndex = getFrameBurstIndex(fburst);
	 if( TXBFCapable == "1" ) {
            wlEnableBFR.selectedIndex = enableBFR - '0';
            wlEnableBFE.selectedIndex = enableBFE - '0';
	 }
	 else {
            wlEnableBFR.disabled = 1;
            wlEnableBFE.disabled = 1;
	 }

         bsdRole.selectedIndex = (bsd_role == "0"? 0:1);
	 bsdHelper.value = bsd_helper;
         bsdHport.value = bsd_hport;
         bsdPrimary.value = bsd_primary;
         bsdPport.value = bsd_pport;	   

	 wlTafEnable.selectedIndex = wl_taf_enable;
         wlAtf.selectedIndex = wl_atf;

         wlRifsAdvert.selectedIndex = (rifsadvert == "-1" ? 1 : 0);
         wlObssCoex.value = obsscoex;
         wlRxChainPwrSaveEnable.value = rxchain_pwrsave_enable;
         wlRxChainPwrSaveQuietTime.value = rxchain_pwrsave_quiet_time;
         wlRxChainPwrSavePps.value = rxchain_pwrsave_pps;
<!--          wlRadioPwrSaveEnable.value = radio_pwrsave_enable; -->
<!--          wlRadioPwrSaveQuietTime.value = radio_pwrsave_quiet_time;	-->
<!--          wlRadioPwrSavePps.value = radio_pwrsave_pps; -->
<!--          wlRadioPwrSaveLevel.value = radio_pwrsave_level; --> 
         wlFrgThrshld.value = frg;
         wlRtsThrshld.value = rts;
         wlDtmIntvl.value = dtm;
         wlBcnIntvl.value = bcn;
         wlGlobalMaxAssoc.value = globalmaxassoc;
         wlAcsCsScanTimer.value = acscsscantimer/60;         
         wlTxPower.selectedIndex = ((TxPwrPcnt/20) -1);
         wlRegMode.selectedIndex = reg_mode;
         wlDfsPreIsm.value = dfs_preism;
         wlDfsPostIsm.value = dfs_postism;
         wlTpcDb.selectedIndex = getTpcDbIndex(tpcDb);
         /* preamble */
         if ( pre == 'short' )
            wlPreambleType.selectedIndex = 1;
         else
            wlPreambleType.selectedIndex = 0;                                           
         wlEnableUre.selectedIndex = (enableUre == '0' ? 0 : 1);
         if (enableUre == '2') /* routed mode */
            wlUreMode.options[1].selected = true;
         else 
            wlUreMode.options[0].selected = true;
         wlStaRetryTime.value = sta_retry_time;

       
         wlPspretendThreshold.value = wl_pspretend_threshold;
         wlPspretendRetryLimit.value = wl_pspretend_retry_limit;
      }      
   }
}

function gModeChange(OnPageLoad) {

   var sel_band;
   var sel_gmode;
   var sel_pro;
   var sel_pre;
   var sel_nmode;
           
   /* save selected */   
   if(OnPageLoad) {      
      sel_band = band;
      sel_gmode = gmode;
      sel_pro = pro;
      sel_nmode = nmode;
   } else {
      sel_band = document.forms[0].wlBand.value;
      sel_gmode = document.forms[0].wlgMode.value; 
      sel_pro = document.forms[0].wlProtection.value;
      sel_nmode = document.forms[0].wlNmode.value;      
   }

   with ( document.forms[0] ) {
      showhide("preambleType", 0);
      wlProtection.selectedIndex = getGModeProtection(sel_pro);                                      
      
      if ((phy == "n" || phy == "v") && sel_nmode != "off") {
         showhide("div_gMode", 0);
      } else {
         switch(sel_gmode) {
            case '0':
               showhide("preambleType", 1);         
               wlgMode.selectedIndex = 3;
               break;
            case '4':
               wlgMode.selectedIndex = 1;
               break;
            case '5':
               wlgMode.selectedIndex = 2;
               break;
            default:
               wlgMode.selectedIndex = 0;
               showhide("preambleType", 1);            
               break;
         }        
         if (sel_band == "2") {
           if (phy == "b") { //11b
             showhide("div_gMode", 0);
           }
           else { //11g
             showhide("div_gMode", 1);            
           }
         }
         else { //11a
           showhide("div_gMode", 0);
           showhide("preambleType", 0);    
         }        
      }           
   }
}

function wlLoadCountryList(OnPageLoad)
{
   var sel = 0;
   var idx;
   
   /* save selected */           
   if(OnPageLoad) {         
      sel = country;      
   } else {
      sel = document.forms[0].wlCountry.options[document.forms[0].wlCountry.selectedIndex].value;            
   }
   
   /* load list */
   if (band == "1") { // 5G
      <%ejGetWl(wlCountryList, a)%>
   } else {
      <%ejGetWl(wlCountryList, b)%>
   }

   /* mark selected */         
   for (idx=0; idx < document.forms[0].wlCountry.options.length; idx++) {
      if (document.forms[0].wlCountry.options[idx].value == sel) {
         document.forms[0].wlCountry.options[idx].selected = true;
         break;
      }
   }
   
   /* set to all(the last one) if not found */
   if( idx == document.forms[0].wlCountry.options.length)   
      document.forms[0].wlCountry.options[idx-1].selected = true;
}

function loadChannelList(OnPageLoad)
{
   var sel_ch;
   var sel_band;
   var sel_nbw_cap;
   var sel_sb;
   var idx;
      
   /* save selected */   
   if(OnPageLoad) {      
      sel_ch = channel;
      sel_band = band;
      sel_nbw_cap = nbwcap;
      sel_sb = nctrlsb;
   } else {
      sel_ch = document.forms[0].wlChannel.value;
      sel_band = document.forms[0].wlBand.value;
      sel_nbw_cap = document.forms[0].wlNBwCap.value;
      sel_sb = document.forms[0].wlNCtrlsb.value;
   }
   
   /* load list */
   document.forms[0].wlChannel.length = 0;
	      
   if ((sel_band == "2") && ((phy != "n") && (phy != "v"))) {
      <%ejGetWl(wlChannelList, b, b, 20)%>
   }
   else  if ((sel_band == "1") && ((phy != "n") && (phy != "v"))) {
      <%ejGetWl(wlChannelList, a, a, 20)%>
   }
   else  if ((sel_band == "2") && (phy == "n") ) { 
      if(sel_nbw_cap == "3") {
         if(sel_sb == 1) {
            <%ejGetWl(wlChannelList, n, b, 40, "upper")%>
         } else {
            <%ejGetWl(wlChannelList, n, b, 40, "lower")%>         
         }            
      } else if(sel_nbw_cap == "1"){      
         <%ejGetWl(wlChannelList, n, b, 20 )%>
      }         
   }
   else  if ((sel_band == "1") && (phy == "n") ) {    
      if(sel_nbw_cap == "1" || sel_nbw_cap == "2") {
         if(sel_sb == 1) {
            <%ejGetWl(wlChannelList, n, a, 40, "upper")%>
         } else {
            <%ejGetWl(wlChannelList, n, a, 40, "lower")%>         
         }  
      } else if (sel_nbw_cap == "1") {
         <%ejGetWl(wlChannelList, n, a, 20 )%>
      }         
   }      
   else if ((sel_band == "1") && (phy == "v") && (sel_nbw_cap == "7")) {    
      /* Band a and AC phy and 80M */
      <%ejGetWl(wlChannelList, v, a, 80 )%>
   }
   else  if ((sel_band == "2") && (phy == "v") ) { 
      if(sel_nbw_cap == "3") {
         if(sel_sb == 1) {
            <%ejGetWl(wlChannelList, v, b, 40, "upper")%>
         } else {
            <%ejGetWl(wlChannelList, v, b, 40, "lower")%>         
         }            
      } else if(sel_nbw_cap == "1"){      
         <%ejGetWl(wlChannelList, v, b, 20 )%>
      }         
   }
   else  if ((sel_band == "1") && (phy == "v")) {    
      if(sel_nbw_cap == "3") {
         if(sel_sb == 1) {
            <%ejGetWl(wlChannelList, v, a, 40, "upper")%>
         } else {
            <%ejGetWl(wlChannelList, v, a, 40, "lower")%>         
         }  
      } else if (sel_nbw_cap == "1") {
         <%ejGetWl(wlChannelList, v, a, 20 )%>
      }         
   }      
   else {
      document.forms[0].wlChannel[0] = new Option(_('Auto'), "0")
   }
         
   /* mark selected */
   for (idx=0; idx<document.forms[0].wlChannel.options.length; idx++) {
      if (document.forms[0].wlChannel.options[idx].value == sel_ch) {
         document.forms[0].wlChannel.options[idx].selected = true;
         break;
      }
   }
   
   /* set to first channel none-auto if not found */   
   if (idx == document.forms[0].wlChannel.options.length) {
      document.forms[0].wlChannel.options[1].selected = true;
   }
   
   with ( document.forms[0] ) {
      if( wlChannel.selectedIndex != 0 ) {
         wlAcsCsScanTimer.disabled=true;         
      } else {
         wlAcsCsScanTimer.disabled=false;         
      }
   }   
}

function loadRateList(OnPageLoad) {
   var sel_band;
   var sel_rate;
   var idx;
   var sel_nmode;
   var sel_gmode;
         
   /* save selected */
   if(OnPageLoad) {
      sel_band = band;
      sel_rate = rate;
      sel_nmode = nmode;
      sel_gmode = gmode;
   }
   else {
      sel_band = document.forms[0].wlBand.value;
      sel_rate = document.forms[0].wlRate.value;
      sel_nmode = document.forms[0].wlNmode.value;
      sel_gmode = document.forms[0].wlgMode.value;
   }

   if((phy != "n") && (phy != "v")) sel_nmode = "off";

   document.forms[0].wlRate.length = 0;
               
   if (sel_band == "2") { // 2.4G
      if (phy == "b" || 
          (country == "JP" && document.forms[0].wlChannel.value == 14) ||
          (sel_nmode == "off" && sel_gmode == "0")) {
document.forms[0].wlRate[0] = new Option(_('Auto'), "0");
document.forms[0].wlRate[1] = new Option("1 Mbps", "1000000");
document.forms[0].wlRate[2] = new Option("2 Mbps", "2000000");
document.forms[0].wlRate[3] = new Option("5.5 Mbps", "5500000");
document.forms[0].wlRate[4] = new Option("11 Mbps", "11000000");
      }
      else {
document.forms[0].wlRate[0] = new Option(_('Auto'), "0");
document.forms[0].wlRate[1] = new Option("1 Mbps", "1000000");
document.forms[0].wlRate[2] = new Option("2 Mbps", "2000000");
document.forms[0].wlRate[3] = new Option("5.5 Mbps", "5500000");
document.forms[0].wlRate[4] = new Option("6 Mbps", "6000000");
document.forms[0].wlRate[5] = new Option("9 Mbps", "9000000");
document.forms[0].wlRate[6] = new Option("11 Mbps", "11000000");
document.forms[0].wlRate[7] = new Option("12 Mbps", "12000000");
document.forms[0].wlRate[8] = new Option("18 Mbps", "18000000");
document.forms[0].wlRate[9] = new Option("24 Mbps", "24000000");
document.forms[0].wlRate[10] = new Option("36 Mbps", "36000000");
document.forms[0].wlRate[11] = new Option("48 Mbps", "48000000");
document.forms[0].wlRate[12] = new Option("54 Mbps", "54000000");
     }
   }
   else if (sel_band == "1") { // 5G
document.forms[0].wlRate[0] = new Option(_('Auto'), "0");
document.forms[0].wlRate[1] = new Option("6 Mbps", "6000000");
document.forms[0].wlRate[2] = new Option("9 Mbps", "9000000");
document.forms[0].wlRate[3] = new Option("12 Mbps", "12000000");
document.forms[0].wlRate[4] = new Option("18 Mbps", "18000000");
document.forms[0].wlRate[5] = new Option("24 Mbps", "24000000");
document.forms[0].wlRate[6] = new Option("36 Mbps", "36000000");
document.forms[0].wlRate[7] = new Option("48 Mbps", "48000000");
document.forms[0].wlRate[8] = new Option("54 Mbps", "54000000");
   }
   else {
document.forms[0].wlRate[0] = new Option(_('Auto'), "0");
   }

   if(sel_nmode != "off") {
      /* exclude auto for 802.11a/b/g (Legacy) rates if 11n is enabled */
      document.forms[0].wlRate[0]=null;
   }
      
   /* mark selected */         
   for (idx = 0; idx < document.forms[0].wlRate.options.length; idx++) {
      if (document.forms[0].wlRate.options[idx].value == sel_rate) {
         document.forms[0].wlRate.options[idx].selected = true;
         break;
      }
   } 
      
   /* set to first(Auto) if not found */
   if( idx == document.forms[0].wlRate.options.length)   
      document.forms[0].wlRate.options[0].selected = true;       
}


function loadMCastRateList(OnPageLoad) {

   var sel_band;
   var sel_rate;
   var idx;
   var sel_nmode;
   var sel_gmode;
   
   /* save selected */
   if(OnPageLoad) {
      sel_band = band;
      sel_rate = mcastrate;
      sel_nmode = nmode;
      sel_gmode = gmode;      
   }
   else {
      sel_band = document.forms[0].wlBand.value;
      sel_rate = document.forms[0].wlMCastRate.value;
      sel_nmode = document.forms[0].wlNmode.value;
      sel_gmode = document.forms[0].wlgMode.value;      
   }

   if((phy != "n" && phy != "v")) sel_nmode = "off";
   
   document.forms[0].wlMCastRate.length = 0;
   if (sel_band == "2") { // 2.4G
      if (phy == "b" ||      
          (country == "JP" && document.forms[0].wlChannel.value == 14) ||
          (sel_nmode == "off" && sel_gmode == "0")) {
document.forms[0].wlMCastRate[0] = new Option(_('Auto'), "0");
document.forms[0].wlMCastRate[1] = new Option("1 Mbps", "1000000");
document.forms[0].wlMCastRate[2] = new Option("2 Mbps", "2000000");
document.forms[0].wlMCastRate[3] = new Option("5.5 Mbps", "5500000");
document.forms[0].wlMCastRate[4] = new Option("11 Mbps", "11000000");
      }
      else {
document.forms[0].wlMCastRate[0] = new Option(_('Auto'), "0");
document.forms[0].wlMCastRate[1] = new Option("1 Mbps", "1000000");
document.forms[0].wlMCastRate[2] = new Option("2 Mbps", "2000000");
document.forms[0].wlMCastRate[3] = new Option("5.5 Mbps", "5500000");
document.forms[0].wlMCastRate[4] = new Option("6 Mbps", "6000000");
document.forms[0].wlMCastRate[5] = new Option("9 Mbps", "9000000");
document.forms[0].wlMCastRate[6] = new Option("11 Mbps", "11000000");
document.forms[0].wlMCastRate[7] = new Option("12 Mbps", "12000000");
document.forms[0].wlMCastRate[8] = new Option("18 Mbps", "18000000");
document.forms[0].wlMCastRate[9] = new Option("24 Mbps", "24000000");
document.forms[0].wlMCastRate[10] = new Option("36 Mbps", "36000000");
document.forms[0].wlMCastRate[11] = new Option("48 Mbps", "48000000");
document.forms[0].wlMCastRate[12] = new Option("54 Mbps", "54000000");
     }
   }
   else if (sel_band == "1") { // 5G
document.forms[0].wlMCastRate[0] = new Option(_('Auto'), "0");
document.forms[0].wlMCastRate[1] = new Option("6 Mbps", "6000000");
document.forms[0].wlMCastRate[2] = new Option("9 Mbps", "9000000");
document.forms[0].wlMCastRate[3] = new Option("12 Mbps", "12000000");
document.forms[0].wlMCastRate[4] = new Option("18 Mbps", "18000000");
document.forms[0].wlMCastRate[5] = new Option("24 Mbps", "24000000");
document.forms[0].wlMCastRate[6] = new Option("36 Mbps", "36000000");
document.forms[0].wlMCastRate[7] = new Option("48 Mbps", "48000000");
document.forms[0].wlMCastRate[8] = new Option("54 Mbps", "54000000");
   }
   else {
document.forms[0].wlMCastRate[0] = new Option(_('Auto'), "0");
   }
   
   /* mark selected */         
   for (idx=0; idx < document.forms[0].wlMCastRate.options.length; idx++) {
      if (document.forms[0].wlMCastRate.options[idx].value == sel_rate) {
         document.forms[0].wlMCastRate.options[idx].selected = true;
         break;
      }
   }
   
   /* set to first(Auto) if not found */
   if( idx == document.forms[0].wlMCastRate.options.length)   
      document.forms[0].wlMCastRate.options[0].selected = true;
      
}

function loadBasicRateList(OnPageLoad) {

   var sel_band;
   var sel_rate;
   var idx;

   /* save selected */
   if(OnPageLoad) {
      sel_band = band;
      sel_rate = brate;
   }
   else {
      sel_band = document.forms[0].wlBand.value;
      sel_rate = document.forms[0].wlBasicRate.value;
   }
   
  document.forms[0].wlBasicRate.length = 0;
  
   if (sel_band == "2") { // 2.4G
document.forms[0].wlBasicRate[0] = new Option(_("Default"), "default");
document.forms[0].wlBasicRate[1] = new Option(_("All"), "all");
document.forms[0].wlBasicRate[2] = new Option("1 & 2 Mbps", "12");
      if (phy != "b") {
         document.forms[0].wlBasicRate[3] = new Option("1 & 2 & 5.5 & 6 & 11 & 12 & 24 Mbps", "wifi2");
      }
      
   }
   else if (sel_band == "1") { // 5G
document.forms[0].wlBasicRate[0] = new Option(_("Default"), "default");
document.forms[0].wlBasicRate[1] = new Option(_("All"), "all");
document.forms[0].wlBasicRate[2] = new Option("6 & 12 Mbps", "12");
document.forms[0].wlBasicRate[3] = new Option("6 & 12 & 24 Mbps", "wifi2");
   }
   else {
document.forms[0].wlBasicRate[0] = new Option(_("Default"), "0");
   }

   /* mark selected */         
   for (idx=0; idx < document.forms[0].wlBasicRate.options.length; idx++) {
      if (document.forms[0].wlBasicRate.options[idx].value == sel_rate) {
         document.forms[0].wlBasicRate.options[idx].selected = true;
         break;
      }
   }
   
   /* set to first(Auto) if not found */
   if( idx == document.forms[0].wlBasicRate.options.length)   
      document.forms[0].wlBasicRate.options[0].selected = true;   
      
}

function onBandChange(OnPageLoad) {

   with ( document.forms[0] ) {
      var sel_band;
         
      /* save selected */      
      if(OnPageLoad) {
         sel_band = band;
         wlBand.selectedIndex = getBandIndex(sel_band);
      }      
      else {
         sel_band = document.forms[0].wlBand.value;
      }
                
      loadChannelList(OnPageLoad);
      loadRateList(OnPageLoad);
      loadMCastRateList(OnPageLoad);
      loadBasicRateList(OnPageLoad);
   }
}

function getBasicRateIndex(br) {
   var ret = 0;
   if ( br == "12" ) {
      ret = 2;
   }
   else if ( br == "all" ) {
      ret = 1;
   } else if ( br == "wifi2" ) {
      ret = 3;
   } else
      ret = 0;
   return ret;
}

function getRateIndex(r) {
   var rateNum = parseInt(r);
   var ret = 0;

   if ( band == '2') {
      if ( phy == "b" ) { //11b
         switch ( rateNum ) {
         case 1000000:
            ret = 1;
            break;
         case 2000000:
            ret = 2;
            break;
         case 5500000:
            ret = 3;
            break;
         case 11000000:
            ret = 4;
            break;
         default:
            ret = 0;
            break;
         }
      }
      // physical type is 802.11g
      else {
         switch ( rateNum ) {
         case 1000000:
            ret = 1;
            break;
         case 2000000:
            ret = 2;
            break;
         case 5500000:
            ret = 3;
            break;
         case 6000000:
            ret = 4;
            break;
         case 9000000:
            ret = 5;
            break;
         case 11000000:
            ret = 6;
            break;
         case 12000000:
            ret = 7;
            break;
         case 18000000:
            ret = 8;
            break;
         case 24000000:
            ret = 9;
            break;
         case 36000000:
            ret = 10;
            break;
         case 48000000:
            ret = 11;
            break;
         case 54000000:
            ret = 12;
            break;
         default:
            ret = 0;
            break;
         }
      }
   }
   // physical type is 802.11a
   else if ( band == '1' ) { // 11a
      switch ( rateNum ) {
      case 6000000:
         ret = 1;
         break;
      case 9000000:
         ret = 2;
         break;
      case 12000000:
         ret = 3;
         break;
      case 18000000:
         ret = 4;
         break;
      case 24000000:
         ret = 5;
         break;
      case 36000000:
         ret = 6;
         break;
      case 48000000:
         ret = 7;
         break;
      case 54000000:
         ret = 8;
         break;
      default:
         ret = 0;
         break;
      }
   }
   return ret;
}

function getFrameBurstIndex(frameburst) {
   var ret;
   
   if ( frameburst == "off" )
      ret = 0;
   else
      ret = 1;
   return ret;
}

function getAfterBurnerIndex(afterburner) {
   var ret;
   
   if ( afterburner == "auto" )
      ret = 1;
   else
      ret = 0;
   return ret;
}

function getVecIndex(vec) {
   var ret;
   
   if ( vec == "0" )
      ret = 0;
   else if ( vec == "1" )
      ret = 1;
   else if ( vec == "2" )
      ret = 2;
   else if ( vec == "10" )
      ret = 3;
   else if ( vec == "6" )
      ret = 4;
   else if ( vec == "14" )
      ret = 5;
   else
      ret = 0;
   return ret;
}

function getIperfIndex(iperf) {
   var ret;
   
   if ( iperf == "1" )
      ret = 1;
   else
      ret = 0;
   return ret;
}

function getGModeProtection(pro) {
   var ret;
   
   if ( pro == "auto" )
      ret = 1;
   else
      ret = 0;
   return ret;
}

function getTpcDbIndex(val) {
   var ret;
   
   if ( val == "0" )
      ret = 0;
   else if ( val == "2" )
      ret = 1;
   else if ( val == "3" )
      ret = 2;
   else if ( val == "4" )
      ret = 3;
   else ret = 0;
   return ret;
}

function phyChange() {
   with ( document.forms[0] )
      if (phy == "n" || phy == "v") {
         showhide("div_nMode", 1);
         showhide("div_nMode_sel", 1);         
         showhide("div_gMode", 0);         
      } else {
         showhide("div_nMode", 0);
         showhide("div_nMode_sel", 0);         
         showhide("div_gMode", 1);         
      }         
}

function RegModeChange(OnPageLoad) {
   with ( document.forms[0] ) {
      var sel_band;
      
      /* save selected */      
      if(OnPageLoad) {
         sel_band = band;
      }      
      else {
         sel_band = document.forms[0].wlBand.value;
      }          
                
      if( wlRegMode.selectedIndex != 1 )
         wlDfsPreIsm.disabled=wlDfsPostIsm.disabled=wlTpcDb.disabled=true;
      else 
         wlDfsPreIsm.disabled=wlDfsPostIsm.disabled=wlTpcDb.disabled=false;
         
      if (sel_band == "2") {
        showhide("div_regMode", 0);   
      }
      else {
        showhide("div_regMode", 1);     
      }         
   }         
}

function getBandIndex(b) {
   var ret;
   
   if ( b == '1' ) {
      if (bands == '1')
           /* It needs be forced to 0 when AP is 5G single band */
          ret = 0;
      else
          ret = 1;
   }
   else
      ret = 0;
   return ret;
}

function wl_afterburner_options(OnPageLoad) {

    var hideAB = false;
    var enableABSel = true; 
    var hideWarning = true;  
              
    with ( document.forms[0] ) {      
        var sel_nmode = wlNmode.options[wlNmode.selectedIndex].value;
        if(OnPageLoad) {
           sel_nmode = nmode;
           wlAfterBurnerEn.selectedIndex = getAfterBurnerIndex(afterburneren);
        } else {
           sel_nmode = wlNmode.options[wlNmode.selectedIndex].value;        
        }
                 
	if ( (hasafterburner != 1) ){
	   hideAB = true;
	}

        if((phy == "n" || phy == "v") && sel_nmode == "auto") {
	   hideAB = true;        
        }
            
	if (parseInt(wlFrgThrshld.value) != 2346 ){
	   //alert('wlFrgThrshld.value "' + parseInt(wlFrgThrshld.value) +'"');
           enableABSel = false; 
           hideWarning = false;        	
	}
	
	if(getSelect(wlWme)!= 0) {
	   enableABSel = false; 
	}
	   
        if (hideAB ||!enableABSel) {
           wlAfterBurnerEn.value ="off";
        }    	
	showhide("AFB", !hideAB);
	wlAfterBurnerEn.disabled =!enableABSel;
    }
 }

function wl_vec_options(OnPageLoad) {

    var hide = false;
              
    with ( document.forms[0] ) {      
        if(OnPageLoad) {
           wlVec.selectedIndex = getVecIndex(vec);
        }
                 
	    if ( (hasvec != 1) ){
	       hide = true;
           wlVec.value ="0";
	    }   
	    showhide("VEC", !hide);
    }
 }

function wl_iperf_options(OnPageLoad) {
              
    with ( document.forms[0] ) {      
        if(OnPageLoad) {
           wlIperf.selectedIndex = getIperfIndex(iperf);
        }
                 
	    if ( (hasvec != 1) ){
           wlIperf.value ="0";
	    }
    }
 }

function wl_ewc_options(OnPageLoad)
{
   var sel_nbw;
   var sel_nmcsidx;
   var idx;   
   var sel_ch;
   var sel_nmode;
   var sel_nreqd;
   var sel_nbw_cap;
   var sel_band;
   var bw;
        
   if(phy != "n" && phy != "v")
      return;
   
   if(OnPageLoad) {
     sel_ch = channel;
     sel_nmode = nmode;
     sel_nreqd = nreqd; 
     sel_band = band;
     sel_nbw_cap = nbwcap;
     
     document.forms[0].wlNProtection.value = npro;     
     sel_nmcsidx = nmcsidx;
     if(nctrlsb == 0) {
        document.forms[0].wlNCtrlsb.selectedIndex = 0;     
        document.forms[0].wlNCtrlsb.disabled = 1;
     } else         
        document.forms[0].wlNCtrlsb.value = nctrlsb;   
        
     document.forms[0].wlNReqd.value = nreqd;
     if(sel_nmode == "off") {
        document.forms[0].wlNmode.selectedIndex = 1;
     }
     
     document.forms[0].wlNBwCap.value = sel_nbw_cap;
     
   } else {
     sel_ch = document.forms[0].wlChannel.value;   
     sel_nmcsidx = document.forms[0].wlNMmcsidx.value;
     sel_nmode = document.forms[0].wlNmode.value;
     sel_nreqd = document.forms[0].wlNReqd.value;
     sel_band = document.forms[0].wlBand.value;
     sel_nbw_cap = document.forms[0].wlNBwCap.value;
   }

   if(sel_nmode == "off") {
      document.forms[0].wlNMmcsidx.disabled = 1;      
      document.forms[0].wlNProtection.disabled = 1;
      document.forms[0].wlNReqd.disabled = 1;
      document.forms[0].wlNBwCap.disabled = 1;      
      showhide("div_nMode", 0);      
      bw = "20";
   } else {
      document.forms[0].wlNMmcsidx.disabled = 0;
      document.forms[0].wlNProtection.disabled = 0;      
      document.forms[0].wlNReqd.disabled = 0;      
      document.forms[0].wlNBwCap.disabled = 0;             
      showhide("div_nMode", 1); 
      if (sel_nbw_cap == "3")   
         bw = "40";
      else if ((sel_band == "1") && (sel_nbw_cap == "7"))
         bw = "80";
      else
         bw = "20";      
   }  
           
   if (document.forms[0].wlNMmcsidx != null)
      document.forms[0].wlNMmcsidx.disabled = 0;        
      
   /* load n phy rates */
   if(sel_ch == 0) {
      document.forms[0].wlNCtrlsb.disabled = 1;
      <%ejGetWl(wlNPhyRates, "0");%>   
   } else if (bw == "40") {
      /* Control sb is allowed only for 40MHz BW Channels */   
      document.forms[0].wlNCtrlsb.disabled = 0;
      <%ejGetWl(wlNPhyRates, "40");%>
   } else if (bw == "20") {
      document.forms[0].wlNCtrlsb.selectedIndex = 0;
      document.forms[0].wlNCtrlsb.disabled = 1;
      <%ejGetWl(wlNPhyRates, "20");%>
   } else if (bw == "80") {
      document.forms[0].wlNCtrlsb.selectedIndex = 0;
      document.forms[0].wlNCtrlsb.disabled = 1;
      document.forms[0].wlNMmcsidx.length = 0;
      document.forms[0].wlNMmcsidx[0] = new Option(_('Auto'), "-1");
      document.forms[0].wlNMmcsidx[0].selectedIndex = 0;
   }
  
   /* mark selected */         
   for (idx=0; idx< document.forms[0].wlNMmcsidx.options.length; idx++) {
      if (document.forms[0].wlNMmcsidx[idx].value == sel_nmcsidx) {
         document.forms[0].wlNMmcsidx[idx].selected = true;
         break;
      }
   }     
   
   /* set to first (Auto) if not found */
   if( idx == document.forms[0].wlNMmcsidx.options.length)   
      document.forms[0].wlNMmcsidx.options[0].selected = true;   

   /* mark selected */ 
   document.forms[0].wlNmode.selectedIndex = getNmodeIndex(sel_nmode);
               
}

function wl_mcs_onchange(OnPageLoad)
{
   var sel_nmcsidx;
   var sel_nmode;
   
   if(phy != "n" && phy != "v") 
      return;

   if(OnPageLoad) {
     sel_nmcsidx = nmcsidx;
     sel_nmode = nmode;
   } else {
     sel_nmcsidx = document.forms[0].wlNMmcsidx.value;
     sel_nmode = document.forms[0].wlNmode.value;     
   }      
   
   /* If using 'legacy rate' then enable */
   if (sel_nmcsidx == "-2" || sel_nmode == "off")
      document.forms[0].wlRate.disabled = 0;
   else
      document.forms[0].wlRate.disabled = 1;
}


function wl_recalc(OnPageLoad) {
   with ( document.forms[0] ) {               
      phyChange(OnPageLoad);
      genericChange(OnPageLoad);
      updateCurChannel(OnPageLoad);      
      onBandChange(OnPageLoad);       
      gModeChange(OnPageLoad);
      wl_ewc_options(OnPageLoad);    
      RegModeChange(OnPageLoad);
      wl_mcs_onchange(OnPageLoad);
      OnRxChainPowerSaveChange(OnPageLoad);
<!--      OnRadioPowerSaveChange(OnPageLoad); -->
      wmeChange(OnPageLoad);      
      wl_afterburner_options(OnPageLoad);        
      wl_vec_options(OnPageLoad);
      wl_iperf_options(OnPageLoad);
      //ureChange(OnPageLoad);
      wl_acs_dfsr_options(OnPageLoad);
   }
}


function updateCurChannel(OnPageLoad) {
   
   if(OnPageLoad) { 
      var curr_bw = parseInt(currbw);
      var chanimstate_str = "";

      if (chanimstate == "0")
         chanimstate_str = " (interference: acceptable)";
      else
         chanimstate_str = " (interference: severe)";

      if(curr_bw == 2)
         curr_bw_str = "20";
      else if (curr_bw == 3)
         curr_bw_str = "40";
      else if (curr_bw == 4)
         curr_bw_str = "80";
      else if (curr_bw == 1)
         curr_bw_str = "10";               
            
      if (band == "2")
      {
         if (document.getElementById)  // DOM3 = IE5, NS6
            document.getElementById("CurChannel").innerHTML = " " + _("strCurrent") + " " + wlCurrentChannel + chanimstate_str;
         else {
            if (document.layers == false) // IE4
               document.all.CurChannel.innerHTML = " " + _("strCurrent") + " " + wlCurrentChannel + chanimstate_str;
         }
      }
      else
      {           
         if (document.getElementById)  // DOM3 = IE5, NS6
            document.getElementById("CurChannel").innerHTML = " " + _("strCurrent") + " " + wlCurrentChannel;
         else {
            if (document.layers == false) // IE4
               document.all.CurChannel.innerHTML = " " + _("strCurrent") + " " + wlCurrentChannel;
         }
      }
      
      if (document.getElementById)  // DOM3 = IE5, NS6
         document.getElementById("CurNbw").innerHTML = " " + _("strCurrent") + " " + curr_bw_str + "MHz";
      else {
         if (document.layers == false) // IE4
            document.all.CurNbw.innerHTML = " " + _("strCurrent") + " " + curr_bw_str + "MHz";
      }         

      if (document.getElementById)  // DOM3 = IE5, NS6
         document.getElementById("CurNCtrlsb").innerHTML = " " + _("strCurrent") + " " + curr_sb_str;
      else {
         if (document.layers == false) // IE4
            document.all.CurNCtrlsb.innerHTML = " " + _("strCurrent") + " " + curr_sb_str;
      }        
   }
}

function OnRxChainPowerSaveChange(OnPageLoad) {
   with ( document.forms[0] ) {
         setDisable(wlRxChainPwrSaveQuietTime, wlRxChainPwrSaveEnable.value == 0);
         setDisable(wlRxChainPwrSavePps, wlRxChainPwrSaveEnable.value == 0);
   }
}


<!-- function OnRadioPowerSaveChange(OnPageLoad) { -->
<!--      with ( document.forms[0] ) { -->
<!--          var sel_band; -->
		 		  
<!--          setDisable(wlRadioPwrSaveQuietTime, wlRadioPwrSaveEnable.value == 0); -->
<!--          setDisable(wlRadioPwrSavePps, wlRadioPwrSaveEnable.value == 0); -->
<!--          setDisable(wlRadioPwrSaveLevel, wlRadioPwrSaveEnable.value == 0);--> 
<!--          if(OnPageLoad) { -->
<!--            sel_band = band; -->
<!--            if (sel_band != "2") { -->
<!--                if ( (wlRadioPwrSaveEnable.value == 1) && (wlRegMode.selectedIndex != 1) ) { -->
<!--                   wlRegMode.selectedIndex = 1; -->
<!--                   alert("Since you have enabled Radio Power Save, the Regulatory Mode was set to 802.11h"); -->
<!--                } -->
<!--             } -->	  
<!--          } -->
<!--    } -->
<!-- } -->

function wmeChange(OnPageLoad) {
   with ( document.forms[0] ) {
      //if(afterburneren != "off")
      //   setSelect(wlWme, 0);

      if(OnPageLoad) {      
         showhide("WLWMM", haswme);
         showhide("WLWMMNOACK", haswme);
         showhide("WLWMMAPSD", haswme);
         
         setSelect(wlWme, wme);
         setSelect(wlWmeNoAck, wmenoack);
         setSelect(wlWmeApsd, wmeapsd);
      }
                                 
      setDisable(wlWmeNoAck, getSelect(wlWme) == 0);
      setDisable(wlWmeApsd, getSelect(wlWme) == 0);            
   }
}

function ureChange(OnPageLoad) {
   with ( document.forms[0] ) {
      showhide("WLAPSTA", hasapsta); 
      if (OnPageLoad) {
          wlStaRetryTime.value = sta_retry_time;

          switch(wlmode_str) {
             case "ap":
                wlModeSel.selectedIndex = 0; 
                break;

             case "wet":
                wlModeSel.selectedIndex = 1; 
                break;

             case "wetmacspoof":
                wlModeSel.selectedIndex = 2; 
                break;
         }

      } 

      if (wlEnableUre.value == '1') {
         wlModeSel.selectedIndex = 1; //set to Wireless Ethernet
         wlmode_str = "wet";
         setDisable(wlModeSel, true);
         setDisable(wlUreMode, false);
      }
      else {
         setDisable(wlModeSel, false);

         setDisable(wlUreMode, true);

         wlmode_str = wlModeSel.options[wlModeSel.selectedIndex].value;
      }
   }
}
function onNmodeChange(OnPageLoad)
{   
   wl_recalc(OnPageLoad);
   document.forms[0].wlRate.selectedIndex = 0;
}

function frmLoad() {
  if (wpa == "tkip")
  {
    document.forms[0].wlNmode.length = 1;
    document.forms[0].wlNmode[0] = new Option(_("Disabled"), "off");
  }
  else
  {
    document.forms[0].wlNmode.length = 2;
    document.forms[0].wlNmode[0] = new Option(_('Auto'), "auto");
    document.forms[0].wlNmode[1] = new Option(_("Disabled"), "off");
  }
  
   wl_recalc(true);
   initTranslation();
}

function btnApply() {
   var loc = 'wlcfgadv.wl?';
   var idx, frgNum, rtsNum, dtmNum, bcnNum, frmburstNum, globalMaxAssocNum;

   if ( enbl == '0' ) {
      alert('Cannot apply the change since wireless is currently disabled.');
      return;
   }
           
   wl_recalc(false); 
      
   with ( document.forms[0] ) {
      var sel_nmode = wlNmode.options[wlNmode.selectedIndex].value;
      var sel_nmcsidx = wlNMmcsidx.value;
      
      frgNum = parseInt(wlFrgThrshld.value);
      if ( isNaN(frgNum) == true || frgNum < 256 || frgNum > 2346 ) {
         alert(_("wlcfgadvAlert3") + wlFrgThrshld.value + _("wlcfgadvAlert4"));
         return;
      }

      rtsNum = parseInt(wlRtsThrshld.value);
      if ( isNaN(rtsNum) == true || rtsNum < 0 || rtsNum > 2347 ) {
         alert(_("wlcfgadvAlert5") + wlRtsThrshld.value + _("wlcfgadvAlert6"));
         return;
      }

      dtmNum = parseInt(wlDtmIntvl.value);
      if ( isNaN(dtmNum) == true || dtmNum < 1 || dtmNum > 255 ) {
         alert(_("wlcfgadvAlert7") + wlDtmIntvl.value + _("wlcfgadvAlert8"));
         return;
      }

      bcnNum = parseInt(wlBcnIntvl.value);
      if ( isNaN(bcnNum) == true || bcnNum < 1 || bcnNum > 65535 ) {
         alert(_("wlcfgadvAlert9") + wlBcnIntvl.value + _("wlcfgadvAlert10"));
         return;
      }
      
      globalMaxAssocNum = parseInt(wlGlobalMaxAssoc.value);
      if ( isNaN(globalMaxAssocNum) == true || globalMaxAssocNum < 1 || globalMaxAssocNum > 129 ) {
         alert(_("wlcfgadvAlert11") + wlGlobalMaxAssoc.value + _("wlcfgadvAlert12"));
         return;
      }
                        
      loc += 'wlChannel=' + wlChannel.options[wlChannel.selectedIndex].value;
      loc += '&wlNmode=' + sel_nmode;
      loc += '&wlNReqd=' + wlNReqd.value;      
      loc += '&wlBasicRate=' + wlBasicRate.options[wlBasicRate.selectedIndex].value;
      loc += '&wlFrgThrshld=' + wlFrgThrshld.value;
      loc += '&wlRtsThrshld=' + wlRtsThrshld.value;
      loc += '&wlDtmIntvl=' + wlDtmIntvl.value;
      loc += '&wlBcnIntvl=' + wlBcnIntvl.value;
      loc += '&wlGlobalMaxAssoc=' + wlGlobalMaxAssoc.value;      
      loc += '&wlFrameBurst=' + wlFrameBurst.value;
      loc += '&wlRifsAdvert=' + wlRifsAdvert.value;
      loc += '&wlObssCoex=' + wlObssCoex.value;
      loc += '&wlRxChainPwrSaveEnable=' + wlRxChainPwrSaveEnable.value;
      loc += '&wlRxChainPwrSaveQuietTime=' + wlRxChainPwrSaveQuietTime.value;
      loc += '&wlRxChainPwrSavePps=' + wlRxChainPwrSavePps.value;
<!--       loc += '&wlRadioPwrSaveEnable=' + wlRadioPwrSaveEnable.value; -->
<!--       loc += '&wlRadioPwrSaveQuietTime=' + wlRadioPwrSaveQuietTime.value; -->
<!--       loc += '&wlRadioPwrSavePps=' + wlRadioPwrSavePps.value; -->
<!--       loc += '&wlRadioPwrSaveLevel=' + wlRadioPwrSaveLevel.value; --> 
      loc += '&wlBand=' + wlBand.value;
      loc += '&wlMCastRate=' + wlMCastRate.options[wlMCastRate.selectedIndex].value;
      if (hasafterburner == '1') {
         loc += '&wlAfterBurnerEn=' + wlAfterBurnerEn.value;
      }
      else {
         loc += '&wlAfterBurnerEn=off';
      }

      /* rate */
      if ( (phy != "n" && phy != "v") || ((phy == "n" || phy == "v") && (sel_nmode == "off" || sel_nmcsidx == -2)))
         loc += '&wlRate=' + wlRate.options[wlRate.selectedIndex].value;
                  
      /* b/g mode */
      if ( band == '2') { // 2.4G
         if (phy == "b") { // 802.11b
            loc += '&wlPreambleType=' + wlPreambleType.options[wlPreambleType.selectedIndex].value;
         } else if (((phy == "n" || phy == "v") && sel_nmode == "off") || phy == "g" || phy == "a") { // 802.11g
            loc += '&wlgMode=' + wlgMode.options[wlgMode.selectedIndex].value;
            loc += '&wlProtection=' + wlProtection.options[wlProtection.selectedIndex].value;
            if (wlgMode.selectedIndex == 0 || wlgMode.selectedIndex == 3) {
               loc += '&wlPreambleType=' + wlPreambleType.options[wlPreambleType.selectedIndex].value;
            }
         }         
      }

     loc += '&wlTxPwrPcnt=' + wlTxPower.options[wlTxPower.selectedIndex].value;
     loc += '&wlRegMode=' + wlRegMode.options[wlRegMode.selectedIndex].value;
      
     if((phy == "n") || (phy == "v")) {
        loc += '&wlNBwCap=' + wlNBwCap.options[wlNBwCap.selectedIndex].value;
        
        if (wlNBwCap.options[wlNBwCap.selectedIndex].value != "7") {

        if((wlBand.value=="1" && wlNBwCap.options[wlNBwCap.selectedIndex].value == "0") ||
           (wlBand.value=="2" && ((wlNBwCap.options[wlNBwCap.selectedIndex].value == "1"))))
           loc += '&wlNCtrlsb=' + 0;
        else   
           loc += '&wlNCtrlsb=' + wlNCtrlsb.options[wlNCtrlsb.selectedIndex].value;
        }   
        loc += '&wlNProtection=' + wlNProtection.options[wlNProtection.selectedIndex].value;
        loc += '&wlNMcsidx=' + wlNMmcsidx.options[wlNMmcsidx.selectedIndex].value;
     }

     if(wlRegMode.selectedIndex == 1) {
        DfsPreIsmNum = parseInt(wlDfsPreIsm.value);
        if ( isNaN(DfsPreIsmNum) == true || DfsPreIsmNum < -1 || DfsPreIsmNum > 99 ) {
           alert(_("wlcfgadvAlert13") + wlDfsPreIsm.value + _("wlcfgadvAlert14"));
           return;
        }
      
        DfsPostNum = parseInt(wlDfsPostIsm.value);
        if ( isNaN(DfsPostNum) == true || DfsPostNum < -1 || DfsPostNum > 99 ) {
           alert(_("wlcfgadvAlert15") + wlDfsPostIsm.value + _("wlcfgadvAlert16"));
           return;
        } 
      
        loc += '&wlDfsPreIsm=' + wlDfsPreIsm.value;
        loc += '&wlDfsPostIsm=' + wlDfsPostIsm.value;       
        loc += '&wlTpcDb=' + wlTpcDb.options[wlTpcDb.selectedIndex].value;
     }    
             
     
     loc += '&wlWme=' + parseInt(wlWme.value);
     loc += '&wlWmeNoAck=' + parseInt(wlWmeNoAck.value);
     loc += '&wlWmeApsd=' + parseInt(wlWmeApsd.value);      

     if (hasvec == '1') {
         loc += '&wlVec=' + parseInt(wlVec.value);
         loc += '&wlIperf=' + parseInt(wlIperf.value);
     }

     loc += '&wlMode=' + wlmode_str;

     enableUre = (wlEnableUre.value == '1') ? wlUreMode.selectedIndex + 1 : 0; // bridge=1, routed=2 
     loc += '&wlEnableUre=' + enableUre;
     loc += '&wlStaRetryTime=' + wlStaRetryTime.value;

     if ( TXBFCapable == "1" ) {
         loc += '&wlEnableBFR=' + wlEnableBFR.value;
         loc += '&wlEnableBFE=' + wlEnableBFE.value;
     }
     var acscstimerinsecond=parseInt(wlAcsCsScanTimer.value)*60;

     loc += '&bsdRole=' + bsdRole.value;
     loc += '&bsdHelper=' + bsdHelper.value;
     loc += '&bsdHport=' + bsdHport.value;
     loc += '&bsdPrimary=' + bsdPrimary.value;
     loc += '&bsdPport=' + bsdPport.value;
     loc += '&wlTafEnable=' + wlTafEnable.value;
     loc += '&wlAtf=' + wlAtf.value;
     loc += '&wlPspretendThreshold=' + wlPspretendThreshold.value;
     loc += '&wlPspretendRetryLimit=' + wlPspretendRetryLimit.value;
     loc += '&wlAcsFcsMode=' + wlAcsFcsMode.value;
     loc += '&wlAcsDfs=' + wlAcsDfs.value;
     loc += '&wlAcsCsScanTimer=' + acscstimerinsecond;
     loc += '&wlAcsCiScanTimer=' + wlAcsCiScanTimer.value;
     loc += '&wlAcsCiScanTimeout=' + wlAcsCiScanTimeout;
     loc += '&wlAcsScanEntryExpire=' + wlAcsScanEntryExpire.value;
     loc += '&wlAcsTxIdleCnt=' + wlAcsTxIdleCnt.value;
     loc += '&wlAcsChanDwellTime=' + wlAcsChanDwellTime.value;
     loc += '&wlAcsChanFlopPeriod=' + wlAcsChanFlopPeriod.value;
     loc += '&wlIntferPeriod=' + wlIntferPeriod.value;
     loc += '&wlIntferCnt=' + wlIntferCnt.value;
     loc += '&wlIntferTxfail=' + wlIntferTxfail.value;
     loc += '&wlIntferTcptxfail=' + wlIntferTcptxfail.value;
     var wlAcsDfsrImmediate=wlAcsDfsrImmediateSec.value+" "+wlAcsDfsrImmediateThr.value;
     var wlAcsDfsrDeferred=wlAcsDfsrDeferredSec.value+" "+wlAcsDfsrDeferredThr.value;
     var wlAcsDfsrActivity=wlAcsDfsrActivitySec.value+" "+wlAcsDfsrActivityThr.value;
     loc += '&wlAcsDfsrImmediate=' + wlAcsDfsrImmediate;
     loc += '&wlAcsDfsrDeferred=' + wlAcsDfsrDeferred;
     loc += '&wlAcsDfsrActivity=' + wlAcsDfsrActivity;
   }
   loc += '&wlSyncNvram=1';
   loc += '&sessionKey=<%ejGetOther(sessionKey)%>';
   var code = 'location="' + loc + '"';
    
   eval(code);
}
// done hiding -->
            </script>
   </head>
   <body onLoad='frmLoad()'>
      <blockquote>
         <form>
            <b id="wlcfgadv1">Wireless -- Advanced<br>
            </b>
            <br>
            <span id="wlcfgadv2">This page allows you to configure advanced features of the wireless LAN 
            interface. You can select a particular channel on which to operate, force the 
            transmission rate to a particular speed, set the fragmentation threshold, set 
            the RTS threshold, set the wakeup interval for clients in power-save mode, set 
            the beacon interval for the access point, set XPress mode and set whether short 
          or long preambles are used.</span><br>
            <span id="wlcfgadv3">Click "Apply/Save" to configure the advanced wireless options.</span><br>
            <br>
            <table border="0" cellpadding="0" cellspacing="0">
               <tr style="display:none;">
                  <td width="180" id="wlcfgadv4">Band:</td>
                  <script language="javascript">
<!-- hide
                     document.writeln(' <td><select name="wlBand" size="1" onChange="wl_recalc(false);">');
                     if ( bands == '3' ) { // dual band
                       document.writeln('      <option value=2>2.4GHz');
					   if(brdId != "963167GWV_004R")
                         document.writeln('      <option value=1>5GHz');         
                     }
                     else if (bands == '1') {
                       document.writeln('      <option value=1>5GHz');         
                     }
                     else {
                       document.writeln('      <option value=2>2.4GHz');
                     }
                     document.writeln(' </select></td>');
// done hiding -->
                  </script>                  
               </tr>
               <tr>
                  <td width="180" id="wlcfgadv5">Channel:</td>
                  <td width="200"><select name='wlChannel' size="1" onChange="wl_recalc(false)">
                     </select>
                  </td>
                  <td>
                     <div id="CurChannel">
                         <span id="wlcfgadv6">Current Channel:</span>
                     </div>
                  </td>                     
               </tr>
               <tr>
                  <td width="180" id="wlcfgadv7">Auto Channel Timer(min)</td>
                  <td><input type='text' name='wlAcsCsScanTimer' size='10'></td>
               </tr>               
            </table>
            <div id="div_nMode_sel">    
               <table border="0" cellpadding="0" cellspacing="0">
	          <tr> 
                     <td width="180" id="wlcfgadv8">802.11n/EWC:</td>
                     <td width="200"><select name='wlNmode' size="1" onChange="onNmodeChange(false)">
                     </select></td>
                  </tr>
               </table>
            </div>            
            <div id="div_nMode">    
               <table border="0" cellpadding="0" cellspacing="0">               
	          <tr> 
                     <td width="180" id="wlcfgadv9">Bandwidth:</td>
                     <td width="200"><select name='wlNBwCap' size="1" onChange="wl_recalc(false)">
                        <option value="1">
                        20 MHz
                        <option value="3">
                        40 MHz
                        <script language="javascript">
<!-- hide
                        if ((phy == 'v') &&  (band == '1')) { /* 11AC is supported in 5G only */
                        	document.forms[0].wlNBwCap[2] = new Option("80 MHz", "7");
                        }
// done hiding -->
                        </script>
                     </select></td>
                  <td>
                     <div id="CurNbw">
                         <span id="wlcfgadv10">Current Bandwidth:</span>
                     </div>
                  </td>                     
                  </tr>                   
	          <tr> 
                     <td width="180" id="wlcfgadv11">Control Sideband:</td>
                     <td width="200"><select name='wlNCtrlsb' size="1" onChange="wl_recalc(false)">
                        <option value="-1" id="wlcfgadv12">
                        Lower
                        <option value="1" id="wlcfgadv13">
                        Upper
                     </select></td>
                  <td>
                     <div id="CurNCtrlsb">
                         <span id="wlcfgadv14">Current Control Sideband:</span>
                     </div>
                  </td>                      				
                  </tr>
                  <tr>   
                     <td width="180" id="wlcfgadv15">802.11n Rate:</td>
                     <td><select name='wlNMmcsidx' size="1"  onChange="wl_mcs_onchange()">
                     </select>
                     </td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv16">802.11n Protection:</td>
                     <td><select name="wlNProtection" size="1">
                           <option value="off" id="wlcfgadv17">Off
                           <option value="auto" id="wlcfgadv18">Auto
                        </select></td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv19"> Support 802.11n Client Only:</td>
                     <td><select name="wlNReqd" size="1">
                           <option value="0" id="wlcfgadv20">Off
                           <option value="1" id="wlcfgadv21">On
                         </select></td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv22">RIFS Advertisement:</td>
                     <td><select name="wlRifsAdvert" size="1">
                          <option value="0" id="wlcfgadv23">Off
                          <option value="-1" id="wlcfgadv24">Auto
                          </select>
                     </td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv25"> OBSS Coexistence:</td>
                     <td><select name="wlObssCoex" size="1">
                           <option value="0" id="wlcfgadv26">Disable
                           <option value="1" id="wlcfgadv27">Enable
                         </select></td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv28"> RX Chain Power Save:</td>
                     <td><select name="wlRxChainPwrSaveEnable" size="1" onchange="OnRxChainPowerSaveChange(false)">
                        <option value="0" id="wlcfgadv29">Disable
                        <option value="1" id="wlcfgadv30">Enable
                        </select></td>
                     <td width="180" id="wlcfgadv107">Power Save status:</td>
                     <td>
                     <script language="javascript">
                     <!-- hide 
                     {
                       with ( document.forms[0] ) {
                        pwrSavemode = '<%ejGetWl(wlpwrsave)%>';
                        if( pwrSavemode == 1 ) {
                            document.writeln("<font color='green'><span id='lowpower'>Low Power</span></font>");
                        }
                        else {
                            document.writeln("<font color='blue'><span id='fullpower'>Full Power</span></font>");
                        }
                       }
                     }
                    // done hiding -->
                </script>
               </td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv87">RX Chain Power Save Quiet Time:</td>
                     <td><input type='text' name='wlRxChainPwrSaveQuietTime' size='10'></td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv88">RX Chain Power Save PPS:</td>
                     <td><input type='text' name='wlRxChainPwrSavePps' size='10'></td>
                  </tr>
<!--
                  <tr>
                     <td width="180"> Radio Power Save:</td>
                     <td><select name="wlRadioPwrSaveEnable" size="1" onchange="OnRadioPowerSaveChange(false)">
                        <option value="0">
                        Disable
                        <option value="1">
                        Enable
                        </select></td>
                  </tr>
                  <tr>
                     <td width="180">Radio Power Save Quiet Time:</td>
                     <td><input type='text' name='wlRadioPwrSaveQuietTime' size='10'></td>
                  </tr>
                  <tr>
                     <td width="180">Radio Power Save PPS:</td>
                     <td><input type='text' name='wlRadioPwrSavePps' size='10'></td>
                  </tr> 
                  <tr>
                     <td width="180">Radio Power Save Level:</td>
                     <td><select name='wlRadioPwrSaveLevel' size='1'>
                        <option value="0">
                        Low
                        <option value="1">
                        Medium
                        <option value="2">
                        High
                     </select></td>
                  </tr>
-->
            	</table>
            </div> 
            <table border="0" cellpadding="0" cellspacing="0">
                
               <tr>
                  <td width="180" id="wlcfgadv33"> 54g&#8482; Rate: </td>
                  <td><select name='wlRate' size="1">
                     </select></td>
               </tr>
               <tr>
                  <td width="180" id="wlcfgadv34">Multicast Rate:</td>
                  <td><select name='wlMCastRate' size="1">
                     </select></td>
                </tr>
                <tr>
                  <td width="180" id="wlcfgadv35">Basic Rate:</td>
                  <td><select name='wlBasicRate' size="1">
                     </select></td>
               </tr>
               <tr>
                  <td width="180" id="wlcfgadv36">Fragmentation Threshold:</td>
                  <td><input type='text' name='wlFrgThrshld' size='10'></td>
               </tr>
               <tr>
                  <td width="180" id="wlcfgadv37">RTS Threshold:</td>
                  <td><input type='text' name='wlRtsThrshld' size='10'></td>
               </tr>
               <tr>
                  <td width="180" id="wlcfgadv38">DTIM Interval:</td>
                  <td><input type='text' name='wlDtmIntvl' size='10'></td>
               </tr>
               <tr>
                  <td width="180" id="wlcfgadv39">Beacon Interval:</td>
                  <td><input type='text' name='wlBcnIntvl' size='10'></td>
               </tr>
               <tr>
                  <td width="180" id="wlcfgadv40">Global Max Clients:</td>
                  <td><input type='text' name='wlGlobalMaxAssoc' size='10'></td>
               </tr>                
               <tr>
                  <td width="180" id="wlcfgadv41">XPress&#8482; Technology:</td>
                  <td><select name='wlFrameBurst' size="1">
                        <option value="off" id="wlcfgadv42">Disabled
                        <option value="on" id="wlcfgadv43">Enabled
                     </select></td>
               </tr> 
            </table>  
            <div id="div_gMode">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180" id="wlcfgadv44">54g&#8482; Mode:</td>
                     <td><select name="wlgMode" size="1" onChange="wl_recalc(false)">
                           <option value="1" id="wlcfgadv90">
                           54g Auto
                           <option value="4" id="wlcfgadv91">
                           54g Performance
                           <option value="5" id="wlcfgadv92">
                           54g LRS
                           <option value="0" id="wlcfgadv93">
                           802.11b Only
                        </select></td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv45">54g&#8482; Protection:</td>
                     <td><select name="wlProtection" size="1">
                           <option value="off">
                           <span id="wlcfgadv46">Off</span>
                           <option value="auto">
                           <span id="wlcfgadv47">Auto</span>
                        </select></td>
                  </tr>
               </table>
            </div>
            <div id="div_regMode">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180" id="wlcfgadv48">Regulatory Mode:</td>
                     <td><select name="wlRegMode" size="1" onChange='RegModeChange(false)'>
                           <option value="0" id="wlcfgadv50">Disabled
                           <option value="1">
                           802.11h
                           <option value="2">
                           802.11d
                        </select></td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv51">Pre-Network Radar Check:</td>
                     <td><input type='text' name='wlDfsPreIsm' size='2'></td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv52">In-Network Radar Check:</td>
                     <td><input type='text' name='wlDfsPostIsm' size='2'></td>
                  </tr>
                  <tr>
                     <td width="180" id="wlcfgadv53">TPC Mitigation(db):</td>
                     <td><select name="wlTpcDb" size="1">
                           <option value="0">
                           <span id="wlcfgadv54">0(off)</span>
                           <option value="2">
                           2
                           <option value="3">
                           3
                           <option value="4">
                           4                           
                        </select></td>
                  </tr>
               </table>
            </div>
            <div id="AFB">    
               <table border="0" cellpadding="0" cellspacing="0">  
	           <tr> 
                        <td width="180" id="wlcfgadv55">Afterburner Technology:</td>
                        <td><select name='wlAfterBurnerEn' size="1" onChange='wl_afterburner_options(false)'>
                                <option value="off">
                                <span id="wlcfgadv56">Disabled</span>
                                <option value="auto">
                                <span id="wlcfgadv57">Enabled</span>
                                </select></td>
                        <td width="180" id="wlcfgadv58">(Disable WMM for Selection)</td>
               </tr>
               </table>
            </div>     	   
            <div id="preambleType">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180" id="wlcfgadv59">Preamble Type:</td>
                     <td><select name="wlPreambleType" size="1">
                           <option value="long">
                           <span id="wlcfgadv60">long</span>
                           <option value="short">
                           <span id="wlcfgadv61">short</span>
                        </select></td>
                  </tr>
               </table>
            </div>
            <div id="WLTXPOWER">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180" id="wlcfgadv62"> Transmit Power:</td>
                     <td><select name="wlTxPower" size="1">
                           <option value="20">
                           20%
                           <option value="40">
                           40%
                           <option value="60">
                           60%
                           <option value="80">
                           80%
                           <option value="100">
                           100%
                        </select></td>
                  </tr>
               </table>
            </div>                                     
            <div id="WLWMM">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180" id="wlcfgadv63">WMM(Wi-Fi Multimedia):</td>
          			 <td><select name='wlWme' size="1" onchange="wmeChange(false)">
          			     <option value="-1" id="wlcfgadv64">Auto</option>
          		  	     <option value="0" id="wlcfgadv65">Disabled</option>
          		  	     <option value="1" id="wlcfgadv66">Enabled</option>          		  	     
          		  	     </select>
		             </td>
		             <td>
			             <div id="WMMWarning">
			             </div>
		             </td>
                  </tr>
               </table>
            </div>
            <div id="WLWMMNOACK">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180" id="wlcfgadv67">WMM No Acknowledgement:</td>
		             <td><select name='wlWmeNoAck' size="1">
			         <option value="0" id="wlcfgadv68">Disabled</option>
			         <option value="1" id="wlcfgadv69">Enabled</option>
			         </select></td> 
                  </tr>
               </table>
            </div>
            <div id="WLWMMAPSD">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180" id="wlcfgadv70">WMM APSD:</td>
		             <td><select name='wlWmeApsd' size="1">
			         <option value="0" id="wlcfgadv71">Disabled</option>
			         <option value="1" id="wlcfgadv72">Enabled</option>
			         </select></td> 
                  </tr>
               </table>
            </div>            
            <div id="VEC">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="180" id="wlcfgadv73">Iperf Support:</td>
                            <td>
                                <select name='wlIperf' size="1" onChange='wl_iperf_options(false)'>
                                    <option value="0" id="wlcfgadv74">Disable</option>
                                    <option value="1" id="wlcfgadv75">Enable</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td width="180" id="wlcfgadv76">Video Error Correction:</td>
                            <td>
                                <select name='wlVec' size="1" onChange='wl_vec_options(false)'>
                                    <option value="0">RX Auto Enable Decode</option>
                                    <option value="1">RX Disable Decode</option>
                                    <option value="2">TX Enable Sequencer</option>
                                    <option value="10">TX Enable Sequencer (IPTV Mode)</option>
                                    <option value="6">TX Enable Encode</option>
                                    <option value="14">TX Enable Encode (IPTV Mode)</option>
                                </select>
                            </td>
                  </tr>
               </table>
            </div>            
            <div id="WLAPSTA" style="display:none;">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180">Wireless Mode:</td>
                     <td><select name='wlModeSel' size="1" onchange="ureChange(false)">
                     <option value="ap">Access Point</option>
                     <option value="wet">Wireless Ethernet</option>
<!--                     <option value="wetmacspoof">Wireless Ethernet MAC Spoof</option>  -->
                     </select></td> 
                  </tr>
                  <tr>
                     <td width="180">URE:</td>
                     <td><select name='wlEnableUre' size="1" onchange="ureChange(false)">
                     <option value="0">OFF</option>
                     <option value="1">ON</option>
                     </select></td> 
                  </tr>
                  <tr>
                     <td width="180">URE Mode:</td>
                     <td><select name='wlUreMode' size="1" onchange="ureChange(false)">
                     <option value="0">Bridge (Range Extender)</option>
                     <option value="1">Routed (Travel Router)</option>
                     </select></td> 
                  </tr>
                  <tr>
                     <td width="180">STA Retry Time(sec):</td>
                     <td><input type='text' name='wlStaRetryTime' size='10'></td>
                  </tr>
               </table>
            </div>    
            <div id="BEAMFORMING">
               <table border="0" cellpadding="0" cellspacing="0">
		  <tr>
                     <td width="180" id="wlcfgadv89">Beamforming Transmission (BFR):</td>
                     <td><select name='wlEnableBFR' size="1">
                     <option value="0" id="wlcfgadv94">Disabled</option>
                     <option value="1">SU BFR</option>
                     <option value="2">MU BFR</option>
                     </select></td>
                  </tr> 
                  <tr>
                     <td width="180" id="wlcfgadv108">Beamforming Reception (BFE):</td>
                     <td><select name='wlEnableBFE' size="1">
                     <option value="0" id="wlcfgadv109">Disabled</option>
                     <option value="1">SU BFE</option>
                     <option value="2">MU BFE</option>
                     </select></td>
                  </tr> 
	       </table>
            </div>    
            <div id="BSD" style="display:inline;">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180" id='wlcfgadv95'>Band Steering:</td>
                     <td><select name='bsdRole' size="1" onChange="bsd_role_change();">
                     <option value="0" id='wlcfgadv96'>Disabled</option>
		     <!--
                     <option value="1">Primary</option>
                     <option value="2">Helper</option>
		     -->
                     <option value="3" id='wlcfgadv97'>Enabled</option>
                     </select></td>
                  </tr>
		  <tr style="display:none;">
		     <td width="180" id='wlcfgadv98'>BSD Role Config:</td>
		     <td width="80" id='wlcfgadv99'>IP Addr</td>
		     <td width="80" id='wlcfgadv100'>Port Number</td>
		  </tr>
		  <tr style="display:none;">
                     <td width="180">Helper Addr & Port:</td>
                     <td><input type='text' name='bsdHelper'></td>
		     <td><input type='text' name='bsdHport'></td>
                  </tr>
                  <tr style="display:none;">
                     <td width="180">Primary Addr & Port</td>
                     <td><input type='text' name='bsdPrimary'></td>
		     <td><input type='text' name='bsdPport'></td>
                  </tr>
               </table>
            </div>    
	    <div id="ETAF" style="display:inline;">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180" id='wlcfgadv101'>Enable Traffic Scheduler:</td>
                     <td><select name='wlTafEnable' size="1">
                     <option value="0" id='wlcfgadv102'>Disabled</option>
                     <option value="1" id='wlcfgadv103'>Enabled</option>
                     </select></td>
                  </tr> 
                  <tr>
                     <td width="180" id='wlcfgadv104'>Airtime Fairness:</td>
                     <td><select name='wlAtf' size="1">
                     <option value="0" id='wlcfgadv105'>Disabled</option>
                     <option value="1" id='wlcfgadv106'>Enabled</option>
                     </select></td>
                  </tr> 
	       </table>
            </div>
	    <div id="PSP" style="display:none;">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180">Stalled Link Detection Treshold:</td>
                     <td><input type='text' name='wlPspretendThreshold' size='10'></td>
                  </tr>
                  <tr>
                     <td width="180">Packet Saving Retry Limit:</td>
                     <td><input type='text' name='wlPspretendRetryLimit' size='10'></td>
                  </tr>
               </table>
	    </div>
            <div id="ACS_DFS" style="display:none;">
               <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="180">ACS Mode:</td>
                     <td><select name='wlAcsFcsMode' size="1" onChange='acs_fcs_mode_change()'>
                     <option value="0">SCS</option>
                     <option value="1">FCS</option>
                     </select></td>
                  </tr>
                  <tr>
                     <td width="180">DFS Channel Selection:</td>
                     <td><select name='wlAcsDfs' size="1" onChange='acs_dfs_change()'>
                     <option value="0">Disable</option>
                     <option value="1">Enable</option>
                     <option value="2">Reentry</option>
                     </select></td>
                  </tr>
                  <tr>
                     <td width="180">CI Scan Interval:</td>
                     <td><input type='text' name='wlAcsCiScanTimer' size='10'></td>
                  </tr>
                  <tr>
                     <td width="180">CI Scan Timeout:</td>
                     <td><input type='text' name='wlAcsCiScanTimeout' size='10'></td>
                  </tr>
                  <tr>
                     <td width="180">Scan Result Expiry:</td>
                     <td><input type='text' name='wlAcsScanEntryExpire' size='10'></td>
                  </tr>
	          <tr>
                     <td width="180">Tx IDLE Frame Rate:</td>
                     <td><input type='text' name='wlAcsTxIdleCnt' size='10'></td>
                  </tr>
              	  <tr>
                     <td width="180">Chan Dwell Time:</td>
                     <td><input type='text' name='wlAcsChanDwellTime' size='10'></td>
                  </tr>
                  <tr>
                     <td width="180">Chan FLOP Period:</td>
                     <td><input type='text' name='wlAcsChanFlopPeriod' size='10'></td>
                  </tr>
	          <tr>
                     <td width="180">Sample Period:</td>
                     <td><input type='text' name='wlIntferPeriod' size='10'></td>
                  </tr>
	          <tr>
                     <td width="180">Sample Count:</td>
                     <td><input type='text' name='wlIntferCnt' size='10'></td>
                  </tr>
	          <tr>
                     <td width="180">Non-TCP Stream TxFail Threshold:</td>
                     <td><input type='text' name='wlIntferTxfail' size='10'></td>
                  </tr>
	          <tr>
                     <td width="180">TCP Stream TxFail Threshold:</td>
                     <td><input type='text' name='wlIntferTcptxfail' size='10'></td>
                  </tr>
	          <tr>
                     <td width="180">DFS Reentry Window Settings:</td>
                     <td width="80">Seconds</td>
		     <td width="80">Threshold</td>
                  </tr>
	          <tr>
                     <td width="180">Immediate Reentry:</td>
                     <td><input type='text' name='wlAcsDfsrImmediateSec' size='10'></td>
		     <td><input type='text' name='wlAcsDfsrImmediateThr' size='10'></td>
                  </tr>
	          <tr>
                     <td width="180">Deferred Reentry:</td>
                     <td><input type='text' name='wlAcsDfsrDeferredSec' size='10'></td>                  
		     <td><input type='text' name='wlAcsDfsrDeferredThr' size='10'></td>
                  </tr>
	          <tr>
                     <td width="180">Channel Active:</td>
                     <td><input type='text' name='wlAcsDfsrActivitySec' size='10'></td>                  
		     <td><input type='text' name='wlAcsDfsrActivityThr' size='10'></td>
                  </tr>
               </table>
            </div>
            <br>
            <center>
               <input type='button' onClick='btnApply()' value='Apply/Save' id='wlcfgadv_apply'>
            </center>
         </form>
      </blockquote>
   </body>
</html>
