var ALL_INDEX=[];
var ALL_INDEXV=[];
ALL_INDEX.push("N00010600") //0
ALL_INDEXV.push("99")
ALL_INDEX.push("N00010601") //1
ALL_INDEXV.push("0")
ALL_INDEX.push("N00010602") //2
ALL_INDEXV.push("0")
ALL_INDEX.push("N00010603") //3
ALL_INDEXV.push("0")
ALL_INDEX.push("N00010604") //4
ALL_INDEXV.push("0")
ALL_INDEX.push("");
ALL_INDEXV.push("");
var ALL_ENABLE=[];
var ALL_ENABLEV=[];
var ALL_WANTYPE=[];
var ALL_WANTYPEV=[];
var FAILOVER_ENABLE=[];
var FAILOVER_ENABLEV=[];
ALL_ENABLE.push("N00010083"); //Local
ALL_ENABLEV.push("1");
ALL_WANTYPE.push("N00010003");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00430001");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N00010100"); //0
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N00010120");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00431000");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N00010101"); //1
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N00010121");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00431001");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N00010102"); //2
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N00010122");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00431002");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N00010103"); //3
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N00010123");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00431003");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N00010104"); //4
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N00010124");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00431004");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N00010105"); //5
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N00010125");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00431005");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N00010106"); //6
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N00010126");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00431006");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N00010107"); //7
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N00010127");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00431007");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N00010108"); //8
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N00010128");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00431008");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N00010109"); //9
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N00010129");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N00431009");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N0001010A"); //10
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N0001012A");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N0043100A");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N0001010B"); //11
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N0001012B");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N0043100B");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N0001010C"); //12
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N0001012C");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N0043100C");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N0001010D"); //13
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N0001012D");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N0043100D");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N0001010E"); //14
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N0001012E");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N0043100E");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push("N0001010F"); //15
ALL_ENABLEV.push("0");
ALL_WANTYPE.push("N0001012F");
ALL_WANTYPEV.push("0x00000000");
FAILOVER_ENABLE.push("N0043100F");
FAILOVER_ENABLEV.push("0");
ALL_ENABLE.push(""); //last
ALL_ENABLEV.push("");
ALL_WANTYPE.push("");
ALL_WANTYPEV.push("");
FAILOVER_ENABLE.push("");
FAILOVER_ENABLEV.push("");
var WAN_PVIDV=[];
var VLAN_TAGV=[];
WAN_PVIDV.push("2");  //?0
VLAN_TAGV.push("0");  //0
WAN_PVIDV.push("0");  //?1
VLAN_TAGV.push("0");  //1
WAN_PVIDV.push("0");  //?2
VLAN_TAGV.push("0");  //2
WAN_PVIDV.push("0");  //?3
VLAN_TAGV.push("0");  //3
WAN_PVIDV.push("0");  //?4
VLAN_TAGV.push("0");  //4
WAN_PVIDV.push("0");  //?5
VLAN_TAGV.push("0");  //5
WAN_PVIDV.push("1");  //PVC0
VLAN_TAGV.push("0");  //PV0?
WAN_PVIDV.push("1");  //PVC1
VLAN_TAGV.push("0");  //PV1?
WAN_PVIDV.push("1");  //PVC2
VLAN_TAGV.push("0");  //PV2?
WAN_PVIDV.push("1");  //PVC3
VLAN_TAGV.push("0");  //PV3?
WAN_PVIDV.push("1");  //PVC4
VLAN_TAGV.push("0");  //PV4?
WAN_PVIDV.push("1");  //PVC5
VLAN_TAGV.push("0");  //PV5?
WAN_PVIDV.push("1");  //PVC6
VLAN_TAGV.push("0");  //PV6?
WAN_PVIDV.push("1");  //PVC7
VLAN_TAGV.push("0");  //PV7?
WAN_PVIDV.push("");
VLAN_TAGV.push("");
/*Local:
Ethernet:99
Multi WAN:
1~5:Ethernet
5:SFP(����),���γ̤@��Ethernet
6~13:ADSL
10:VDSL when C_HAVE_META_VDSL=1
14~16:3G
14:3G/4G 1 or USB 3G/4G 1
15:3G/4G 2 or USB 3G/4G 2
16:WiFi
*/
sfp_idx="";
if(sfp_idx==""){ sfp_idx=5; }
if(typeof(swm_phy_wan_nmber)=="undefined"){       //�N�������J511_include.js
var Nwans="2";
var swName_idx=[];
swName_idx[99]=swName_idx[1]=swName_idx[2]=swName_idx[3]=swName_idx[4]=swName_idx[5]=swName_idx[14]=swName_idx[15]="N/A";
var swm_phy_ethernet=swm_phy_ethernet2=swm_phy_xdsl_pvc0=swm_phy_3g_4g1=swm_phy_3g_4g2=swm_phy_wisp=swm_phy_wisp2=swm_phy_sfp=swm_phy_vdsl=0;
}else{
Nwans=swm_phy_wan_nmber;
}
var all_wan=[swName_idx[99],swName_idx[1],"ADSL",swName_idx[14],swName_idx[15],GetElmCont('wpa_0','WiFi Module One'),GetElmCont('wpa_0','WiFi Module Two'),GetElmCont('wiz20_0','SFP'),"VDSL"]
var all_wanv=[99,1,6,14,15,16,15,sfp_idx,10]
var all_wan_default=["0x00000000","0x00000000","0x00000000","0x00000010","0x00000010","0x00000013","0x00000013","0x00000000","0x00000000"]
var all_wan_func=[swm_phy_ethernet,swm_phy_ethernet2,swm_phy_xdsl_pvc0,swm_phy_3g_4g1,swm_phy_3g_4g2,swm_phy_wisp,swm_phy_wisp2,swm_phy_sfp,swm_phy_vdsl]
var phy_all=[];
var phy_allv=[];
var phy_all_default=[];
var phy_all_type=[];
for (i=0, len = all_wan_func.length; i < len;i++){
if(all_wan_func[i]>0){
phy_all.push(all_wan[i]);
phy_allv.push(all_wanv[i]);
phy_all_default.push(all_wan_default[i]);
phy_all_type.push(all_wan_func[i]);
}
}
var wantype = [];
wantype["0x00000000"] = GetElmCont("prim_0","Dynamic IP");
wantype["0x00000002"] = GetElmCont("wiz20_0","RFC 1483 Bridged");
wantype["0x00000010"] = GetElmCont("sta_0","3G/4G");
wantype["0x00000013"] = GetElmCont("wiz20_0","Uplink");
wantype["0x00000020"] = GetElmCont("sta_0","Static IP");
wantype["0x00000030"] = GetElmCont("wiz20_0","Ethernet over ATM with NAT");
wantype["0x00000031"] = GetElmCont("wiz20_0","Ethernet over ATM with NAT");
wantype["0x00000040"] = GetElmCont("sta_0","PPPoE");
wantype["0x00000043"] = GetElmCont("wiz20_0","PPPoE (ADSL)");
wantype["0x00000050"] = GetElmCont("wiz20_0","PPP over ATM");
wantype["0x00000051"] = GetElmCont("wiz20_0","IP over ATM");
wantype["0x00000052"] = GetElmCont("wiz20_0","IP over ATM");
wantype["0x00000060"] = GetElmCont("sta_0","PPTP");
wantype["0x00000080"] = GetElmCont("sta_0","L2TP");
wantype["0x00000090"] = GetElmCont("wiz20_0","Dial-up Network");
var LIST_SET=[];
var wanopmode="";
function list_arr(){
for (i=0;i<Nwans;i++){
if(ALL_INDEXV[i]!="0"){
var idx=(ALL_INDEXV[i]=="99")?0:ALL_INDEXV[i];
var add_str = "";
wiface=ALL_INDEXV[i];
sw_phy=swName_idx[wiface];
add_str += sw_phy +"|";
var opmode = (FAILOVER_ENABLEV[idx]==ALL_INDEXV[i])?1:0;
add_str += opmode +"|";
if(i==0) { wanopmode += opmode }
else { wanopmode += "-"+opmode }
add_str += FAILOVER_ENABLEV[idx] +"|";
wtype=ALL_WANTYPEV[idx];
if(wtype=="0xFFFFFFFF")  wtype="0x00000000";
sw_wtype=wantype[wtype];
add_str += sw_wtype +"|";
add_str += VLAN_TAGV[idx] +"|";
add_str += WAN_PVIDV[idx];
LIST_SET.push(add_str);
}else{
LIST_SET.push(" - |2|0| - |0|0");
if(i==0) wanopmode += "2";
else wanopmode += "-2"
}
}
LIST_SET.push("");
}
list_arr()