function dataNX400out() {
    td_NX400.rowSpan = 2;
    td_NX400_NXE40.rowSpan = 1;
    td_NX400_NXE40Num.rowSpan = 1;
    if (app_dst == 'ja') {
      td_NX400_NXE41.rowSpan = 1;
      td_NX400_NXE41Num.rowSpan = 1;
    }
    td_HXE400_name.rowSpan = 2;
    td_txtHXE400_num.rowSpan = 2;
    td_HDDnumNX400.rowSpan = 2;
    td_txtHDDnumNX400.rowSpan = 2;
    td_TotalCapaNX400.rowSpan = 2;
    txtTotalCapNX400.rowSpan = 2;
    td_TotalElePowerNX400.rowSpan = 2;
    txtTotalElePowerNX400.rowSpan = 2;
    td_Total_U_NX400.rowSpan = 2;
    txtTotal_U_NX400.rowSpan = 2;

    frmNWDR.txtnx400num1.value = '-';
    frmNWDR.txtnx400num1.style.background = '#C8C8C8';
    frmNWDR.txthxe400num.value = '-';
    frmNWDR.txthxe400num.style.background = '#C8C8C8';
    frmNWDR.txtnxe40NX400.value = '-';
    frmNWDR.txtnxe40NX400.style.background = '#C8C8C8';
    if (app_dst == 'ja') {
      frmNWDR.txtnxe41NX400.value = '-';
      frmNWDR.txtnxe41NX400.style.background = '#C8C8C8';
    }
    frmNWDR.txtHddNumNX400.value = '-';
    frmNWDR.txtHddNumNX400.style.background = '#C8C8C8';
    frmNWDR.txttotalnx400cap.value = '-';
    frmNWDR.txttotalnx400cap.style.background = '#C8C8C8';
    frmNWDR.txttotalnx400ele.value = '-';
    frmNWDR.txttotalnx400ele.style.background = '#C8C8C8';
    frmNWDR.txtTotalU_NX400.value = '-';
    frmNWDR.txtTotalU_NX400.style.background = '#C8C8C8';
}

function dataNX400init() {
    td_NX400.rowSpan = 2;
    td_NX400_NXE40.rowSpan = 1;
    td_NX400_NXE40Num.rowSpan = 1;
    if (app_dst == 'ja') {
      td_NX400_NXE41.rowSpan = 1;
      td_NX400_NXE41Num.rowSpan = 1;
    }
    td_HXE400_name.rowSpan = 2;
    td_txtHXE400_num.rowSpan = 2;
    td_HDDnumNX400.rowSpan = 2;
    td_txtHDDnumNX400.rowSpan = 2;
    td_TotalCapaNX400.rowSpan = 2;
    txtTotalCapNX400.rowSpan = 2;
    td_TotalElePowerNX400.rowSpan = 2;
    txtTotalElePowerNX400.rowSpan = 2;
    td_Total_U_NX400.rowSpan = 2;
    txtTotal_U_NX400.rowSpan = 2;

    frmNWDR.txtnx400num1.value = '';
    frmNWDR.txtnx400num1.style.background = '#FFFF80';
    frmNWDR.txthxe400num.value = '';
    frmNWDR.txthxe400num.style.background = '#FFFF80';
    frmNWDR.txtnxe40NX400.value = '';
    frmNWDR.txtnxe40NX400.style.background = '#FFFF80';
    if (app_dst == 'ja') {
      frmNWDR.txtnxe41NX400.value = '';
      frmNWDR.txtnxe41NX400.style.background = '#FFFF80';
    }
    frmNWDR.txtHddNumNX400.value = '';
    frmNWDR.txtHddNumNX400.style.background = '#FFFF80';
    frmNWDR.txttotalnx400cap.value = '';
    frmNWDR.txttotalnx400cap.style.background = '#FFFF80';
    frmNWDR.txttotalnx400ele.value = '';
    frmNWDR.txttotalnx400ele.style.background = '#FFFF80';
    frmNWDR.txtTotalU_NX400.value = '';
    frmNWDR.txtTotalU_NX400.style.background = '#FFFF80';
}

function NX400_output(nNwdrCode) {
    var i; var j;
    var lngTotalHDDq = 0; var lngIndiHDDq = 0;
    var lngHXE400q = 0;
    var hddCapaTB = frmNWDR.sel_HDD.options[frmNWDR.sel_HDD.selectedIndex].value; 
    hddCapaTB = Number(hddCapaTB) / 1000;
    var nDispLic_nxe40 = 0; 
    var nDispLic_nxe41 = 0; 
    var nCamTotalNum = 0;

    for (i = 0; i < gNwdrInfo.length; i++) {
        lngHXE400q = Number(lngHXE400q) + Number(gNwdrInfo[i].extUnitNum);
    }

    for (i = 0; i < gNwdrInfo.length; i++) {
        gNwdrInfo[i].sysLicNum_nxe40 = camNum2LicNum(gNwdrInfo[i].nCamTotalNum + gNwdrInfo[i].n360MicNum, NXE40);
        if (app_dst == 'ja') {
            gNwdrInfo[i].sysLicNum_nxe41 = camNum2LicNum(gNwdrInfo[i].nCamTotalNum + gNwdrInfo[i].n360MicNum, NXE41);
        }

        if (app_dst == 'ja') {
            if (Number(gNwdrInfo[i].sysLicNum_nxe40) == 1) {
                nDispLic_nxe40 += 1;
            } else {
            }
            nDispLic_nxe41 += Number(gNwdrInfo[i].sysLicNum_nxe41); 
        } else {
            nDispLic_nxe40 += Number(gNwdrInfo[i].sysLicNum_nxe40);
        }
    }

    for (i = 0; i < gNwdrInfo.length; i++) {

        if (Number(gNwdrInfo[i].extUnitNum) == 0) {
            lngIndiHDDq =
                Math.ceil(
                    (Number(gNwdrInfo[i].lngLastHDDCapa) / Number(hddCapaTB))
                );

            var lngIndiHDDq = AdjHddAtRaidNX400(lngIndiHDDq, i);

            var nTLnum;
            switch (gSelRaidMode) {
                case 1:
                    nTLnum = Number(lngIndiHDDq / 2);
                    break;
                case 5:
                case 6:
                    nTLnum = 1; 
                    break;
                default: 
                    nTLnum = Number(lngIndiHDDq); 
                    if (app_dst == 'ja') { 
                        nTLnum += Number(gNwdrInfo[i].mainHddNum); 
                    }
                    break;
            }
            gNwdrInfo[i].lngLastHDDCapa += (defNXtimelineTB * nTLnum);

            lngIndiHDDq =
                Math.ceil(
                    (Number(gNwdrInfo[i].lngLastHDDCapa) / Number(hddCapaTB))
                );

            var lngIndiHDDq = AdjHddAtRaidNX400(lngIndiHDDq, i);

        }
        else {
            for (var j = 0; j < Number(gNwdrInfo[i].extUnitNum); j++) {
                if (Number(gNwdrInfo[i].extUnitNum) - j == 1) {
                    var w_lngIndiHDDq = 
                            Math.ceil(
                                (Number(gNwdrInfo[i].lngLastHDDCapa) / Number(hddCapaTB))
                            );

                    var nTLnum;
                    switch (gSelRaidMode) {
                        case 1:
                            nTLnum = Number(w_lngIndiHDDq / 2);
                            break;
                        case 5:
                        case 6:
                            nTLnum = 1; 
                            break;
                        default: 
                            nTLnum = Number(w_lngIndiHDDq); 
                            if (app_dst == 'ja') { 
                                nTLnum += Number(gNwdrInfo[i].mainHddNum); 
                            }
                            break;
                    }
                    gNwdrInfo[i].lngLastHDDCapa += (defNXtimelineTB * nTLnum);

                    lngIndiHDDq =
                        Number(lngIndiHDDq) +
                        Number(
                            Math.ceil(
                                (Number(gNwdrInfo[i].lngLastHDDCapa) / Number(hddCapaTB))
                            )
                        );

                    if (gSelRaidMode == 1) {
                        lngIndiHDDq = Number(lngIndiHDDq) + (Number(defMaxHddNum_Main_RAID1[nNwdrCode] / 2));
                    } else {
                        lngIndiHDDq = Number(lngIndiHDDq) + Number(defMaxHddNum_Main_RAID0[nNwdrCode]);
                    }

                    var lngIndiHDDq = AdjHddAtRaidNX400(lngIndiHDDq, i);

                }
                else {
                    if (gSelRaidMode == 1) {
                        lngIndiHDDq = Number(lngIndiHDDq) + (Number(defMaxHddNum_Main_RAID1[nNwdrCode] / 2));
                    } else {
                        lngIndiHDDq = Number(lngIndiHDDq) + Number(defMaxHddNum_Main_RAID0[nNwdrCode]);
                    }
                }
            }
        }
        lngTotalHDDq = lngTotalHDDq + lngIndiHDDq;
        gNwdrInfo[i].intHDDq = lngIndiHDDq;
        lngIndiHDDq = 0;

    }

    var data = Number(frmNWDR.txttotalcap.value);
    data = Number(data) / Number(defRecCoef[nNwdrCode]);

    for (i = 0; i < gNwdrInfo.length; i++) {
        var nTLnum;
        switch (gSelRaidMode) {
            case 1:
                nTLnum = Number(gNwdrInfo[i].intHDDq / 2);
                break;
            case 5:
            case 6:
                nTLnum = Number(gNwdrInfo[i].extUnitNum) + 1; 
                break;
            default: 
                nTLnum = Number(gNwdrInfo[i].intHDDq); 
                if (app_dst == 'ja') { 
                    nTLnum += Number(gNwdrInfo[i].mainHddNum); 
                }
                break;
        }
        data += (defNXtimelineTB * nTLnum);
    }

    data = GetMarumCapa(data);

    dataNX400init();

    if (gRecDay > 0) { 
        frmNWDR.txtnx400num1.value = gNwdrInfo.length;
        frmNWDR.txtnxe40NX400.value = nDispLic_nxe40; 
        if (app_dst == 'ja') {
          frmNWDR.txtnxe41NX400.value = nDispLic_nxe41; 
        }
        frmNWDR.txthxe400num.value = lngHXE400q;
        frmNWDR.txtHddNumNX400.value = lngTotalHDDq;
        frmNWDR.txttotalnx400cap.value = data;
        frmNWDR.txttotalnx400cap.value = Number(frmNWDR.txttotalnx400cap.value).toLocaleString();
        frmNWDR.txttotalnx400ele.value =
            (Number(gNwdrInfo.length) * Number(defMainUnitPow[nNwdrCode])) +
            (lngHXE400q * Number(defExtUnitPow[nNwdrCode]));
        var unitnum =
            String((gNwdrInfo.length + lngHXE400q) * (defSizeAtUnit[nNwdrCode]));
        frmNWDR.txtTotalU_NX400.value = unitnum + s_td_U;
    }
    else { 
        gNwdrInfo.length = 0;
        frmNWDR.txtnx400num1.value = 0;
        frmNWDR.txtnxe40NX400.value = 0; 
        if (app_dst == 'ja') {
          frmNWDR.txtnxe41NX400.value = 0; 
        }
        frmNWDR.txthxe400num.value = 0;
        frmNWDR.txtHddNumNX400.value = 0;
        frmNWDR.txttotalnx400cap.value = NaN;
        frmNWDR.txttotalnx400ele.value = 0;
        frmNWDR.txtTotalU_NX400.value = 0 + s_td_U;
    }
}

function AdjHddAtRaidNX400(lngIndiHDDq, i) {
    var raid = frmNWDR.sel_RAID.options[frmNWDR.sel_RAID.selectedIndex].value;
    var l_hddq = lngIndiHDDq;

    raid = Number(raid);

    if (raid == 1) {
        l_hddq = l_hddq * 2;
    }

    if (raid == 5) {
        if (lngIndiHDDq == 1) { 
            if (Number(gNwdrInfo[i].extUnitNum) == 0) {
                l_hddq = Number(l_hddq) + 2;
            }
            else {
                l_hddq = Number(l_hddq) + 1;
            }
        }
        else { 
            l_hddq = Number(l_hddq) + 1;
        }
    }
    else if (raid == 6) {
        if (lngIndiHDDq == 1) { 
            if (Number(gNwdrInfo[i].extUnitNum) == 0) {
                l_hddq = Number(l_hddq) + 3;
            }
            else {
                l_hddq = Number(l_hddq) + 2;
            }
        }
        else { 
            l_hddq = Number(l_hddq) + 2;
        }
    }

    return l_hddq;
}

