Just a simple web page I have made.
Note: Copy to a notepad and save as .html - *All files*
Note: Copy to a notepad and save as .html - *All files*
Code:
var Channel_24G_Text = new Array (" / 2.412GHz", " / 2.417GHz", " / 2.422GHz", " / 2.427GHz", " / 2.432GHz",
" / 2.437GHz", " / 2.442GHz", " / 2.447GHz", " / 2.452GHz", " / 2.457GHz",
" / 2.462GHz", " / 2.467GHz", " / 2.472GHz");
var Band1Channel_20M = new Array (36,40,44,48);
var Band2Channel_20M = new Array (52,56,60,64);
var Band3Channel_20M = new Array (100,104,108,112,116,132,136,140);
var Band4Channel_20M = new Array (149,153,157,161);
var Band1Channel_40M = new Array (36,44);
var Band2Channel_40M = new Array (52,60);
var Band3Channel_40M = new Array (100,108,116,132);
var Band4Channel_40M = new Array (149,157);
var Band1Channel_20M_Text = new Array (" / 5.180GHz", " / 5.200GHz", " / 5.220GHz", " / 5.240GHz");
var Band2Channel_20M_Text = new Array (" / 5.260GHz", " / 5.280GHz", " / 5.300GHz", " / 5.320GHz");
var Band3Channel_20M_Text = new Array (" / 5.500GHz", " / 5.520GHz", " / 5.540GHz", " / 5.560GHz", " / 5.580GHz", " / 5.660GHz", " / 5.680GHz", " / 5.700GHz");
var Band4Channel_20M_Text = new Array (" / 5.745GHz", " / 5.765GHz", " / 5.785GHz", " / 5.805GHz");
var Band1Channel_40M_Text = new Array (" / 5.180GHz", " / 5.220GHz");
var Band2Channel_40M_Text = new Array (" / 5.260GHz", " / 5.300GHz");
var Band3Channel_40M_Text = new Array (" / 5.500GHz", " / 5.540GHz", " / 5.580GHz", " / 5.660GHz");
var Band4Channel_40M_Text = new Array (" / 5.745GHz", " / 5.785GHz");
var initRegion;
var changeMsg = "WARNING: Selecting the incorrect region may result in a violation of applicable law. \nDo you agree to act in accordance with these settings?";
var notShown = true; // only shown region change message once
var initialized = false;
function initScrn()
{
var defaultKey;
var fm=document.forms[0];
var i;
if(fm.tempSetting.value == 1)
{
var temp_region = parseInt(fm.tempRegion.value);
if (temp_region == 12)
fm.WRegion.selectedIndex=10;
else if (temp_region >= 10 && temp_region <= 11)
fm.WRegion.selectedIndex=temp_region+1;
else
fm.WRegion.selectedIndex=temp_region;
}
initRegion = fm.WRegion.selectedIndex;
setOpMode();
setChannel();
for (i=0; i
{
if (fm.w_channel.options[i].value == fm.initChannel.value)
{
fm.w_channel[i].selected = true;
break;
}
}
for (i=0; i
{
if (fm.g_channel.options[i].value == fm.initGChannel.value)
{
fm.g_channel[i].selected = true;
break;
}
}
initialized=true;
}
function chgCh(from)
{
if ( from == 2 )
{
var cf = document.forms[0];
cf.only_mode.value = "1";
cf.submit();
}
else
{
setOpMode();
setChannel();
}
}
function setOpMode()
{
var cf = document.forms[0];
var index = cf.WRegion.selectedIndex;
var currentMode = cf.opmode.selectedIndex;
cf.opmode.options.length = 4;
cf.opmode.options[0].text = "Up to 270Mbps at 2.4GHz";
cf.opmode.options[1].text = "Up to 270Mbps at 5GHz & 54Mbps at 2.4GHz";
cf.opmode.options[2].text = "Up to 130Mbps at 2.4GHz";
cf.opmode.options[3].text = "Up to 130Mbps at 5GHz & 54Mbps at 2.4GHz";
cf.opmode.options[0].value = "300Mbps";
cf.opmode.options[1].value = "300Mbps_5G";
cf.opmode.options[2].value = "130Mbps";
cf.opmode.options[3].value = "130Mbps_5G";
cf.opmode.selectedIndex = currentMode;
if (cf.opmode.options[cf.opmode.selectedIndex].value.indexOf("5G") == -1) {
cf.g_ssid.disabled = true;
cf.g_channel.disabled = true;
} else {
cf.g_ssid.disabled = false;
cf.g_channel.disabled = false;
}
}
function setChannel()
{
var cf = document.forms[0];
var index = cf.WRegion.selectedIndex;
var chIndex = cf.w_channel.selectedIndex;
var currentMode = cf.opmode.selectedIndex;
var b1=0, b2=0, b3=0, b4=0;
if (cf.nBand.value == "5G")
{
if (cf.opmode.selectedIndex == 1) // 40MHz
{
cf.w_channel.options.length = 100;
for (b1=0; b1
{
cf.w_channel.options[b1].text = Band1Channel_40M[b1] + Band1Channel_40M_Text[b1];
cf.w_channel.options[b1].value = Band1Channel_40M[b1];
}
if (cf.dfs_ch_enable.value == "1"
|| (cf.dfs_ch_enable.value == "0" && cf.dfs_ch_enable_default.value == "OFF" && index != 12))
{
for (b2=0; b2
{
cf.w_channel.options[b1+b2].text = Band2Channel_40M[b2] + Band2Channel_40M_Text[b2];
cf.w_channel.options[b1+b2].value = Band2Channel_40M[b2];
}
for (b3=0; b3
{
cf.w_channel.options[b1+b2+b3].text = Band3Channel_40M[b3] + Band3Channel_40M_Text[b3];
cf.w_channel.options[b1+b2+b3].value = Band3Channel_40M[b3];
}
}
if (index != 5 && index != 7) // No band 4 channels for Europe
{
for (b4=0; b4
{
cf.w_channel.options[b1+b2+b3+b4].text = Band4Channel_40M[b4] + Band4Channel_40M_Text[b4];
cf.w_channel.options[b1+b2+b3+b4].value = Band4Channel_40M[b4];
}
}
//cf.w_channel.options.length = b1+b2+b3+b4+1;
if (index == 5 || index == 7) // No band 4 channels for Europe
cf.w_channel.options.length = b1+b2+b3;
else
cf.w_channel.options.length = b1+b2+b3+b4;
}
else
{
cf.w_channel.options.length = 100;
for (b1=0; b1
{
cf.w_channel.options[b1].text = Band1Channel_20M[b1] + Band1Channel_20M_Text[b1];
cf.w_channel.options[b1].value = Band1Channel_20M[b1];
}
if (cf.dfs_ch_enable.value == "1"
|| (cf.dfs_ch_enable.value == "0" && cf.dfs_ch_enable_default.value == "OFF" && index != 12))
{
for (b2=0; b2
{
cf.w_channel.options[b1+b2].text = Band2Channel_20M[b2] + Band2Channel_20M_Text[b2];
cf.w_channel.options[b1+b2].value = Band2Channel_20M[b2];
}
for (b3=0; b3
{
cf.w_channel.options[b1+b2+b3].text = Band3Channel_20M[b3] + Band3Channel_20M_Text[b3];
cf.w_channel.options[b1+b2+b3].value = Band3Channel_20M[b3];
}
}
if (index != 5 && index != 7) // No band 4 channels for Europe
{
for (b4=0; b4
{
cf.w_channel.options[b1+b2+b3+b4].text = Band4Channel_20M[b4] + Band4Channel_20M_Text[b4];
cf.w_channel.options[b1+b2+b3+b4].value = Band4Channel_20M[b4];
}
}
//cf.w_channel.options.length = b1+b2+b3+b4+1;
if (index == 5 || index == 7) // No band 4 channels for Europe
cf.w_channel.options.length = b1+b2+b3;
else
cf.w_channel.options.length = b1+b2+b3+b4;
}
//cf.w_channel.options[0].text = "Auto";
//cf.w_channel.options[0].value = 0;
}
else
{
if (FinishChannel[index]==14 && cf.opmode.selectedIndex!=0)
cf.w_channel.options.length = FinishChannel[index] - StartChannel[index] + 1;
else
cf.w_channel.options.length = FinishChannel[index] - StartChannel[index] + 2;
cf.w_channel.options[0].text = "Auto";
cf.w_channel.options[0].value = 0;
for (var i = StartChannel[index]; i <= FinishChannel[index]; i++) {
if (i==14 && cf.opmode.selectedIndex!=0)
continue;
cf.w_channel.options[i - StartChannel[index] + 1].value = i;
cf.w_channel.options[i - StartChannel[index] + 1].text = ((i < 10)? "0" + i : i) + Channel_24G_Text[i -1];
}
cf.w_channel.selectedIndex = ((chIndex > -1) && (chIndex < cf.w_channel.options.length)) ? chIndex : 0 ;
}
chIndex = cf.g_channel.selectedIndex;
if (FinishChannel[index]==14 && cf.opmode.selectedIndex!=0)
cf.g_channel.options.length = FinishChannel[index] - StartChannel[index];
else
cf.g_channel.options.length = FinishChannel[index] - StartChannel[index] + 2;
cf.g_channel.options[0].text = "Auto";
cf.g_channel.options[0].value = 0;
for (var i = StartChannel[index]; i <= FinishChannel[index]; i++) {
if (i==14 && cf.opmode.selectedIndex!=0)
continue;
cf.g_channel.options[i - StartChannel[index] + 1].value = i;
cf.g_channel.options[i - StartChannel[index] + 1].text = ((i < 10)? "0" + i : i) + Channel_24G_Text[i-1];
}
cf.g_channel.selectedIndex = ((chIndex > -1) && (chIndex < cf.g_channel.options.length)) ? chIndex : 0 ;
}
function loadhelp(fname,anchname)
{
if ((loadhelp.arguments.length == 1 ) || (anchname == "" ))
top.helpframe.location.href=fname+"_h.htm";
else
top.helpframe.location.href=fname+"_h.htm#" + anchname;
}
function checkRegion()
{
var cf = document.forms[0];
if(cf.WRegion.selectedIndex == 0)
{
cf.WRegion.focus();
return alertR("Please select the correct region for your location");
}
if (notShown)
notShown = false;
else if(cf.WRegion.selectedIndex != initRegion && notShown)
{
if(!confirm(changeMsg))
return false;
else notShown = false;
}
return true;
}
function checkData()
{
var cf = document.forms[0];
if(!checkRegion()) return false;
if (cf.ssid.value == "")
{
alert("SSID cannot be empty");
return false;
}
if (cf.ssid.value.match( /[^\x20-\x7E]/ ))
{
alert("Character is not allowed in SSID.");
cf.ssid.focus();
return false;
}
if (cf.g_ssid.value == "")
{
alert("SSID cannot be empty");
return false;
}
if (cf.g_ssid.value.match( /[^\x20-\x7E]/ ))
{
alert("Character is not allowed in SSID.");
cf.ssid.focus();
return false;
}
// if (cf.ssid.value.toLowerCase() == "any")
// {
// alert("Invalid SSID.\nThe 'ANY' including any upper/lower case combination\n(e.g, 'Any' or 'aNy') of this word is not allowed to be a SSID.");
// return false;
// }
if(cf.passphrase.value.length < 8)
{
alert("Insufficient passphrase length, should be minimum of 8 characters long.");
return false;
}
if(cf.passphrase.value.length > 63)
{
if ( isHex(cf.passphrase.value) == false)
{
alert("Passphrase is too long, the maximum length should be 63 characters.");
cf.passphrase.value = "";
return false;
}
}
if (cf.passphrase.value.match( /[^\x20-\x7E]/ ))
{
alert("Character is not allowed in passphrase.");
cf.passphrase.focus();
return false;
}
// if (cf.wds_enable.value == "1" &&
// ((cf.g_channel.disabled == true && cf.w_channel[0].selected) ||
// (cf.g_channel.disabled == false && cf.g_channel[0].selected)))
if (cf.wds_enable.value == "1" &&
(cf.g_channel.disabled == true && cf.w_channel[0].selected))
{
alert("Auto Channel cannot be used with Wireless Repeating Function.");
cf.w_channel.focus();
return false;
}
return true;
}
function hotkey(e)
{
var cf = document.forms[0];
if(window.event) // IE
{
keynum = e.keyCode
}
else if(e.which) // Netscape/Firefox/Opera
{
keynum = e.keyCode
}
if((keynum==77)&&(e.altKey))
{
cf.opmode.focus();
cf.opmode.select;
}
else if((keynum==78)&&(e.altKey))
{
cf.security_type[0].checked = true;
document.forms[0].submit();
}
}
// -->





