function sTrim(I)
{
  var p=0;
  var q=0;
  var sL;
  var sTemp;
  sL=I.value.length;
  sTemp=I.value; 
  if (sL>0)
  {
      while(sTemp.charAt(p)==' ') p++;
	  while(sTemp.charAt((sL-1)-q)==' ') q++;
  }
  if (p==sL)
  I.value="";
  else
  I.value=sTemp.substring(p,sL-q);

}
/**********open port*******************/
var wPo1=null;
var wPo2=null;
var wPo3=null;
var wPo4=null;
var wPo5=null;
var wPo6=null;
var wPo7=null;
var wPo8=null;
var wDMZ=null;
var wWAN=null;

function openPort(n)
{
	
    switch (n)
    {	
    	case '1':
    	        if (wPo1!=null) closePort(wPo1);
    	 	wPo1=window.open('port1_information.htm','po1','menubar=no,scrollbars,width=650,height=530');
    	break;
  	case '2': 
  		if (wPo2!=null) closePort(wPo2);
  		wPo2=window.open('port2_information.htm','po2','menubar=no,scrollbars,width=650,height=530');
  	break;
  	case '3':
  		if (wPo3!=null) closePort(wPo3);
  		wPo3=window.open('port3_information.htm','po3','menubar=no,scrollbars,width=650,height=530');
  	break;
  	case '4':
  		if (wPo4!=null) closePort(wPo4);
  		wPo4=window.open('port4_information.htm','po4','menubar=no,scrollbars,width=650,height=530');
  	break;
  	case '5': 
  		if (wPo5!=null) closePort(wPo5);
  		wPo5=window.open('port5_information.htm','po5','menubar=no,scrollbars,width=650,height=530');
  	break;
  	case '6': 
  		if (wPo6!=null) closePort(wPo6);
  		wPo6=window.open('port6_information.htm','po6','menubar=no,scrollbars,width=650,height=530');
  	break;
  	case '7':
  		if (wPo7!=null) closePort(wPo7);
  		wPo7=window.open('port7_information.htm','po7','menubar=no,scrollbars,width=650,height=530');
  	break;
  	case '8':
  		if (wPo8!=null) closePort(wPo8);
  		wPo8=window.open('port8_information.htm','po8','menubar=no,scrollbars,width=650,height=530');
  	break;
  	case '9':
  		if (wDMZ!=null) closePort(wDMZ);
  		wDMZ=window.open('dmz_port_information.htm','dmz','menubar=no,scrollbars,width=650,height=530');  
  	break;
  	case '10': 
  		if (wWAN!=null) closePort(wWAN);              
  		wWAN=window.open('wan_port_information.htm','wan','menubar=no,scrollbars,width=650,height=530');
  	break;
  	default:
  	
  	break;
    }

}
function closePort(wThis)
{
    if (wThis!=null)
    {
      wThis.close();
      wThis=null;
    }
}
/**************************************/
/*********open waiting*******************/
var wWait=null;
function openWait()
{
    if (wWait!=null) closeWait(wWait);
    wWait=window.open('waiting.htm','sWait','menubar=no,width=300,height=50');		
	
}
function closeWait(wThis)
{
    if (wThis!=null)
    {
      wThis.close();
      wThis=null;
    }
}
/**************************************/
/*********open table*******************/
var wPortRange_table=null;
var wUPnP_table=null;
var wRouting_table=null;
var wVpnSetting=null;
var wgroup_list1=null;
var wgroup_list2=null;
var wsys_log=null;
var woutgoing_log=null;
var wincoming_log=null;

function openTable(n)
{
    switch (n)
    {
    	case 'PortRange_table.htm':  	        
    	        if (wPortRange_table!=null) closeTable(wPortRange_table);
    		wPortRange_table=window.open('PortRange_table.htm','PortRange_table','resizable,menubar=no,scrollbars,width=820');
    	break;
    	case 'UPnP_table.htm':    	        
    	        if (wUPnP_table!=null) closeTable(wUPnP_table);
    		wUPnP_table=window.open('UPnP_table.htm','UPnP_table','resizable,menubar=no,scrollbars,width=820');
    	break;    
    	case 'Routing_table.htm':    	        
    	        if (wRouting_table!=null) closeTable(wRouting_table);
    		wRouting_table=window.open('Routing_table.htm','Routing_table','resizable,menubar=no,scrollbars,width=820');
    	break;  
    	case 'VpnSetting.htm':    	        
    	        if (wVpnSetting!=null) closeTable(wVpnSetting);
    		wVpnSetting=window.open('VpnSetting.htm','VpnSetting','resizable,menubar=yes,scrollbars,width=820');
    	break; 
    	case 'group_list1.htm':    	        
    	        if (wgroup_list1!=null) closeTable(wgroup_list1);
    		wgroup_list1=window.open('group_list1.htm','group_list1','resizable,menubar=no,scrollbars,width=820');
    	break;    
    	case 'group_list2.htm':    	        
    	        if (wgroup_list2!=null) closeTable(wgroup_list2);
    		wgroup_list2=window.open('group_list2.htm','group_list2','resizable,menubar=no,scrollbars,width=820');
    	break;    
    	case 'sys_log.htm':    	        
    	        if (wsys_log!=null) closeTable(wsys_log);
    		wsys_log=window.open('sys_log.htm','sys_log','resizable,menubar=no,scrollbars,width=820');
    	break;   
    	case 'outgoing_log.htm':    	        
    	        if (woutgoing_log!=null) closeTable(woutgoing_log);
    		woutgoing_log=window.open('outgoing_log.htm','outgoing_log','resizable,menubar=no,scrollbars,width=820');
    	break; 
    	case 'incoming_log.htm':    	        
    	        if (wincoming_log!=null) closeTable(wincoming_log);
    		wincoming_log=window.open('incoming_log.htm','incoming_log','resizable,menubar=no,scrollbars,width=820');
    	break;     	    	    	   	   	    	    		
    	default:
    	
    	
    	break;
    }	
    
}
function closeTable(wThis)
{
    if (wThis!=null)
    {
      wThis.close();
      wThis=null;
    }
}
/***************************************/
/*********open wizard*******************/
var wWizard=null;
function openWizard(n)
{
      if (wWizard!=null) closeWizard();

      switch (n)
      {
          case '1':
    	      wWizard=window.open('wizard_basic.htm','wizard','menubar=no,scrollbars,width=570,height=490');
    	  break;
	  case '2':
	      wWizard=window.open('wizard_policy.htm','wizard','menubar=no,scrollbars,width=570,height=490');
	  break;	
 	  case '3':
	      wWizard=window.open('wizard_vpn.htm','wizard','menubar=no,scrollbars,width=570,height=590');
	  break;	    
	  default:
	  
	  break;
      }


}
function closeWizard()
{
  if (wWizard!=null)
  {
    wWizard.close();
	wWizard=null;
  }
}
function WizardTo(p)
{
  document.location.href=p; 
  closeWizard(); 
}
/******************************************/
/*********open Linksys Web Site*******************/
var wDownload=null;
var wManual=null;
var wWeb=null;

function openLinksys(n)
{
      switch (n)
      {
          case 'Download':
              if (wDownload!=null) closeLinksys(wDownload);
    	      wDownload=window.open('http://www.linksys.com/download/','Download','');
    	  break;
          case 'Manual':
              if (wManual!=null) closeLinksys(wManual);
    	      wManual=window.open('http://linksys.com/support/','Manual','');
    	  break;    
          case 'Web':
              if (wWeb!=null) closeLinksys(wWeb);
    	      wWeb=window.open('http://linksys.com/support/','Web','');
    	  break;         
	  default:
	  
	  break;
      }

}
function closeLinksys(wThis)
{
    if (wThis!=null)
    {
      wThis.close();
      wThis=null;
    }
}
/******************************************/

/*********open help file*******************/
var wHelp=null;

function h_home()
{
    if (wHelp!=null) closeHelp();
    wHelp=window.open('help_home.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_network()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_network.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_password()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_password.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_time()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_time.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_adv_dmz()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_adv_dmz.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_adv_forwarding()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_adv_forwarding.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_adv_upnp()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_adv_upnp.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_adv_nat()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_adv_nat.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_adv_mac()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_adv_mac.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_adv_ddns()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_adv_ddns.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_adv_routing()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_adv_routing.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_adv_through()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_adv_through.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_dhcp_setup()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_dhcp_setup.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_dhcp_status()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_dhcp_status.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_sys_factory()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_sys_factory.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_sys_firmware()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_sys_firmware.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_sys_restart()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_sys_restart.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_sys_dualwan()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_sys_dualwan.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_sys_snmp()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_sys_snmp.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_sys_diag()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_sys_diag.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_sys_setting()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_sys_setting.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_lan_setting()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_lan_setting.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_lan_status()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_lan_status.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_f_general()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_f_general.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_access_rules()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_access_rules.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_edit_access_rules()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_edit_access_rules.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_content_filter()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_content_filter.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_vpn_summary()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_vpn_summary.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_addvpn_mode_choose()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_addvpn_mode_choose.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_gateway_to_gateway()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_gateway_to_gateway.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_client_to_gateway_t()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_client_to_gateway_t.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_client_to_gateway_g()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_client_to_gateway_g.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_log_setting()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_log_setting.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_log_report()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_log_report.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_wizard()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_wizard.htm','help','resizable,scrollbars,width=660,height=600');

}
function h_support()
{
    if (wHelp!=null) closeHelp();	
    wHelp=window.open('help_support.htm','help','resizable,scrollbars,width=660,height=600');

}

function closeHelp()
{
  if (wHelp!=null)
  {
    wHelp.close();
	wHelp=null;
  }
}
/******************************************/
