var sysOPMode_AR = 0; var sysOPMode_APRP = 1; var sysOPMode_AP = 2; var sysOPMode_CB = 3; var sysOPMode_CR = 4; var sysOPMode_WDSB = 5; var WebOpModeList = "0000001" var FunctionList = {HAS_DUAL_PPPOE:0,HAS_PASS_THROUGH:1,HAS_PORTBASED_QOS:0,HAS_WLAN_CONNECTION_CONTROL:1,HAS_5G_SETTING:1,HAS_RALINK_COUNTRY_SETTING:1,HAS_TX_NUM:2,HAS_RX_NUM:2,HAS_BOTTOM_IMG:1,HAS_NONE_LOGO_IMG:0,HAS_IPBASED_QOS:0,HAS_NEW_NAT_SERVER:1,HAS_WAN_3G_SETTING:0,HAS_IGMPPROXY:0,HAS_NETBIOS:0,HAS_UPNP_PORTFORWARDING:0,HAS_DNS_SERVERS_ASSIGNED_BY_DHCP_SERVER:0,HAS_QOS_TOTAL_BANDWIDTH_SETTING:0,HAS_WAN_3G_SETTING:0,HAS_WAN_L2TP:1,HAS_ADVANCED_DIAGNOSIS:0,HAS_OPMODE_SETTING:0,HAS_MRTG_SETTING:0,HAS_LED_CONTROL_SETTING:0,HAS_WLAN_WMM:0,HAS_WLAN_VLAN:0,HAS_SNMP:0,NON_USED:0} var wanConnectype=[[0,"Static IP"],[1,"PPPoE"],[2,"Dynamic IP Address"],[3,"PPTP"],[9,"L2TP"]]; var g_sysOPMode=0; var wlanApMode=0; var VENDORS= {vendorName:"TRENDnet", vendorMode:"Dual Band Concurrent Wireless N Router", modelName:"TEW-671BR", vendorLogo:"logo_nobrand.gif", bannerLogo:"iwizard_banner_7750.jpg", titleLogo:"title.gif"}; var default_language = 'uk'; var language = getCookie('language'); var file = 'file/'+ language + '.txt'; var xmlfile='file/'+language+'_xml.txt'; var tekst = readFile(file); var tekst_array = tekst.split("~"); function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "=") if (c_start!=-1) { c_start=c_start + c_name.length+1 c_end=document.cookie.indexOf(";",c_start) if (c_end==-1) c_end=document.cookie.length return unescape(document.cookie.substring(c_start,c_end)) } } return default_language; } function readFile(url){ var xmlhttp; /*@cc_on @if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } xmlhttp.open("GET",url,false); xmlhttp.send(null); return xmlhttp.responseText; } function showText(number) { return tekst_array[number]; } //TODO function showXmlText(number) { var tekst=readFile(xmlfile); var tekst_array=tekst.split("~"); return tekst_array[number]; } function showFwFixed() { var tekst=readFile(xmlfile); var tekst_array=tekst.split("~"); for(var i=3;i
  • ");} } var oWidth=12; var lWidth; var g_showHomeLink=new Array(); var g_showHomeStr=new Array(); var g_showFwLink=new Array(); var g_showFwStr=new Array(); var g_showWlanLink=new Array(); var g_showWlanStr=new Array(); var g_showra2WlanLink=new Array(); var g_showra2WlanStr=new Array(); var g_showAdvSetLink=new Array(); var g_showAdvSetStr=new Array(); var g_showToolBoxLink=new Array(); var g_showToolBoxStr=new Array(); function getOPMode(opmode) { var l2tpIdx=0; switch(opmode){ case 0://Ap router default : if(VENDORS.vendorName=="NetComm"){ g_showHomeLink=new Array("stainfo","lan","stadhcptbl","staschedule","stasylog","stasmonitor"); g_showHomeStr=new Array(showText(7),showText(8),"DHCP",showText(474),showText(11),showText(602)); } else{ g_showHomeLink=new Array("stainfo","lan","stadhcptbl","staschedule","stasylog","stasmonitor","stamultilan"); g_showHomeStr=new Array(showText(7),showText(8),"DHCP",showText(474),showText(11),showText(602),showText(603)); } if(FunctionList.HAS_DUAL_PPPOE) { if(FunctionList.HAS_IGMPPROXY || FunctionList.HAS_NETBIOS) { g_showIntLink=new Array("stanet","wanadv","wizard_dynamic","wizard_static","wizard_pppoe","wizard_pptp","dual_pppoe_cfg"); g_showIntStr=new Array(showText(7),showText(78),showText(135),showText(136),"PPPOE","PPTP","Dual PPPoE"); } else { g_showIntLink=new Array("stanet","wizard_dynamic","wizard_static","wizard_pppoe","wizard_pptp","dual_pppoe_cfg"); g_showIntStr=new Array(showText(7),showText(135),showText(136),"PPPOE","PPTP","Dual PPPoE"); } } else if(FunctionList.HAS_WAN_WIMAX_SETTING) { if(FunctionList.HAS_IGMPPROXY || FunctionList.HAS_NETBIOS) { g_showIntLink=new Array("stanet","wanadv","wizard_dynamic","wizard_static"); g_showIntStr=new Array(showText(7),showText(78),showText(135),showText(136)); } else { g_showIntLink=new Array("stanet","wizard_dynamic","wizard_static"); g_showIntStr=new Array(showText(7),showText(135),showText(136)); } } else { if(FunctionList.HAS_IGMPPROXY || FunctionList.HAS_NETBIOS) { g_showIntLink=new Array("stanet","wanadv","wizard_dynamic","wizard_static","wizard_pppoe","wizard_pptp"); g_showIntStr=new Array(showText(7),showText(78),showText(135),showText(136),"PPPOE","PPTP"); } else { g_showIntLink=new Array("stanet","wizard_dynamic","wizard_static","wizard_pppoe","wizard_pptp"); g_showIntStr=new Array(showText(7),showText(135),showText(136),"PPPOE","PPTP"); } } if(FunctionList.HAS_WAN_3G_SETTING) { g_showIntLink.push("wizard_3g"); g_showIntStr.push("3G"); } l2tpIdx=g_showIntLink.length; /*joey 2009-0714 add l2tp page*/ if(FunctionList.HAS_WAN_L2TP) { g_showIntLink.splice(l2tpIdx,0,"wizard_l2tp"); g_showIntStr.splice(l2tpIdx,0,"L2TP"); } if(FunctionList.HAS_WLAN_CONNECTION_CONTROL) { g_showWlanLink=new Array("wlbasic","wladvance","wlencrypt","wlcontrol","wps","staapclisurvey","wlctl"); g_showWlanStr=new Array(showText(77),showText(78),showText(79),showText(604),showText(306),showText(605),showText(519)); } else { g_showWlanLink=new Array("wlbasic","wladvance","wlencrypt","wlcontrol","wps","staapclisurvey"); g_showWlanStr=new Array(showText(77),showText(78),showText(79),showText(604),showText(306),showText(605)); } if(FunctionList.HAS_5G_SETTING) { //g_showWlanLink.unshift(""); //g_showWlanStr.unshift("2.4G"); g_showra2WlanLink=new Array("wlbasic_ra2","wladvance_ra2","wlencrypt_ra2","wlcontrol_ra2","wps_ra2","staapclisurvey_ra2"); g_showra2WlanStr=new Array(showText(77),showText(78),showText(79),showText(604),showText(306),showText(605)); if(FunctionList.HAS_WLAN_CONNECTION_CONTROL) { g_showra2WlanLink.push("wlctl_ra2"); g_showra2WlanStr.push(showText(519)); } //g_showra2WlanLink.unshift(""); //g_showra2WlanStr.unshift("5G"); } if(FunctionList.HAS_PASS_THROUGH) { g_showFwLink=new Array("fwmain","fwpass","fwdmz","fwdos","fwmaccontrol","fwipcontrol","fwurlb"); g_showFwStr=new Array(showText(87),showText(78),"DMZ","DoS",showText(606),showText(607),showText(608)); } else { g_showFwLink=new Array("fwmain","fwdmz","fwdos","fwmaccontrol","fwipcontrol","fwurlb"); g_showFwStr=new Array(showText(87),"DMZ","DoS",showText(606),showText(607),showText(608)); } g_showAdvSetLink=new Array("natmain","natpfw","natvser","natsapp","natalg","natupnp","wanqos","natsrout"); g_showAdvSetStr=new Array("NAT",showText(609),showText(610),showText(611),"ALG","UPnP","QoS",showText(436)); g_showToolBoxLink=new Array("syspasswd","systimezone","wanddns","powersaving","sysdiag","tlupgrade","tlcon","tlreset"); g_showToolBoxStr=new Array(showText(612),showText(613),"DDNS",showText(614),showText(615),showText(213),showText(214),showText(124)); if(wlanApMode==5) { g_showToolBoxLink.splice(3, 1); g_showToolBoxStr.splice(3, 1); } break; case 1://ap client if(VENDORS.vendorName=="NetComm"){ g_showHomeLink=new Array("stainfo","lan","staschedule","stasylog","stasmonitor"); g_showHomeStr=new Array(showText(7),showText(8),showText(474),showText(11),showText(602)); } else{ g_showHomeLink=new Array("stainfo","lan","staschedule","stasylog","stasmonitor","stamultilan"); g_showHomeStr=new Array(showText(7),showText(8),showText(474),showText(11),showText(602),showText(603)); } if(FunctionList.HAS_DUAL_PPPOE) { if(FunctionList.HAS_IGMPPROXY || FunctionList.HAS_NETBIOS) { g_showIntLink=new Array("stanet","wanadv","wizard_dynamic","wizard_static","wizard_pppoe","wizard_pptp","dual_pppoe_cfg"); g_showIntStr=new Array(showText(7),showText(78),showText(135),showText(136),"PPPOE","PPTP","Dual PPPoE"); } else { g_showIntLink=new Array("stanet","wizard_dynamic","wizard_static","wizard_pppoe","wizard_pptp","dual_pppoe_cfg"); g_showIntStr=new Array(showText(7),showText(135),showText(136),"PPPOE","PPTP","Dual PPPoE"); } } else if(FunctionList.HAS_WAN_WIMAX_SETTING) { if(FunctionList.HAS_IGMPPROXY || FunctionList.HAS_NETBIOS) { g_showIntLink=new Array("stanet","wanadv","wizard_dynamic","wizard_static"); g_showIntStr=new Array(showText(7),showText(78),showText(135),showText(136)); } else { g_showIntLink=new Array("stanet","wizard_dynamic","wizard_static"); g_showIntStr=new Array(showText(7),showText(135),showText(136)); } } else { if(FunctionList.HAS_IGMPPROXY || FunctionList.HAS_NETBIOS) { g_showIntLink=new Array("stanet","wanadv","wizard_dynamic","wizard_static","wizard_pppoe","wizard_pptp"); g_showIntStr=new Array(showText(7),showText(78),showText(135),showText(136),"PPPOE","PPTP"); } else { g_showIntLink=new Array("stanet","wizard_dynamic","wizard_static","wizard_pppoe","wizard_pptp"); g_showIntStr=new Array(showText(7),showText(135),showText(136),"PPPOE","PPTP"); } } if(FunctionList.HAS_WAN_3G_SETTING) { g_showIntLink.push("wizard_3g"); g_showIntStr.push("3G"); } if(FunctionList.HAS_WLAN_CONNECTION_CONTROL) { g_showWlanLink1=new Array("wlbasic","wlencrypt","staapclisurvey","wlctl"); g_showWlanStr1=new Array(showText(77),showText(79),showText(605),showText(519)); } else { g_showWlanLink1=new Array("wlbasic","wlencrypt","staapclisurvey"); g_showWlanStr1=new Array(showText(77),showText(79),showText(605)); } if(FunctionList.HAS_WLAN_CONNECTION_CONTROL) { g_showWlanLink2=new Array("wlbasic","staapclisurvey","wlctl"); g_showWlanStr2=new Array(showText(77),showText(605),showText(519)); } else { g_showWlanLink2=new Array("wlbasic","staapclisurvey"); g_showWlanStr2=new Array(showText(77),showText(605)); } if(FunctionList.HAS_PASS_THROUGH) { g_showFwLink=new Array("fwmain","fwpass","fwdmz","fwdos","fwmaccontrol","fwipcontrol","fwurlb"); g_showFwStr=new Array(showText(87),showText(78),"DMZ","DoS",showText(606),showText(607),showText(608)); } else { g_showFwLink=new Array("fwmain","fwdmz","fwdos","fwmaccontrol","fwipcontrol","fwurlb"); g_showFwStr=new Array(showText(87),"DMZ","DoS",showText(606),showText(607),showText(608)); } g_showAdvSetLink=new Array("natmain","natpfw","natvser","natsapp","natalg","natupnp","wanqos","natsrout"); g_showAdvSetStr=new Array("NAT",showText(609),showText(610),showText(611),"ALG","UPnP","QoS",showText(436)); g_showToolBoxLink=new Array("syspasswd","systimezone","powersaving","sysdiag","tlupgrade","tlcon","tlreset"); g_showToolBoxStr=new Array(showText(612),showText(613),showText(614),showText(615),showText(213),showText(214),showText(124)); break; case 5://WDS if(VENDORS.vendorName=="NetComm"){ g_showHomeLink=new Array("stainfo","lan","stadevice","staschedule","stasylog","stasmonitor"); g_showHomeStr=new Array(showText(7),showText(8),showText(9),showText(474),showText(11),showText(602)); } else{ g_showHomeLink=new Array("stainfo","lan","stadevice","staschedule","stasylog","stasmonitor","stamultilan"); g_showHomeStr=new Array(showText(7),showText(8),showText(9),showText(474),showText(11),showText(602),showText(603)); } g_showWlanLink=new Array("wlbasic"); g_showWlanStr=new Array(showText(77)); if(FunctionList.HAS_PASS_THROUGH) { g_showFwLink=new Array("fwmain","fwpass","fwdmz","fwdos","fwcontrol","fwurlb"); g_showFwStr=new Array(showText(87),showText(78),"DMZ","DoS",showText(128),showText(618)); } else { g_showFwLink=new Array("fwmain","fwdmz","fwdos","fwcontrol","fwurlb"); g_showFwStr=new Array(showText(87),"DMZ","DoS",showText(128),showText(618)); } g_showAdvSetLink=new Array("natmain","natpfw","natvser","natsapp","natalg","natupnp","wanqos"); g_showAdvSetStr=new Array(showText(87),showText(610),showText(616),showText(617),"ALG","UPnP","QoS"); g_showToolBoxLink=new Array("syspasswd","systimezone","powersaving","tlupgrade","tlcon","tlreset"); g_showToolBoxStr=new Array(showText(210),showText(211),showText(614),showText(213),showText(214),showText(124)); break; } } function showButton() { /* document.write('') document.write(' ') */ document.write('') document.write(' ') document.write('') } function sysLink(index,opmode) { getOPMode(opmode); lWidth=(100-oWidth*g_showHomeLink.length); document.write(""); for(i=1;i<=g_showHomeLink.length;i++){ var picStr=(index==g_showHomeLink[i-1])?"on":"off"; if(index==g_showHomeLink[i-1]){document.write("");} else{document.write("");} document.write(""+g_showHomeStr[i-1]+""); } document.write(""); document.write(""); } function internetLink(index,opmode) { getOPMode(opmode); lWidth=(100-oWidth*g_showIntLink.length); document.write(""); for(i=1;i<=g_showIntLink.length;i++){ var picStr=(index==g_showIntLink[i-1])?"on":"off"; if(index==g_showIntLink[i-1]){document.write("");} else{document.write("");} document.write(""+g_showIntStr[i-1]+""); } document.write(""); document.write(""); } function wlanLink(index,opmode,ssidnum) { var showWlanLink=new Array(); var showWlanStr=new Array(); getOPMode(opmode); if(opmode==0){ lWidth=(100-oWidth*g_showWlanLink.length); showWlanLink=g_showWlanLink; showWlanStr=g_showWlanStr; } else if(opmode==1 && ssidnum==1){ lWidth=(100-oWidth*g_showWlanLink2.length); showWlanLink=g_showWlanLink2; showWlanStr=g_showWlanStr2; } else{ lWidth=(100-oWidth*g_showWlanLink1.length); showWlanLink=g_showWlanLink1; showWlanStr=g_showWlanStr1; } document.write(""); for(i=1;i<=showWlanLink.length;i++){ var picStr=(index==showWlanLink[i-1])?"on":"off"; if(index==showWlanLink[i-1]){document.write("");} else{document.write("");} document.write(""+showWlanStr[i-1]+""); } document.write(""); document.write(""); } function wlanra2Link(index,opmode,ssidnum) { var showra2WlanLink=new Array(); var showra2WlanStr=new Array(); getOPMode(opmode); if(opmode==0){ lWidth=(100-oWidth*g_showra2WlanLink.length); showra2WlanLink=g_showra2WlanLink; showra2WlanStr=g_showra2WlanStr; } document.write(""); for(i=1;i<=showra2WlanLink.length;i++){ var picStr=(index==showra2WlanLink[i-1])?"on":"off"; if(index==showra2WlanLink[i-1]){document.write("");} else{document.write("");} document.write(""+showra2WlanStr[i-1]+""); } document.write(""); document.write(""); } function fwLink(index,enable) { getOPMode(g_sysOPMode); lWidth=(100-oWidth*g_showFwLink.length); document.write(""); if(enable==0){document.write(""); document.write(""); document.write('');} else{for(i=1;i<=g_showFwLink.length;i++){ var picStr=(index==g_showFwLink[i-1])?"on":"off"; if(index==g_showFwLink[i-1]){document.write("");} else{document.write("");} document.write(""+g_showFwStr[i-1]+"");} document.write("");} document.write(""); } function toolboxLink(index,opmode) { getOPMode(opmode); if(opmode==0) oWidth=12; lWidth=(100-(oWidth*g_showToolBoxLink.length)); document.write(""); for(i=1;i<=g_showToolBoxLink.length;i++){ var picStr=(index==g_showToolBoxLink[i-1])?"on":"off"; if(index==g_showToolBoxLink[i-1]){document.write("");} else{document.write("");} document.write(""+g_showToolBoxStr[i-1]+""); } document.write(""); document.write(""); } function upperEverFirst(str){ var upperStr = str.replace(/\s[a-z]/g,function($1){return $1.toLocaleUpperCase()}).replace(/^[a-z]/,function($1){return $1.toLocaleUpperCase()}); return upperStr; } function wanTypeList(index) { var selectArry=new Array(); var length = (FunctionList.HAS_WAN_3G_SETTING)?5:4; length=(FunctionList.HAS_WAN_L2TP) for(i=1;i<=length;i++) { selectArry[i]=(i==index)?"selected":""; } document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); if(FunctionList.HAS_WAN_3G_SETTING) document.write(""); } function advSettingLink(index,enable,opmode) { getOPMode(opmode); lWidth=(100-oWidth*g_showAdvSetLink.length); document.write(""); if(enable==0){document.write(""); document.write(""); document.write(""); document.write("Routing"); document.write('');} else{ for(i=1;i<=g_showAdvSetLink.length;i++){ var picStr=(index==g_showAdvSetLink[i-1])?"on":"off"; if(index==g_showAdvSetLink[i-1]){document.write("");} else{document.write("");} document.write(""+g_showAdvSetStr[i-1]+""); } } document.write(""); document.write(""); } var FIRMWAREVER=[ {model:"TEW-671BR",clonedMac:"true",webtitle:"Wireless Dual Band Concurrent AP Router",hasAutoChan:"1",pwrEth:"0",showDhcpcName:"0",portbaseQoS:"1"} ]; var g_modeTbl = new Array("AP Router","Station-Ad Hoc","Station-Infrastructure","AP Bridge-Point to Point","AP Bridge-Point to Multi-Point","WDS","AP Repeater"); var s_modeTbl = new Array("AP Router","Repeater","AP","Client Bridge","Client Router","WDS Bridge"); var MULTICAST_IP_REGX = new RegExp("^(22[4-9]|2[3-4][0-9]|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$"); function setFocus(field) { field.value = field.defaultValue; field.focus(); return; } function showSpacedText(str) { str=str.replace(/ /g," "); return str; } function dw(str) { document.write(str+'\n'); } function checkStaRoutingIPAddr(field) { if ( validateKey(field.value) == 0) return false; if ( !checkDigitRange(field.value,1,1,254)) return false; if ( !checkDigitRange(field.value,2,0,254)) return false; if ( !checkDigitRange(field.value,3,0,254)) return false; if ( !checkDigitRange(field.value,4,0,254)) return false; return true; } function checkMaskAddr(field) { if ( validateKey(field.value) == 0) return false; if ( !checkDigitRange(field.value,1,1,255)) return false; if ( !checkDigitRange(field.value,2,0,255)) return false; if ( !checkDigitRange(field.value,3,0,255)) return false; if ( !checkDigitRange(field.value,4,0,255)) return false; return true; } function checkIPAddr(field) { if ( validateKey(field.value) == 0) return false; if ( !checkDigitRange(field.value,1,1,255)) return false; if ( !checkDigitRange(field.value,2,0,255)) return false; if ( !checkDigitRange(field.value,3,0,255)) return false; if ( !checkDigitRange(field.value,4,1,254)) return false; return true; } function checkPincodeFormat(str) { var PIN = 0; for(i=0;i<8;i++) PIN = PIN + parseInt(str.charAt(i)) * Math.pow(10,7-i); var accum = 0; accum += 3 * parseInt((PIN / 10000000) % 10); accum += 1 * parseInt((PIN / 1000000) % 10); accum += 3 * parseInt((PIN / 100000) % 10); accum += 1 * parseInt((PIN / 10000) % 10); accum += 3 * parseInt((PIN / 1000) % 10); accum += 1 * parseInt((PIN / 100) % 10); accum += 3 * parseInt((PIN / 10) % 10); accum += 1 * parseInt((PIN / 1) % 10); return (0 == parseInt((accum % 10))); } function isRange(value, minValue, maxValue) { if(value <= maxValue && value >= minValue) return true; else return false; } function calcDHCPMaxIP(str) { var num; var zero=""; var bin=""; for(var i=1;i<=4;i++) { zero = ""; num = getDigit(str,i); var length = (rvt(num)).length; if(length < 8) { for(var j=1;j<=(8-length);j++) { zero = zero + '0'; } } bin = bin + zero + rvt(num); } return Math.pow(2,32 - bin.lastIndexOf('1') - 1) - 2; } function wlanTitlefor5G(band) { if(band==0) // 2.4G wireless dw('2.4G Setting:'); else if(band==1) // 5G wireless dw('5G Setting:'); } function checkLANandWANSubnet(lan_ip,lan_mask,wan_ip,wan_mask) { var lan_ip_t = lan_ip.split("."); var lan_mask_t = lan_mask.split("."); var wan_ip_t = wan_ip.split("."); var wan_mask_t = wan_mask.split("."); for(var i=0;i<4;i++){ if( (parseInt(lan_ip_t[i])&parseInt(lan_mask_t[i])) != (parseInt(wan_ip_t[i])&parseInt(wan_mask_t[i]))) return false; } return true; }