var wlItemsCgiCmd = new Array(
  "wlswitchinterface0.wl",
  "wlswitchinterface1.wl",
  "wlswitchinterface2.wl",
  "wlswitchinterface3.wl"
);
var wlmenuTitle = new Array("wl0", "wl1", "wl2", "wl3");
function menuAdmin(aj) {
  var b = aj.MENU_OPTION_STANDARD;
  var a2 = aj.MENU_OPTION_PROTOCOL;
  var al = aj.MENU_OPTION_FIREWALL;
  var aS = aj.MENU_OPTION_IP_EXTENSION;
  var aU = aj.MENU_OPTION_WIRELESS;
  var aE = aj.MENU_OPTION_VOICE;
  var H = aj.MENU_OPTION_SNMP;
  var l = aj.MENU_OPTION_DDNSD;
  var aa = aj.MENU_OPTION_NTPD;
  var ai = aj.MENU_OPTION_EBTABLES;
  var q = aj.MENU_OPTION_BRIDGE;
  var aH = aj.MENU_OPTION_TOD;
  var K = aj.MENU_OPTION_PORTMAP;
  var aV = 0;
  var aN = aj.MENU_OPTION_DLNA;
  var G = aj.MENU_OPTION_SNIFFER;
  var i = aj.MENU_OPTION_WIRELESS_SES;
  var aF = aj.MENU_OPTION_RIP;
  var am = 0;
  var az = 0;
  var A = aj.MENU_OPTION_WL_QOS;
  var ar = aj.MENU_OPTION_TR69C;
  var aI = aj.MENU_OPTION_IPV6_SUPPORT;
  var aQ = aj.MENU_OPTION_IPV6_ENABLE;
  var j = aj.MENU_OPTION_UPNP;
  var c = aj.MENU_OPTION_URLFILTER;
  var x = aj.MENU_OPTION_DNSPROXY;
  var y = aj.MENU_OPTION_POLICY_ROUTING;
  var aO = aj.MENU_OPTION_OMCI;
  var w = aj.MENU_OPTION_WIRELESS_NUM_ADAPTOR;
  var ac = aj.MENU_OPTION_ETHWAN;
  var h = aj.MENU_OPTION_PTMWAN;
  var aP = aj.MENU_OPTION_EPTAPP;
  var v = aj.MENU_OPTION_PWRMNGT;
  var U = aj.MENU_OPTION_STANDBY;
  var aB = aj.MENU_OPTION_VOICE_NTR;
  var af = aj.MENU_OPTION_ATMWAN;
  var ay = aj.MENU_OPTION_MOCAWAN;
  var aW = aj.MENU_OPTION_GPONWAN;
  var J = aj.MENU_OPTION_EPONWAN;
  var aD = aj.MENU_OPTION_VOICE_DECT;
  var B = aj.MENU_OPTION_DSL_BONDING;
  var a3 = 0;
  var ab = 0;
  var aK = aj.MENU_OPTION_STORAGESERVICE;
  var ap = aj.MENU_OPTION_SAMBA;
  var ad = aj.MENU_OPTION_SUPPORT_MOCA;
  var P = aj.MENU_OPTION_WIRELESS_WAPI_AS;
  var s = aj.MENU_OPTION_AUTODETECTION;
  var ah = aj.MENU_OPTION_POLICE_ENABLE;
  var aM = 0;
  var V = aj.MENU_OPTION_MODSW_WEBUI;
  var S = aj.MENU_OPTION_MODSW_WEBUI_ADMIN;
  var aJ = aj.MENU_OPTION_MODSW_BASELINE;
  var an = aj.MENU_OPTION_BMU;
  var at = aj.MENU_OPTION_BUILD_VDSL;
  var Q = aj.MENU_OPTION_SUPPORT_LAN_VLAN;
  var ao = aj.MENU_OPTION_WIFIWAN;
  var d = aj.MENU_OPTION_SUPPORT_ETHPORTSHAPING;
  var ae = aj.MENU_OPTION_BUILD_TMS;
  var Y = aj.MENU_OPTION_BUILD_SPDSVC;
  var aC = aj.MENU_OPTION_SUPPORT_HOMEPLUG;
  var aX = 0;
  var p = aj.MENU_OPTION_JQPLOT;
  var N = aj.MENU_OPTION_WEB_SOCKETS;
  var m = aj.MENU_OPTION_DPI;
  var k = aj.MENU_OPTION_SUPPORT_IEEE1905;
  var aY = aj.MENU_OPTION_SUPPORT_WEBSOCKETS;
  var av = 0;
  var f = aj.MENU_OPTION_VOICE_SIP_CCTK;
  var E = aj.MENU_OPTION_SUPPORT_WLPASSPOINT;
  var n = aj.MENU_OPTION_SUPPORT_CELLULAR;
  var X = aj.MENU_OPTION_NFC;
  var aA = aj.MENU_OPTION_EPON_LOID;
  var aL = aj.MENU_OPTION_INGRESS_FILTERS;
  var r = aj.MENU_OPTION_SUPPORT_WLROUTER_PAGE;
  var au = aj.MENU_OPTION_OPENVSWITCH;
  var aG = aj.MENU_OPTION_STUN;
  var R = aj.MENU_OPTION_DEMO_ITEM;
  var C = 0;
  var ag = aj.MENU_OPTION_VOICE_SIPMODE;
  var O = aj.MENU_OPTION_AIRIQ_ENABLE;
  var T = aj.MENU_OPTION_PMD;
  var aT = 0;
  var I = aj.MENU_OPTION_WAN_SELECT;
  var a0 = aj.MENU_OPTION_SUPPORT_WLIQOS;
  var aw = aj.MENU_OPTION_SRV_CNTR;
  var e = aj.MENU_OPTION_SRV_IP_CNTR;
  var aq = aj.MENU_OPTION_NETSERVICE;
  var u = aj.MENU_OPTION_LED_RESTORE_CNTR;
  var t = 0;
  var z = aj.MENU_OPTION_FIREWALL_OF_TR181;
  var aR = aj.MENU_OPTION_BUILDALG;
  var aZ = aj.MENU_OPTION_STATIC_DNS;
  var o = aj.MENU_OPTION_SNTP;
  var L = aj.MENU_OPTION_GRE_TUNNEL;
  var M = 1;
  var W = aj.MENU_OPTION_DIAGNOSTICS_TOOLS;
  var F = aj.MENU_OPTION_TIMEOUTSETTING;
  var ak = aj.MENU_OPTION_SUPPORT_WARNING;
  var a1 = aj.MENU_OPTION_lOADBANANCE;
  var ax = aj.MENU_OPTION_SUPPORT_TKIP;
  var D = aj.MENU_OPTION_SUPPORT_WirelessSeparation;
  var a = 0;
  var g = aj.MENU_OPTION_WANBACKUP;
  var Z = h == "1" || af == "1" || ay == "1" || n == "1" || ac == "1" || ao == "1" || aW == "1" || J == "1";
  if (af == "1") {
    aM = 1;
    nodeAdvancedSetup = insFld(foldersTree, gFld(getMenuTitle(MENU_ADVANCED_SETUP), "dslatm.html"));
    nodeLayer2Inteface = insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "dslatm.html"));
    insDoc(nodeLayer2Inteface, gLnk("R", getMenuTitle(MENU_DSL_ATM_INTERFACE), "dslatm.html"));
  }
  if (h == "1") {
    aM = 1;
    if (af != "1") {
      nodeAdvancedSetup = insFld(foldersTree, gFld(getMenuTitle(MENU_ADVANCED_SETUP), "dslptm.html"));
      nodeLayer2Inteface = insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "dslptm.html"));
    }
    insDoc(nodeLayer2Inteface, gLnk("R", getMenuTitle(MENU_DSL_PTM_INTERFACE), "dslptm.html"));
  }
  if (aW == "1") {
    if (!(af == "1" || h == "1")) {
      nodeAdvancedSetup = insFld(foldersTree, gFld(getMenuTitle(MENU_ADVANCED_SETUP), "gponwan.cmd"));
      nodeLayer2Inteface = insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "gponwan.cmd"));
    }
    insDoc(nodeLayer2Inteface, gLnk("R", getMenuTitle(MENU_GPONWAN_INTERFACE), "gponwan.cmd"));
  }
  if (J == "1") {
    if (!(af == "1" || h == "1" || aW == "1")) {
      nodeAdvancedSetup = insFld(foldersTree, gFld(getMenuTitle(MENU_ADVANCED_SETUP), "eponwan.cmd"));
      nodeLayer2Inteface = insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "eponwan.cmd"));
    }
    insDoc(nodeLayer2Inteface, gLnk("R", getMenuTitle(MENU_EPONWAN_INTERFACE), "eponwan.cmd"));
  }
  if (ac == "1") {
    if (!(af == "1" || h == "1" || aW == "1" || J == "1")) {
      nodeAdvancedSetup = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_ADVANCED_SETUP), "ethwan.html")
      );
      nodeLayer2Inteface = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "ethwan.html")
      );
    }
    insDoc(
      nodeLayer2Inteface,
      gLnk("R", getMenuTitle(MENU_ETH_INTERFACE), "ethwan.html")
    );
  }
  if (ao == "1") {
    if (!(af == "1" || h == "1" || aW == "1" || J == "1" || ac == "1")) {
      nodeAdvancedSetup = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_ADVANCED_SETUP), "wifiwan.cmd")
      );
      nodeLayer2Inteface = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "wifiwan.cmd")
      );
    }
    insDoc(
      nodeLayer2Inteface,
      gLnk("R", getMenuTitle(MENU_WIFI_INTERFACE), "wifiwan.cmd")
    );
  }
  if (ay == "1") {
    if (!(af == "1" || h == "1" || ac == "1")) {
      nodeAdvancedSetup = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_ADVANCED_SETUP), "mocawan.cmd")
      );
      nodeLayer2Inteface = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "mocawan.cmd")
      );
    }
    insDoc(
      nodeLayer2Inteface,
      gLnk("R", getMenuTitle(MENU_MOCA_INTERFACE), "mocawan.cmd")
    );
  }
  if (n == "1") {
    if (
      !(
        af == "1" ||
        h == "1" ||
        aW == "1" ||
        J == "1" ||
        ac == "1" ||
        ao == "1" ||
        ay == "1"
      )
    ) {
      nodeAdvancedSetup = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_ADVANCED_SETUP), "cellular.html")
      );
      nodeLayer2Inteface = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "cellular.html")
      );
    }
    nodeCellular = insFld(
      nodeLayer2Inteface,
      gFld(getMenuTitle(MENU_CELLULAR_INTERFACE), "cellular.html")
    );
    insDoc(
      nodeCellular,
      gLnk(
        "R",
        getMenuTitle(MENU_CELLULAR_INTERFACE_INTF),
        "cellularinterface.html"
      )
    );
    insDoc(
      nodeCellular,
      gLnk("R", getMenuTitle(MENU_CELLULAR_APN), "cellularapn.cmd?action=view")
    );
    insDoc(
      nodeCellular,
      gLnk("R", getMenuTitle(MENU_CELLULAR_SMS), "cellularsms.cmd?action=view")
    );
  }
  if (Z) {
    insDoc(nodeAdvancedSetup, gLnk("R", getMenuTitle(MENU_WAN), "wancfg.html"));
  } else {
    nodeAdvancedSetup = insFld(
      foldersTree,
      gFld(getMenuTitle(MENU_ADVANCED_SETUP), "lancfg2.html")
    );
  }
  if (aT == "1") {
    nodEthLag = insDoc(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_ETH_LAG), "ethLagCfg.cmd")
    );
  }
  if (M == "1") {
    insDoc(nodeAdvancedSetup, gLnk("R", getMenuTitle(MENU_WAN_USB_MODEM_CFG), "wanusbmodem_cfgview.html"));
  }
  nodeLAN = insDoc(
    nodeAdvancedSetup,
    gFld(getMenuTitle(MENU_LAN), "lancfg2.html")
  );
  insDoc(nodeLAN, gLnk("R", getMenuTitle(MENU_LAN4), "lancfg2.html"));
  if (aQ == "1") {
    insDoc(nodeLAN, gLnk("R", getMenuTitle(MENU_LAN6), "ipv6lancfg.html"));
  }
  if (Q == "1") {
    insDoc(nodeLAN, gLnk("R", getMenuTitle(MENU_LAN_VLAN), "lanvlancfg.html"));
  }
  if (t == "1") {
    insDoc(
      nodeLAN,
      gLnk("R", getMenuTitle(MENU_ETH_SPEED), "ethspeedcfg.html")
    );
  }
  if (L == "1") {
    insDoc(
      nodeAdvancedSetup,
      gLnk("R", getMenuTitle(MENU_GRE_TUNNEL), "gre_tunnelview.html")
    );
  }
  if (ab == "1") {
    nodeVPN = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_VPN), "l2tpacwan.cmd")
    );
    insDoc(nodeVPN, gLnk("R", getMenuTitle(MENU_VPN_L2TPAC), "l2tpacwan.cmd"));
    insDoc(nodeVPN, gLnk("R", getMenuTitle(MENU_VPN_PPTPAC), "pptpacwan.cmd"));
    if (a == "1") {
      insDoc(
        nodeVPN,
        gLnk("R", getMenuTitle(MENU_OPENVPN), "openvpnview.html")
      );
    }
  } else {
    if (a == "1") {
      nodeVPN = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_VPN), "openvpnview.html")
      );
      insDoc(
        nodeVPN,
        gLnk("R", getMenuTitle(MENU_OPENVPN), "openvpnview.html")
      );
    }
  }
  if (s == "1") {
    insDoc(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_AUTODETECTION), "autodetection.cmd?action=view")
    );
  }
  if (ad == "1") {
    insDoc(
      nodeAdvancedSetup,
      gLnk("R", getMenuTitle(MENU_MOCA_CONFIGURATION), "mocacfg.html")
    );
  }
  if (Z) {
    if (a2 != "Not Applicable" && aS != "1") {
      nodeNat = insDoc(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_SC_NAT), "scvrtsrv_view.html")
      );
      insDoc(nodeNat, gLnk("R", getMenuTitle(MENU_SC_VIRTUAL_SERVER), "scvrtsrv_view.html"));
      insDoc(nodeNat, gLnk("R", getMenuTitle(MENU_SC_PORT_TRIGGER), "scprttrg_view.html"));
      insDoc(nodeNat, gLnk("R", getMenuTitle(MENU_SC_DMZ_HOST), "scdmz.html"));
      if (aR == "1") {
        insDoc(nodeNat, gLnk("R", getMenuTitle(MENU_ALGS), "algcfg.html"));
      }
      nodeMacfilter = insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_MAC_FILTER), "scmacflt_view.html"));
      if (aH == "1") {
        nodeParentalControl = insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_PARENTAL_CNTL), "todmngr_view.html"));
        insDoc(nodeParentalControl, gFld(getMenuTitle(MENU_TOD), "todmngr_view.html"));
        if (c == "1") {
          insDoc(nodeParentalControl, gFld(getMenuTitle(MENU_URLFILTER), "urlfilter_view.html"));
        }
      } else {
        if (c == "1") {
          nodeParentalControl = insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_PARENTAL_CNTL), "urlfilter_view.html"));
          insDoc(nodeParentalControl, gFld(getMenuTitle(MENU_URLFILTER), "urlfilter_view.html"));
        }
      }
      if (z == "1") {
        nodeParentalControl = insFld(
          nodeAdvancedSetup,
          gFld(getMenuTitle(MENU_FIREWALL_OF_TR181), "firewallOfTr181_view.html"));
      }
    }
    nodeQos = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_QOS), "qosqmgmt.html")
    );
    nodeQosQueue = insFld(
      nodeQos,
      gFld(getMenuTitle(MENU_QOS_QUEUE), "qosqueue_view.html")
    );
    insDoc(
      nodeQosQueue,
      gLnk("R", getMenuTitle(MENU_QUEUE_CFG), "qosqueue_view.html")
    );
    if (parseInt(w) != 0) {
      insDoc(
        nodeQosQueue,
        gLnk("R", getMenuTitle(MENU_WL_QUEUE), "qosqueue_view_wlq.html")
      );
    }
    if (ah == "1") {
      insDoc(
        nodeQos,
        gLnk("R", getMenuTitle(MENU_QOS_POLICER), "qospolicer.cmd?action=view")
      );
    }
    insDoc(
      nodeQos,
      gLnk("R", getMenuTitle(MENU_QOS_CLASS), "qoscls_view.html")
    );
    if (d == "1") {
      insDoc(
        nodeQos,
        gLnk("R", getMenuTitle(MENU_QOS_PORT_SHAPING), "qosportshaping.html")
      );
    }
    nodeRouting = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_ROUTING), "rtdefaultcfg.html")
    );
    insDoc(
      nodeRouting,
      gLnk("R", getMenuTitle(MENU_RT_DEFAULT_ROUTE), "rtdefaultcfg.html")
    );
    insDoc(
      nodeRouting,
      gLnk("R", getMenuTitle(MENU_RT_STATIC_ROUTE), "rtroutecfg_viewcfg.html")
    );
  } else {
    nodeRouting = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_ROUTING), "rtroutecfg_viewcfg.html")
    );
    insDoc(
      nodeRouting,
      gLnk("R", getMenuTitle(MENU_RT_STATIC_ROUTE), "rtroutecfg_viewcfg.html")
    );
  }
  if (y == "1") {
    insDoc(
      nodeRouting,
      gLnk("R", getMenuTitle(MENU_POLICY_ROUTING), "prmngr_view.html")
    );
  }
  if (
    (a2 == "PPPoE" && aS == "0") ||
    (a2 == "PPPoA" && aS == "0") ||
    a2 == "MER" ||
    a2 == "IPoA"
  ) {
    if (aF == "1") {
      insDoc(
        nodeRouting,
        gLnk("R", getMenuTitle(MENU_RT_RIP), "ripcfg_view.html")
      );
    }
    nodeDnsSetup = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_DNS), "dnscfg.html")
    );
    insDoc(
      nodeDnsSetup,
      gLnk("R", getMenuTitle(MENU_DNS_SETUP), "dnscfg.html")
    );
    if (l == "1") {
      insDoc(nodeDnsSetup, gLnk("R", getMenuTitle(MENU_DDNS), "ddnsmngr.html"));
    }
    if (aZ == "1") {
      insDoc(
        nodeDnsSetup,
        gLnk("R", getMenuTitle(MENU_STATIC_DNS), "staticdnscfg.html")
      );
    }
  }
  if (aM == 1) {
    if (b == "annex_c") {
      insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_DSL), "adslcfgc.html"));
    } else {
      if (at == "1") {
        insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_DSL), "xdslcfg.html"));
      } else {
        if (at == "2") {
          insFld(
            nodeAdvancedSetup,
            gFld(getMenuTitle(MENU_DSL), "xdslcfg1.html")
          );
        } else {
          insFld(
            nodeAdvancedSetup,
            gFld(getMenuTitle(MENU_DSL), "adslcfg.html")
          );
        }
      }
    }
    if (B == "1") {
      insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_DSL_BONDING), "dslbondingcfg.html")
      );
    }
  }
  if (j == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_UPNP), "upnpcfg.html"));
  }
  if (x == "1") {
    insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_DNSPROXY), "dnsproxycfg.html")
    );
  }
  if (aV == "1") {
    insDoc(nodeAdvancedSetup, gFld(getMenuTitle(MENU_IPP), "ippcfg.html"));
  }
  if (aN == "1") {
    insDoc(nodeAdvancedSetup, gFld(getMenuTitle(MENU_DLNA), "dlnacfg.html"));
  }
  if (a1 == "1") {
    insDoc(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_LOADBALANCE), "loadbalance.html")
    );
  }
  if (parseInt(w) != 0) {
    if (r == "y" || r == "1") {
      if (D == "0") {
        wl_wr_node = insFld(foldersTree, gFld("Wireless", "wlrouter/ssid.html"));
        insDoc(wl_wr_node, gLnk("R", getMenuTitle(MENU_WL_MENU_RADIO), "wlrouter/radio.html"));
        insDoc(wl_wr_node, gLnk("R", getMenuTitle(MENU_WL_MENU_MEDIA), "wlrouter/media.html"));
        insDoc(wl_wr_node, gLnk("R", getMenuTitle(MENU_WL_MENU_SSID), "wlrouter/ssid.html"));
        insDoc(
          wl_wr_node,
          gLnk("R", getMenuTitle(MENU_WL_MENU_SECURITY), "wlrouter/security.html"));
        insDoc(wl_wr_node, gLnk("R", getMenuTitle(MENU_WL_MENU_WPS), "wlrouter/wps.html"));
      } else {
        wl_wr_node = insFld(foldersTree, gFld("Wi-Fi", "wlrouter/ssid.html"));
        wl_24_node = insFld(wl_wr_node, gFld("2.4GHz", "wlrouter/ssid.html"));
        insDoc(wl_24_node, gLnk("R", getMenuTitle(MENU_WL_MENU_SSID), "wlrouter/ssid.html"));
        insDoc(wl_24_node, gLnk("R", getMenuTitle(MENU_WL_MENU_SECURITY), "wlrouter/security.html"));
        insDoc(wl_24_node, gLnk("R", getMenuTitle(MENU_WL_MENU_WPS), "wlrouter/wps.html"));
        insDoc(wl_24_node, gLnk("R", "MAC Filter", "wlrouter/macfilter.html"));
        insDoc(wl_24_node, gLnk("R", "Advanced", "wlrouter/radio.html"));
        wl_5_node = insFld(wl_wr_node, gFld("5GHz ", "wlrouter/ssid_5.html"));
        insDoc(wl_5_node, gLnk("R", getMenuTitle(MENU_WL_MENU_SSID), "wlrouter/ssid_5.html"));
        insDoc(wl_5_node, gLnk("R", getMenuTitle(MENU_WL_MENU_SECURITY), "wlrouter/security_5.html"));
        insDoc(wl_5_node, gLnk("R", getMenuTitle(MENU_WL_MENU_WPS), "wlrouter/wps_5.html"));
        insDoc(wl_5_node, gLnk("R", "MAC Filter", "wlrouter/macfilter_5.html"));
        insDoc(wl_5_node, gLnk("R", "Advanced", "wlrouter/radio_5.html"));
      }
      if (E == "1") {
        insDoc(wl_wr_node, gLnk("R", getMenuTitle(MENU_WL_PASSPOINT), "wlrouter/passpoint.html"));
      }
      if (av == "1") {
        wlVisualNode = insFld(wl_wr_node, gFld(getMenuTitle(MENU_WL_VISUALIZATION), "wlrouter/configure.html"));
        insDoc(wlVisualNode, gLnk("R", getMenuTitle(MENU_WL_VISUALIZATION_SITESURVEY), "wlrouter/visindex.html"));
        insDoc(wlVisualNode, gLnk("R", getMenuTitle(MENU_WL_VISUALIZATION_CHANNELSTAT), "wlrouter/channelcapacity.html"));
        insDoc(wlVisualNode, gLnk("R", getMenuTitle(MENU_WL_VISUALIZATION_METRICS), "wlrouter/metrics.html"));
        insDoc(wlVisualNode, gLnk("R", getMenuTitle(MENU_WL_VISUALIZATION_CONFIGURE), "wlrouter/configure.html"));
      }
      if (aj.MENU_OPTION_APLIST == "1") {
        insDoc(wl_wr_node, gLnk("R", "Wi-Fi Analyser", "sitesurvey.html"));
      }
      if (R == "1" || R == "y") {
        insDoc(wl_wr_node, gLnk("R", getMenuTitle(MENU_WL_MENU_DEMO_ON_DFS), "wlrouter/zerowaitdfs.html"));
        insDoc(wl_wr_node, gLnk("R", getMenuTitle(MENU_WL_MENU_DEMO_ON_WBD), "wlrouter/wbd_demo.html"));
      }
      if (O == "1" || O == "y") {
        insDoc(wl_wr_node, gLnk("R", getMenuTitle(MENU_WL_AIRIQ_ENABLE), "wlrouter/airiq.html"));
      }
      if (a0 == "1") {
        insDoc(wl_wr_node, gLnk("R", getMenuTitle(MENU_WL_IQOS), "wlrouter/iQoSNetworkSummary.html"));
      }
    }
  }
  if (aK == "1") {
    nodeStorage = insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_STORAGESERVICE), "storageservicecfg_view.html"));
    insDoc(nodeStorage, gLnk("R", getMenuTitle(MENU_STORAGE_INFO), "storageservicecfg_view.html"));
    if (ap == "1") {
      insDoc(nodeStorage, gLnk("R", getMenuTitle(MENU_STORAGE_USERACCOUNT), "storageuseraccountcfg_view.html"));
    }
  }
  if (aE == "MGCP") {
    nodeVoice = insFld(
      foldersTree,
      gFld(getMenuTitle(MENU_VOICE_SETTINGS), "voicemgcp_basic.html")
    );
    insDoc(
      nodeVoice,
      gLnk("R", getMenuTitle(MENU_VOICE_MGCP), "voicemgcp_basic.html")
    );
    if (aB != "2") {
      insDoc(
        nodeVoice,
        gLnk("R", getMenuTitle(MENU_VOICE_NTR), "voicentr.html")
      );
    }
  } else {
    if (aE == "H.248") {
      nodeVoice = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_VOICE_SETTINGS), "voiceh248_status.html")
      );
      insDoc(
        nodeVoice,
        gLnk("R", getMenuTitle(MENU_VOICE_H248_STATUS), "voiceh248_status.html")
      );
      insDoc(
        nodeVoice,
        gLnk("R", getMenuTitle(MENU_VOICE_H248_BASIC), "voiceh248_basic.html")
      );
      insDoc(
        nodeVoice,
        gLnk(
          "R",
          getMenuTitle(MENU_VOICE_H248_ADVANCED),
          "voiceh248_advanced.html"
        )
      );
    } else {
      if (aE == "SIP") {
        nodeVoice = insFld(
          foldersTree,
          gFld(getMenuTitle(MENU_VOICE_SETTINGS), "voicesip_status.html")
        );
        insDoc(
          nodeVoice,
          gLnk("R", getMenuTitle(MENU_VOICE_SIP_STATUS), "voicesip_status.html")
        );
        insDoc(
          nodeVoice,
          gLnk("R", getMenuTitle(MENU_VOICE_SIP_BASIC), "voicesip_basic.html")
        );
        insDoc(
          nodeVoice,
          gLnk(
            "R",
            getMenuTitle(MENU_VOICE_SIP_ADVANCED),
            "voicesip_advanced.html"
          )
        );
        insDoc(
          nodeVoice,
          gLnk(
            "R",
            getMenuTitle(MENU_VOICE_SIP_STARCODE),
            "voicesip_starCode.html"
          )
        );
        insDoc(
          nodeVoice,
          gLnk("R", getMenuTitle(MENU_VOICE_SIP_EXTRA), "voicesip_extra.html")
        );
        insDoc(
          nodeVoice,
          gLnk(
            "R",
            getMenuTitle(MENU_VOICE_SIP_ERRINFO),
            "voicesip_errinfo.html"
          )
        );
        if (f == "1") {
          insDoc(
            nodeVoice,
            gLnk("R", getMenuTitle(MENU_VOICE_SIP_CCTK), "voicesip_cctk.html")
          );
        }
        if (aB != "2") {
          insDoc(
            nodeVoice,
            gLnk("R", getMenuTitle(MENU_VOICE_NTR), "voicentr.html")
          );
        }
        if (aD == "1") {
          insDoc(
            nodeVoice,
            gLnk("R", getMenuTitle(MENU_VOICE_DECT), "voicedect.html")
          );
        }
      }
    }
  }
  if (Z && K == "1") {
    insDoc(
      nodeAdvancedSetup,
      gLnk("R", getMenuTitle(MENU_INTF_GROUPING), "portmap.html")
    );
  }
  if (am == "1") {
    insDoc(
      nodeAdvancedSetup,
      gLnk("R", getMenuTitle(MENU_SC_IPSEC), "ipsec.cmd?action=view")
    );
  }
  if (az == "1") {
    nodeCert = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_CERT), "certlocal.cmd?action=view")
    );
    insDoc(
      nodeCert,
      gLnk("R", getMenuTitle(MENU_CERT_LOCAL), "certlocal.cmd?action=view")
    );
    insDoc(
      nodeCert,
      gLnk("R", getMenuTitle(MENU_CERT_CA), "certca.cmd?action=view")
    );
  }
  if (U == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_STANDBY), "standby.html"));
  }
  if (v == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_PWRMNGT), "pwrmngt.html"));
  }
  if (an == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_BMU), "bmu.html"));
  }
  if (a3 == "1") {
    insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_MULTICAST), "multicast.html")
    );
  }
  if (aA == "1") {
    insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_OAM_LOID), "eponloid.html")
    );
  }
  if (aL == "1") {
    insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_INGRESS_FILTERS), "ingressFilters.html")
    );
  }
  if (X == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_NFC), "nfc.html"));
  }
  if (aC == "1") {
    nodeHomePlug = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_HOMEPLUG_INFO), "homeplug.html")
    );
    insDoc(
      nodeHomePlug,
      gLnk("R", getMenuTitle(MENU_HOMEPLUG_PASSWORD), "homeplugpassword.html")
    );
  }
  if (k == "1") {
    nodeIeee1905 = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_IEEE1905), "ieee1905cfg.html")
    );
    insDoc(
      nodeIeee1905,
      gLnk("R", getMenuTitle(MENU_IEEE1905_CONFIG), "ieee1905cfg.html")
    );
    insDoc(
      nodeIeee1905,
      gLnk("R", getMenuTitle(MENU_IEEE1905_STATUS), "ieee1905sts.cmd")
    );
    if (aY == "1") {
      insDoc(
        nodeIeee1905,
        gLnk("R", getMenuTitle(MENU_IEEE1905_TOPOLOGY), "networkTopology.html")
      );
    }
  }
  if (m == "1" && N == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_DPI), "dpicharts.html"));
  }
  if (au == "1") {
    insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_OPENVS), "openvswitchcfg.html")
    );
  }
  nodeDiagnostics = insFld(
    foldersTree,
    gFld(getMenuTitle(MENU_DIAGNOSTICS), "diag.html")
  );
  insDoc(
    nodeDiagnostics,
    gLnk("R", getMenuTitle(MENU_DIAGNOSTICS), "diag.html")
  );
  if (ae == "1") {
    insDoc(
      nodeDiagnostics,
      gLnk("R", getMenuTitle(MENU_DIAGETHOAM), "diagethoam.html")
    );
  }
  if (Y == "1") {
    insDoc(
      nodeDiagnostics,
      gLnk("R", getMenuTitle(MENU_SPDSVC), "speedsvc.html")
    );
  }
  if (G == "1") {
    insDoc(nodeDiagnostics, gFld(getMenuTitle(MENU_SNIFFER), "sniffer.html"));
  }
  if (W == "1") {
    insDoc(
      nodeDiagnostics,
      gFld(getMenuTitle(MENU_DIAGNOSTICS_PING), "ping.html")
    );
    insDoc(
      nodeDiagnostics,
      gFld(getMenuTitle(MENU_DIAGNOSTICS_TRACEROUTE), "traceroute.html")
    );
  }
  nodeMngr = insFld(
    foldersTree,
    gFld(getMenuTitle(MENU_MANAGEMENT), "backupsettings.html")
  );
  nodeSettings = insFld(
    nodeMngr,
    gFld(getMenuTitle(MENU_TL_SETTINGS), "backupsettings.html")
  );
  insDoc(
    nodeSettings,
    gLnk("R", getMenuTitle(MENU_TL_SETTINGS_BACKUP), "backupsettings.html")
  );
  insDoc(
    nodeSettings,
    gLnk("R", getMenuTitle(MENU_TL_SETTINGS_UPDATE), "updatesettings.html")
  );
  insDoc(
    nodeSettings,
    gLnk("R", getMenuTitle(MENU_TL_SETTINGS_DEFAULT), "defaultsettings.html")
  );
  if (T == "1") {
    insDoc(
      nodeSettings,
      gLnk("R", getMenuTitle(MENU_TL_SETTINGS_PMD), "pmdsettings.cmd")
    );
  }
  insFld(nodeMngr, gFld(getMenuTitle(MENU_TL_SYSTEM_LOG), "logintro.html"));
  if (g == "1") {
    insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_TL_WAN_SENSING), "wansensing.html")
    );
  }
  if (Z) {
    insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_TL_SECURITY_LOG), "seclogintro.html")
    );
  }
  if (H == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_TL_SNMP), "snmpconfig.html"));
  }
  if (ar == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_TR69C), "tr69cfg.html"));
  }
  if (aG == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_STUN), "stuncfg.html"));
  }
  if (aX == "1") {
    insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_XMPP_CONN), "xmppconncfg.cmd?action=view")
    );
  }
  if (aO == "1") {
    nodeOmci = insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_OMCI_CFG), "omcicfg.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_GET_SET), "omcicfg.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_CREATE), "omcicreate.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_GET_NEXT), "omcigetnext.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_MACRO), "omcimacro.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_DOWNLOAD), "omcidownload.html")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_SYSTEM), "omcisystem.html")
    );
  }
  if (
    aa == "1" &&
    a2 != "Bridge" &&
    !(a2 == "PPPoE" && aS == "1") &&
    !(a2 == "PPPoA" && aS == "1")
  ) {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_NTPD), "ntpdcfg.html"));
  }
  if (
    o == "1" &&
    a2 != "Bridge" &&
    !(a2 == "PPPoE" && aS == "1") &&
    !(a2 == "PPPoA" && aS == "1")
  ) {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_SNTP), "sntpcfg.html"));
  }
  if (V == "1" && S == "1" && aJ == "1") {
    if (aJ == "1") {
      nodeModSw = insFld(
        nodeMngr,
        gFld(getMenuTitle(MENU_MODSW), "modSwEE.cmd")
      );
      insDoc(nodeModSw, gLnk("R", getMenuTitle(MENU_MODSW_EE), "modSwEE.cmd"));
      insDoc(nodeModSw, gLnk("R", getMenuTitle(MENU_MODSW_DU), "modSwDU.cmd"));
      insDoc(nodeModSw, gLnk("R", getMenuTitle(MENU_MODSW_EU), "modSwEU.cmd"));
    }
  }
  nodeAccCntr = insFld(
    nodeMngr,
    gFld(getMenuTitle(MENU_ACC_CNTR), "password.html")
  );
  insDoc(
    nodeAccCntr,
    gLnk("R", getMenuTitle(MENU_ACC_CNTR_PASSWORD), "password.html")
  );
  if (parseInt(F) > 59) {
    insDoc(
      nodeAccCntr,
      gLnk("R", getMenuTitle(MENU_ACC_CNTR_TIMEOUT), "timeoutsetting.html")
    );
  }
  if (aw == "1") {
    if (e == "1") {
      insDoc(
        nodeAccCntr,
        gLnk("R", getMenuTitle(MENU_ACC_SRVCNTR_IP_LIST), "scacccntr.html")
      );
    }
    insDoc(
      nodeAccCntr,
      gLnk("R", getMenuTitle(MENU_ACC_CNTR_SRVCNTR), "scsrvcnt.html")
    );
  } else {
    if (aq == "1") {
      insDoc(
        nodeAccCntr,
        gLnk("R", getMenuTitle(MENU_NET_SERVICE), "netservice.html")
      );
    }
  }
  if (u == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_LEDCTRL), "ledcntr.html"));
  }
  insFld(nodeMngr, gFld(getMenuTitle(MENU_TL_UPDATE_SOFTWARE), "upload.html"));
  if (I == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_TL_WAN_SELECT), "wan_select.html"));
  }
  insFld(nodeMngr, gFld(getMenuTitle(MENU_RESET_ROUTER), "resetrouter.html"));
}
function menuSupport(G) {
  var ab = G.MENU_OPTION_STANDARD;
  var r = G.MENU_OPTION_PROTOCOL;
  var al = G.MENU_OPTION_IP_EXTENSION;
  var S = G.MENU_OPTION_WIRELESS;
  var X = G.MENU_OPTION_VOICE;
  var V = G.MENU_OPTION_SNMP;
  var v = G.MENU_OPTION_DDNSD;
  var h = G.MENU_OPTION_NTPD;
  var g = 0;
  var t = G.MENU_OPTION_RIP;
  var j = G.MENU_OPTION_TR69C;
  var q = G.MENU_OPTION_IPV6_SUPPORT;
  var M = G.MENU_OPTION_IPV6_ENABLE;
  var aq = G.MENU_OPTION_UPNP;
  var s = G.MENU_OPTION_DNSPROXY;
  var J = G.MENU_OPTION_OMCI;
  var ac = G.MENU_OPTION_WIRELESS_NUM_ADAPTOR;
  var Y = G.MENU_OPTION_WIRELESS_SES;
  var F = G.MENU_OPTION_ETHWAN;
  var a = G.MENU_OPTION_PTMWAN;
  var i = G.MENU_OPTION_EPTAPP;
  var R = G.MENU_OPTION_PWRMNGT;
  var ap = G.MENU_OPTION_STANDBY;
  var ar = G.MENU_OPTION_VOICE_NTR;
  var aa = G.MENU_OPTION_ATMWAN;
  var T = G.MENU_OPTION_MOCAWAN;
  var p = G.MENU_OPTION_GPONWAN;
  var n = G.MENU_OPTION_EPONWAN;
  var af = G.MENU_OPTION_VOICE_DECT;
  var L = G.MENU_OPTION_DSL_BONDING;
  var P = 0;
  var ag = G.MENU_OPTION_STORAGESERVICE;
  var x = G.MENU_OPTION_SAMBA;
  var k = G.MENU_OPTION_SUPPORT_MOCA;
  var o = G.MENU_OPTION_WIRELESS_WAPI_AS;
  var Q = G.MENU_OPTION_POLICE_ENABLE;
  var ai = G.MENU_OPTION_BMU;
  var ao = 0;
  var ah = G.MENU_OPTION_MODSW_WEBUI;
  var W = G.MENU_OPTION_MODSW_WEBUI_SUPPORT;
  var A = G.MENU_OPTION_MODSW_BASELINE;
  var O = G.MENU_OPTION_BUILD_VDSL;
  var e = G.MENU_OPTION_SUPPORT_LAN_VLAN;
  var f = G.MENU_OPTION_WIFIWAN;
  var B = G.MENU_OPTION_SUPPORT_ETHPORTSHAPING;
  var an = 0;
  var ae = G.MENU_OPTION_JQPLOT;
  var d = G.MENU_OPTION_WEB_SOCKETS;
  var D = G.MENU_OPTION_SUPPORT_WLVISUALIZATION;
  var ak = G.MENU_OPTION_VOICE_SIP_CCTK;
  var u = G.MENU_OPTION_SUPPORT_WLPASSPOINT;
  var U = G.MENU_OPTION_SUPPORT_WLROUTER_PAGE;
  var Z = G.MENU_OPTION_DPI;
  var z = G.MENU_OPTION_STUN;
  var w = G.MENU_OPTION_DEMO_ITEM;
  var N = G.MENU_OPTION_DBUS_REMOTE;
  var K = 0;
  var aj = G.MENU_OPTION_VOICE_SIPMODE;
  var ad = G.MENU_OPTION_AIRIQ_ENABLE;
  var C = G.MENU_OPTION_PMD;
  var I = G.MENU_OPTION_ETH_LAG;
  var E = G.MENU_OPTION_SUPPORT_WLIQOS;
  var c = G.MENU_OPTION_LED_RESTORE_CNTR;
  var l = 0;
  var y = G.MENU_OPTION_SNTP;
  var m = 0;
  var H = G.MENU_OPTION_WANBACKUP;
  var b =
    a == "1" ||
    aa == "1" ||
    T == "1" ||
    F == "1" ||
    f == "1" ||
    p == "1" ||
    n == "1";
  var am = G.MENU_OPTION_SUPPORT_WirelessSeparation;
  if (aa == "1") {
    ao = 1;
    nodeAdvancedSetup = insFld(
      foldersTree,
      gFld(getMenuTitle(MENU_ADVANCED_SETUP), "dslatm.html")
    );
    nodeLayer2Inteface = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "dslatm.html")
    );
    insDoc(
      nodeLayer2Inteface,
      gLnk("R", getMenuTitle(MENU_DSL_ATM_INTERFACE), "dslatm.html")
    );
  }
  if (a == "1") {
    ao = 1;
    if (aa != "1") {
      nodeAdvancedSetup = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_ADVANCED_SETUP), "dslptm.html")
      );
      nodeLayer2Inteface = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "dslptm.html")
      );
    }
    insDoc(
      nodeLayer2Inteface,
      gLnk("R", getMenuTitle(MENU_DSL_PTM_INTERFACE), "dslptm.html")
    );
  }
  if (p == "1") {
    if (!(aa == "1" || a == "1")) {
      nodeAdvancedSetup = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_ADVANCED_SETUP), "gponwan.cmd")
      );
      nodeLayer2Inteface = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "gponwan.cmd")
      );
    }
    insDoc(
      nodeLayer2Inteface,
      gLnk("R", getMenuTitle(MENU_GPONWAN_INTERFACE), "gponwan.cmd")
    );
  }
  if (n == "1") {
    if (!(aa == "1" || a == "1") || p == "1") {
      nodeAdvancedSetup = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_ADVANCED_SETUP), "eponwan.cmd")
      );
      nodeLayer2Inteface = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "eponwan.cmd")
      );
    }
    insDoc(
      nodeLayer2Inteface,
      gLnk("R", getMenuTitle(MENU_EPONWAN_INTERFACE), "eponwan.cmd")
    );
  }
  if (F == "1") {
    if (!(aa == "1" || a == "1" || p == "1" || n == "1")) {
      nodeAdvancedSetup = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_ADVANCED_SETUP), "ethwan.html")
      );
      nodeLayer2Inteface = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "ethwan.html")
      );
    }
    insDoc(
      nodeLayer2Inteface,
      gLnk("R", getMenuTitle(MENU_ETH_INTERFACE), "ethwan.html")
    );
  }
  if (f == "1") {
    if (!(aa == "1" || a == "1" || p == "1" || n == "1" || F == "1")) {
      nodeAdvancedSetup = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_ADVANCED_SETUP), "wifiwan.cmd")
      );
      nodeLayer2Inteface = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "wifiwan.cmd")
      );
    }
    insDoc(
      nodeLayer2Inteface,
      gLnk("R", getMenuTitle(MENU_WIFI_INTERFACE), "wifiwan.cmd")
    );
  }
  if (T == "1") {
    if (!(aa == "1" || a == "1" || F == "1")) {
      nodeAdvancedSetup = insFld(
        foldersTree,
        gFld(getMenuTitle(MENU_ADVANCED_SETUP), "mocawan.cmd")
      );
      nodeLayer2Inteface = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_LAYER2_INTERFACE), "mocawan.cmd")
      );
    }
    insDoc(
      nodeLayer2Inteface,
      gLnk("R", getMenuTitle(MENU_MOCA_INTERFACE), "mocawan.cmd")
    );
  }
  if (b) {
    insDoc(nodeAdvancedSetup, gLnk("R", getMenuTitle(MENU_WAN), "wancfg.html"));
  } else {
    nodeAdvancedSetup = insFld(
      foldersTree,
      gFld(getMenuTitle(MENU_ADVANCED_SETUP), "lancfg2.html")
    );
  }
  if (I == "1") {
    nodEthLag = insDoc(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_ETH_LAG), "ethLagCfg.cmd")
    );
  }
  nodeLAN = insFld(
    nodeAdvancedSetup,
    gFld(getMenuTitle(MENU_LAN), "lancfg2.html")
  );
  insDoc(nodeLAN, gLnk("R", getMenuTitle(MENU_LAN4), "lancfg2.html"));
  if (M == "1") {
    insDoc(nodeLAN, gLnk("R", getMenuTitle(MENU_LAN6), "ipv6lancfg.html"));
  }
  if (e == "1") {
    insFld(nodeLAN, gFld(getMenuTitle(MENU_LAN_VLAN), "lanvlancfg.html"));
  }
  if (l == "1") {
    insDoc(
      nodeLAN,
      gLnk("R", getMenuTitle(MENU_ETH_SPEED), "ethspeedcfg.html")
    );
  }
  if (P == "1") {
    nodeVPN = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_VPN), "l2tpacwan.cmd")
    );
    insDoc(nodeVPN, gLnk("R", getMenuTitle(MENU_VPN_L2TPAC), "l2tpacwan.cmd"));
    insDoc(nodeVPN, gLnk("R", getMenuTitle(MENU_VPN_PPTPAC), "pptpacwan.cmd"));
    if (m == "1") {
      insDoc(
        nodeVPN,
        gLnk("R", getMenuTitle(MENU_OPENVPN), "openvpnview.html")
      );
    }
  } else {
    if (m == "1") {
      nodeVPN = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_VPN), "openvpnview.html")
      );
      insDoc(
        nodeVPN,
        gLnk("R", getMenuTitle(MENU_OPENVPN), "openvpnview.html")
      );
    }
  }
  if (k == "1") {
    insDoc(
      nodeAdvancedSetup,
      gLnk("R", getMenuTitle(MENU_MOCA_CONFIGURATION), "mocacfg.html")
    );
  }
  if (b) {
    nodeQos = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_QOS), "qosqmgmt.html")
    );
    nodeQosQueue = insFld(
      nodeQos,
      gFld(getMenuTitle(MENU_QOS_QUEUE), "qosqueue_view.html")
    );
    insDoc(
      nodeQosQueue,
      gLnk("R", getMenuTitle(MENU_QUEUE_CFG), "qosqueue_view.html")
    );
    if (parseInt(ac) != 0) {
      insDoc(
        nodeQosQueue,
        gLnk("R", getMenuTitle(MENU_WL_QUEUE), "qosqueue_view_wlq.html")
      );
    }
    if (Q == "1") {
      insDoc(
        nodeQos,
        gLnk("R", getMenuTitle(MENU_QOS_POLICER), "qospolicer.cmd?action=view")
      );
    }
    insDoc(
      nodeQos,
      gLnk("R", getMenuTitle(MENU_QOS_CLASS), "qoscls_view.html")
    );
    if (B == "1") {
      insDoc(
        nodeQos,
        gLnk("R", getMenuTitle(MENU_QOS_PORT_SHAPING), "qosportshaping.html")
      );
    }
    nodeRouting = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_ROUTING), "rtdefaultcfg.html")
    );
    insDoc(
      nodeRouting,
      gLnk("R", getMenuTitle(MENU_RT_DEFAULT_ROUTE), "rtdefaultcfg.html")
    );
    insDoc(
      nodeRouting,
      gLnk("R", getMenuTitle(MENU_RT_STATIC_ROUTE), "rtroutecfg_viewcfg.html")
    );
    if (
      (r == "PPPoE" && al == "0") ||
      (r == "PPPoA" && al == "0") ||
      r == "MER" ||
      r == "IPoA"
    ) {
      if (t == "1") {
        insDoc(
          nodeRouting,
          gLnk("R", getMenuTitle(MENU_RT_RIP), "ripcfg_view.html")
        );
      }
      nodeDnsSetup = insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_DNS), "dnscfg.html")
      );
      insDoc(
        nodeDnsSetup,
        gLnk("R", getMenuTitle(MENU_DNS_SETUP), "dnscfg.html")
      );
      if (v == "1") {
        insDoc(
          nodeDnsSetup,
          gLnk("R", getMenuTitle(MENU_DDNS), "ddnsmngr.html")
        );
      }
    }
  }
  if (ao == 1) {
    if (ab == "annex_c") {
      insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_DSL), "adslcfgc.html"));
    } else {
      if (O == "1") {
        insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_DSL), "xdslcfg.html"));
      } else {
        insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_DSL), "adslcfg.html"));
      }
    }
    if (L == "1") {
      insFld(
        nodeAdvancedSetup,
        gFld(getMenuTitle(MENU_DSL_BONDING), "dslbondingcfg.html")
      );
    }
  }
  if (g == "1") {
    insDoc(nodeAdvancedSetup, gFld(getMenuTitle(MENU_IPP), "ippcfg.html"));
  }
  if (aq == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_UPNP), "upnpcfg.html"));
  }
  if (s == "1") {
    insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_DNSPROXY), "dnsproxycfg.html")
    );
  }
  if (ap == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_STANDBY), "standby.html"));
  }
  if (R == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_PWRMNGT), "pwrmngt.html"));
  }
  if (ai == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_BMU), "bmu.html"));
  }
  if (parseInt(ac) != 0) {
    if (U == "y" || U == "1") {
      if (am == "0") {
        wl_wr_node = insFld(
          foldersTree,
          gFld("Wireless", "wlrouter/ssid_5.html")
        );
        insDoc(
          wl_wr_node,
          gLnk("R", getMenuTitle(MENU_WL_MENU_RADIO), "wlrouter/radio_5.html")
        );
        insDoc(
          wl_wr_node,
          gLnk("R", getMenuTitle(MENU_WL_MENU_MEDIA), "wlrouter/media.html")
        );
        insDoc(
          wl_wr_node,
          gLnk("R", getMenuTitle(MENU_WL_MENU_SSID), "wlrouter/ssid.html")
        );
        insDoc(
          wl_wr_node,
          gLnk(
            "R",
            getMenuTitle(MENU_WL_MENU_SECURITY),
            "wlrouter/security_5.html"
          )
        );
        insDoc(
          wl_wr_node,
          gLnk("R", getMenuTitle(MENU_WL_MENU_WPS), "wlrouter/wps_5.html")
        );
      } else {
        wl_wr_node = insFld(foldersTree, gFld("Wi-Fi", "wlrouter/ssid.html"));
        wl_24_node = insFld(wl_wr_node, gFld("2.4GHz", "wlrouter/ssid.html"));
        insDoc(
          wl_24_node,
          gLnk("R", getMenuTitle(MENU_WL_MENU_SSID), "wlrouter/ssid.html")
        );
        insDoc(
          wl_24_node,
          gLnk(
            "R",
            getMenuTitle(MENU_WL_MENU_SECURITY),
            "wlrouter/security.html"
          )
        );
        insDoc(
          wl_24_node,
          gLnk("R", getMenuTitle(MENU_WL_MENU_WPS), "wlrouter/wps.html")
        );
        insDoc(wl_24_node, gLnk("R", "MacFilter", "wlrouter/macfilter.html"));
        insDoc(wl_24_node, gLnk("R", "Advanced", "wlrouter/radio.html"));
        wl_5_node = insFld(wl_wr_node, gFld("5GHz ", "wlrouter/ssid_5.html"));
        insDoc(
          wl_5_node,
          gLnk("R", getMenuTitle(MENU_WL_MENU_SSID), "wlrouter/ssid_5.html")
        );
        insDoc(
          wl_5_node,
          gLnk(
            "R",
            getMenuTitle(MENU_WL_MENU_SECURITY),
            "wlrouter/security_5.html"
          )
        );
        insDoc(
          wl_5_node,
          gLnk("R", getMenuTitle(MENU_WL_MENU_WPS), "wlrouter/wps_5.html")
        );
        insDoc(wl_5_node, gLnk("R", "MacFilter", "wlrouter/macfilter_5.html"));
        insDoc(wl_5_node, gLnk("R", "Advanced", "wlrouter/radio_5.html"));
      }
      if (u == "1") {
        insDoc(
          wl_wr_node,
          gLnk("R", getMenuTitle(MENU_WL_PASSPOINT), "wlrouter/passpoint.html")
        );
      }
      if (D == "1") {
        wlVisualNode = insFld(
          wl_wr_node,
          gFld(getMenuTitle(MENU_WL_VISUALIZATION), "wlrouter/configure.html")
        );
        insDoc(
          wlVisualNode,
          gLnk(
            "R",
            getMenuTitle(MENU_WL_VISUALIZATION_SITESURVEY),
            "wlrouter/visindex.html"
          )
        );
        insDoc(
          wlVisualNode,
          gLnk(
            "R",
            getMenuTitle(MENU_WL_VISUALIZATION_CHANNELSTAT),
            "wlrouter/channelcapacity.html"
          )
        );
        insDoc(
          wlVisualNode,
          gLnk(
            "R",
            getMenuTitle(MENU_WL_VISUALIZATION_METRICS),
            "wlrouter/metrics.html"
          )
        );
        insDoc(
          wlVisualNode,
          gLnk(
            "R",
            getMenuTitle(MENU_WL_VISUALIZATION_CONFIGURE),
            "wlrouter/configure.html"
          )
        );
      }
      if (G.MENU_OPTION_APLIST == "1") {
        insDoc(wl_wr_node, gLnk("R", "Wi-Fi Analyser", "sitesurvey.html"));
      }
      if (w == "1" || w == "y") {
        insDoc(
          wlVisualNode,
          gLnk(
            "R",
            getMenuTitle(MENU_WL_MENU_DEMO_ON_DFS),
            "wlrouter/zerowaitdfs.html"
          )
        );
        insDoc(
          wlVisualNode,
          gLnk(
            "R",
            getMenuTitle(MENU_WL_MENU_DEMO_ON_WBD),
            "wlrouter/wbd_demo.html"
          )
        );
      }
      if (ad == "1" || ad == "y") {
        insDoc(
          wl_wr_node,
          gLnk("R", getMenuTitle(MENU_WL_AIRIQ_ENABLE), "wlrouter/airiq.html")
        );
      }
      if (E == "1") {
        insDoc(
          wl_wr_node,
          gLnk(
            "R",
            getMenuTitle(MENU_WL_IQOS),
            "wlrouter/iQoSNetworkSummary.html"
          )
        );
      }
    }
  }
  if (ag == "1") {
    nodeStorage = insFld(
      nodeAdvancedSetup,
      gFld(getMenuTitle(MENU_STORAGESERVICE), "storageservicecfg_view.html")
    );
    insDoc(
      nodeStorage,
      gLnk("R", getMenuTitle(MENU_STORAGE_INFO), "storageservicecfg_view.html")
    );
    if (x == "1") {
      insDoc(
        nodeStorage,
        gLnk(
          "R",
          getMenuTitle(MENU_STORAGE_USERACCOUNT),
          "storageuseraccountcfg_view.html"
        )
      );
    }
  }
  if (Z == "1" && d == "1") {
    insFld(nodeAdvancedSetup, gFld(getMenuTitle(MENU_DPI), "dpicharts.html"));
  }
  nodeDiagnostics = insFld(
    foldersTree,
    gFld(getMenuTitle(MENU_DIAGNOSTICS), "diag.html")
  );
  nodeMngr = insFld(
    foldersTree,
    gFld(getMenuTitle(MENU_MANAGEMENT), "backupsettings.html")
  );
  nodeSettings = insFld(
    nodeMngr,
    gFld(getMenuTitle(MENU_TL_SETTINGS), "backupsettings.html")
  );
  insDoc(
    nodeSettings,
    gLnk("R", getMenuTitle(MENU_TL_SETTINGS_BACKUP), "backupsettings.html")
  );
  insDoc(
    nodeSettings,
    gLnk("R", getMenuTitle(MENU_TL_SETTINGS_UPDATE), "updatesettings.html")
  );
  insDoc(
    nodeSettings,
    gLnk("R", getMenuTitle(MENU_TL_SETTINGS_DEFAULT), "defaultsettings.html")
  );
  if (C == "1") {
    insDoc(
      nodeSettings,
      gLnk("R", getMenuTitle(MENU_TL_SETTINGS_PMD), "pmdsettings.cmd")
    );
  }
  insFld(nodeMngr, gFld(getMenuTitle(MENU_TL_SYSTEM_LOG), "logintro.html"));
  if (H == "1") {
    insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_TL_WAN_SENSING), "wansensing.html")
    );
  }
  if (b) {
    insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_TL_SECURITY_LOG), "seclogintro.html")
    );
  }
  if (V == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_TL_SNMP), "snmpconfig.html"));
  }
  if (j == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_TR69C), "tr69cfg.html"));
  }
  if (z == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_STUN), "stuncfg.html"));
  }
  if (an == "1") {
    insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_XMPP_CONN), "xmppconncfg.cmd?action=view")
    );
  }
  if (X == "MGCP") {
    nodeVoice = insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_VOICE_SETTINGS), "voicemgcp_basic.html")
    );
    insDoc(
      nodeVoice,
      gLnk("R", getMenuTitle(MENU_VOICE_MGCP), "voicemgcp_basic.html")
    );
    if (ar != "2") {
      insDoc(
        nodeVoice,
        gLnk("R", getMenuTitle(MENU_VOICE_NTR), "voicentr.html")
      );
    }
  } else {
    if (X == "H.248") {
      nodeVoice = insFld(
        nodeMngr,
        gFld(getMenuTitle(MENU_VOICE_SETTINGS), "voiceh248_status.html")
      );
      insDoc(
        nodeVoice,
        gLnk("R", getMenuTitle(MENU_VOICE_H248_STATUS), "voiceh248_status.html")
      );
      insDoc(
        nodeVoice,
        gLnk("R", getMenuTitle(MENU_VOICE_H248_BASIC), "voiceh248_basic.html")
      );
      insDoc(
        nodeVoice,
        gLnk(
          "R",
          getMenuTitle(MENU_VOICE_H248_ADVANCED),
          "voiceh248_advanced.html"
        )
      );
    } else {
      if (X == "SIP") {
        nodeVoice = insFld(
          nodeMngr,
          gFld(getMenuTitle(MENU_VOICE_SETTINGS), "voicesip_status.html")
        );
        insDoc(
          nodeVoice,
          gLnk("R", getMenuTitle(MENU_VOICE_SIP_STATUS), "voicesip_status.html")
        );
        insDoc(
          nodeVoice,
          gLnk("R", getMenuTitle(MENU_VOICE_SIP_BASIC), "voicesip_basic.html")
        );
        insDoc(
          nodeVoice,
          gLnk(
            "R",
            getMenuTitle(MENU_VOICE_SIP_ADVANCED),
            "voicesip_advanced.html"
          )
        );
        insDoc(
          nodeVoice,
          gLnk("R", getMenuTitle(MENU_VOICE_SIP_EXTRA), "voicesip_extra.html")
        );
        insDoc(
          nodeVoice,
          gLnk(
            "R",
            getMenuTitle(MENU_VOICE_SIP_ERRINFO),
            "voicesip_errinfo.html"
          )
        );
        insDoc(
          nodeVoice,
          gLnk("R", getMenuTitle(MENU_VOICE_SIP_DEBUG), "voicesip_debug.html")
        );
        if (ak == "1") {
          insDoc(
            nodeVoice,
            gLnk("R", getMenuTitle(MENU_VOICE_SIP_CCTK), "voicesip_cctk.html")
          );
        }
        if (ar != "2") {
          insDoc(
            nodeVoice,
            gLnk("R", getMenuTitle(MENU_VOICE_NTR), "voicentr.html")
          );
        }
        if (af == "1") {
          insDoc(
            nodeVoice,
            gLnk("R", getMenuTitle(MENU_VOICE_DECT), "voicedect.html")
          );
        }
      }
    }
  }
  if (J == "1") {
    nodeOmci = insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_OMCI_CFG), "omcicfg.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_GET_SET), "omcicfg.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_CREATE), "omcicreate.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_GET_NEXT), "omcigetnext.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_MACRO), "omcimacro.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_DOWNLOAD), "omcidownload.html")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_SYSTEM), "omcisystem.html")
    );
  }
  if (
    h == "1" &&
    r != "Bridge" &&
    !(r == "PPPoE" && al == "1") &&
    !(r == "PPPoA" && al == "1")
  ) {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_NTPD), "ntpdcfg.html"));
  }
  if (
    y == "1" &&
    r != "Bridge" &&
    !(r == "PPPoE" && al == "1") &&
    !(r == "PPPoA" && al == "1")
  ) {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_SNTP), "sntpcfg.html"));
  }
  if (ah == "1" && W == "1" && A == "1") {
    if (A == "1") {
      nodeModSw = insFld(
        nodeMngr,
        gFld(getMenuTitle(MENU_MODSW), "modSwEE.cmd")
      );
      insDoc(nodeModSw, gLnk("R", getMenuTitle(MENU_MODSW_EE), "modSwEE.cmd"));
      insDoc(nodeModSw, gLnk("R", getMenuTitle(MENU_MODSW_DU), "modSwDU.cmd"));
      insDoc(nodeModSw, gLnk("R", getMenuTitle(MENU_MODSW_EU), "modSwEU.cmd"));
      if (N == "1") {
        insFld(
          nodeModSw,
          gFld(getMenuTitle(MENU_MODSW_DBUS_REMOTE), "dbusremotecfg.html")
        );
      }
    }
  }
  if (c == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_LEDCTRL), "ledcntr.html"));
  }
  insFld(nodeMngr, gFld(getMenuTitle(MENU_TL_UPDATE_SOFTWARE), "upload.html"));
  insFld(nodeMngr, gFld(getMenuTitle(MENU_RESET_ROUTER), "resetrouter.html"));
}
function menuUser() {
  var a = options.MENU_OPTION_SNMP;
  var f = options.MENU_OPTION_TR69C;
  var b = options.MENU_OPTION_OMCI;
  var d = 0;
  var c = options.MENU_OPTION_STUN;
  var e = options.MENU_OPTION_WANBACKUP;
  nodeDiagnostics = insFld(
    foldersTree,
    gFld(getMenuTitle(MENU_DIAGNOSTICS), "diag.html")
  );
  nodeMngr = insFld(
    foldersTree,
    gFld(getMenuTitle(MENU_MANAGEMENT), "logintro.html")
  );
  insFld(nodeMngr, gFld(getMenuTitle(MENU_TL_SYSTEM_LOG), "logintro.html"));
  if (e == "1") {
    insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_TL_WAN_SENSING), "wansensing.html")
    );
  }
  if (a == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_TL_SNMP), "snmpconfig.html"));
  }
  if (f == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_TR69C), "tr69cfg.html"));
  }
  if (c == "1") {
    insFld(nodeMngr, gFld(getMenuTitle(MENU_STUN), "stuncfg.html"));
  }
  if (d == "1") {
    insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_XMPP_CONN), "xmppconncfg.cmd?action=view")
    );
  }
  if (b == "1") {
    nodeOmci = insFld(
      nodeMngr,
      gFld(getMenuTitle(MENU_OMCI_CFG), "omcicfg.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_GET_SET), "omcicfg.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_CREATE), "omcicreate.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_GET_NEXT), "omcigetnext.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_MACRO), "omcimacro.cmd?action=view")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_DOWNLOAD), "omcidownload.html")
    );
    insDoc(
      nodeOmci,
      gLnk("R", getMenuTitle(MENU_OMCI_SYSTEM), "omcisystem.html")
    );
  }
  insFld(nodeMngr, gFld(getMenuTitle(MENU_TL_UPDATE_SOFTWARE), "upload.html"));
}
function createBcmMenu(i) {
  var y = i.MENU_OPTION_USER;
  var s = i.MENU_OPTION_PROTOCOL;
  var b = i.MENU_OPTION_IP_EXTENSION;
  var g = i.MENU_OPTION_DHCPEN;
  var o = i.MENU_OPTION_JQPLOT;
  var n = i.MENU_OPTION_WEB_SOCKETS;
  var p = i.MENU_OPTION_MODSW_WEBUI;
  var e = i.MENU_OPTION_MODSW_WEBUI_ADMIN;
  var c = i.MENU_OPTION_MODSW_BASELINE;
  var x = i.MENU_OPTION_SUPPORT_MOCA;
  var h = i.MENU_OPTION_PTMWAN;
  var u = i.MENU_OPTION_ATMWAN;
  var f = i.MENU_OPTION_MOCAWAN;
  var v = i.MENU_OPTION_ETHWAN;
  var w = i.MENU_OPTION_GPONWAN;
  var r = i.MENU_OPTION_EPONWAN;
  var l = i.MENU_OPTION_OPTICAL;
  var t = i.MENU_OPTION_WIFIWAN;
  var m = i.MENU_OPTION_SUPPORT_CELLULAR;
  var a = i.MENU_OPTION_BUILD_USB_HOSTS;
  var k = i.MENU_OPTION_QRCODE_SAMPLE;
  var q = i.MENU_OPTION_STATS_QUEUE;
  var d = i.MENU_OPTION_BASICSETUP;
  var j =
    h == "1" ||
    u == "1" ||
    f == "1" ||
    v == "1" ||
    t == "1" ||
    w == "1" ||
    r == "1";
  foldersTree = gFld("", "info.html");
  nodeDeviceInfo = insFld(
    foldersTree,
    gFld(getMenuTitle(MENU_DEVICE_INFO), "info.html")
  );
  insFld(nodeDeviceInfo, gFld(getMenuTitle(MENU_DEVICE_SUMMARY), "info.html"));
  insFld(nodeDeviceInfo, gFld("Connected Devices", "connectedDevices.html"));
  if (j) {
    insFld(
      nodeDeviceInfo,
      gFld(getMenuTitle(MENU_DEVICE_WAN), "wancfg_view.html")
    );
  }
  nodeSts = insFld(
    nodeDeviceInfo,
    gFld(getMenuTitle(MENU_STATISTICS), "statsifc.html")
  );
  insDoc(nodeSts, gLnk("R", getMenuTitle(MENU_ST_LAN), "statsifc.html"));
  if (x == "1") {
    insDoc(
      nodeSts,
      gLnk("R", getMenuTitle(MENU_ST_MOCA), "statsmoca.cmd?choice=LAN")
    );
  }
  if (j) {
    insDoc(nodeSts, gLnk("R", getMenuTitle(MENU_WAN), "statswan.html"));
  }
  if (h == "1" || u == "1") {
    insDoc(nodeSts, gLnk("R", getMenuTitle(MENU_ST_ATM), "statsxtm.html"));
    insDoc(nodeSts, gLnk("R", getMenuTitle(MENU_ST_ADSL), "statsadsl.html"));
  }
  if (l == "1") {
    insDoc(
      nodeSts,
      gLnk("R", getMenuTitle(MENU_OPTICAL), "statsopticifc.html")
    );
  }
  if (q == "1") {
    insDoc(nodeSts, gLnk("R", getMenuTitle(MENU_ST_QUEUE), "statsqueue.html"));
  }
  if (j) {
    insFld(
      nodeDeviceInfo,
      gFld(getMenuTitle(MENU_DEVICE_ROUTE), "rtroutecfg_view.html")
    );
  }
  insFld(nodeDeviceInfo, gFld(getMenuTitle(MENU_RT_ARP), "arpview.html"));
  if (!(s == "Bridge" || b == "1") && g == "1") {
    insFld(nodeDeviceInfo, gFld(getMenuTitle(MENU_DHCPINFO), "dhcpinfo.html"));
  }
  if (o != "0" && n == "1") {
    insDoc(
      nodeDeviceInfo,
      gLnk("R", getMenuTitle(MENU_CPU_MEM_GRAPH), "cpumemcharts.html")
    );
  }
  if (a == "1") {
    insFld(
      nodeDeviceInfo,
      gFld(getMenuTitle(MENU_USB_HOSTS), "usbhosts.cmd?action=view")
    );
  }
  if ((p == "1" || e == "1") && c == "1") {
    insDoc(
      nodeDeviceInfo,
      gLnk("R", getMenuTitle(MENU_MODSW_CONTAINER), "containertable.html")
    );
  }
  if (k == "1") {
    insDoc(
      nodeDeviceInfo,
      gFld(getMenuTitle(MENU_QRCODE_SAMPLE), "qrcodesample.html")
    );
  }
  if (m == "1") {
    insDoc(
      nodeDeviceInfo,
      gLnk("R", getMenuTitle(MENU_CELLULAR_INFO), "cellularinfo.html")
    );
  }
  if (d == "1") {
    nodeBasicSetup = insFld(
      foldersTree,
      gFld(getMenuTitle(MENU_BASIC_SETUP), "nfquicksetup.html")
    );
  }
  if (y == UserNames[0]) {
    menuAdmin(i);
  } else {
    if (y == UserNames[1]) {
      menuSupport(i);
    } else {
      if (y == UserNames[2]) {
        menuUser();
      }
    }
  }
  insFld(foldersTree, gFld(getMenuTitle(MENU_LOGOUT), "logout.html"));
}
