var nNwdrNX400 = 0;

var H265_1 = 0;
var H265_2 = 1;
var H265_3 = 2;
var H265_4 = 3;
var H264_1 = 4;
var H264_2 = 5;
var H264_3 = 6;
var H264_4 = 7;
var JPEG_1 = 8;
var JPEG_2 = 9;
var JPEG_3 = 10;
var JPEG_4 = 11;
var H265VBR_1 = 12;
var H265VBR_2 = 13;
var H265VBR_3 = 14;
var H264VBR_1 = 15;
var H264VBR_2 = 16;
var H264VBR_3 = 17;
var H264FM = 18;

var CAM_RECTB = 0;
var CAM_CALCBR = 1;
var CAM_TYPE = 2;
var CAM_JPGIPS = 3;
var CAM_DISPBR = 4;
var CAM_MODEL = 5;
var CAM_DISPVBR = 6;

var CAM_H265 = 0;
var CAM_H264 = 1;
var CAM_JPEG = 2;

var COMPKIND_H265 = 0;
var COMPKIND_H264 = 1;

var defDefalutRecDay = 30;

var defDelRAIDcode = new Array(0, 1, 5, 6, 9);


var INFOMSGMODE = 1;
var ALARTMSGMODE = 2;
var CONFMSGMODE = 3;
var bBrPrioMsg = true;

var RET_NO_ERROR = 0;
var RET_EXT_OVF = -1;
var RET_NWDR_OVF = -1;

if (app_dst == 'ja') {
    var defSelHDDcapaTB = new Array(4, 3, 2, 1);
    var defSelHDDcapaGB = new Array(4000, 3000, 2000, 1000);
} else {
    var defSelHDDcapaTB = new Array(8, 6, 5, 4, 3, 2);
    var defSelHDDcapaGB = new Array(8000, 6000, 5000, 4000, 3000, 2000);
}


var gCamModelParamInfo = new Array();
var gCamModelNameUI = new Array(CAM_TYPENUM_ALL);
var gCamNumberUI = new Array(CAM_TYPENUM_ALL);
var gBitRateUI = new Array(CAM_TYPENUM_ALL);
var gFrameRateUI = new Array(CAM_TYPENUM_ALL);
var gCamScanUI = new Array(CAM_TYPENUM_ALL);

var gCalcMbps = new Array(CAM_TYPENUM_ALL);
var gDispMbps = new Array(CAM_TYPENUM_ALL);
var gDispVideoMbps = new Array(CAM_TYPENUM_ALL);

var gCalcRecJpegMbps = new Array(CAM_TYPENUM_JPEG);
var gCalcJpegMbps = new Array(CAM_TYPENUM_JPEG);
var gCalcBandJpegMbps = new Array(CAM_TYPENUM_JPEG);
var gDispJpegRecMbps = new Array(CAM_TYPENUM_JPEG);
var gDispBandJpegMbps = new Array(CAM_TYPENUM_JPEG);
var gJpegIps = new Array(CAM_TYPENUM_ALL);

var gVideoMbps = new Array(CAM_TYPENUM_ALL);

var gVideoMbps_w = new Array(CAM_TYPENUM_ALL);

var gTotalCamNum = 0;
var gTotalMicNum = 0;
var gRecDay = 0;
var gRecHour = 0;

var gReload_flg = 0;
var gCompkind = 0;
var gTimelineFlg = 0;

var gSelHddUnitGB = 0;
var gSelRaidMode = 0;

var defPlusRecMax = 3;

var g_DynaConnect = new Array(0, 0, 0, 0, 0);
var g_DsplayResultFlag = new Array(1, 1, 1, 1, 1);

var g_FaceOverFlag = 0;

var g_strmsg = '';

var gNwdrInfo = new Array();

var gNwdrDetailInfo = new Array('', '', '', '', '');

var camBitrate = new Array();
var tmpcamBitrate = new Array();

var Framerate = new Array();

var VSeriesNum = 3;

var H265Num_h265 = 9;
var H265Num_h264 = 7;
var H265Num_jpeg = 5;


var defCamNumMax = new Array(128, 0, 0, 0, 0);

var defMaxConAddInfoAdv = new Array(128, 0, 0, 0, 0);

var defMaxConAddInfo = new Array(128, 0, 0, 0, 0);

var defMaxConAddInfoSS = new Array(64, 0, 0, 0, 0);

var defMaxConAddInfoAudio = new Array(88, 0, 0, 0, 0);

var defMaxJpegIps = new Array(640, 0, 0, 0, 0);

var defLimitBandWidth = new Array(393.216, 0, 0, 0, 0);

var defRecCoef = new Array(0.94, 0, 0, 0, 0);

var defMaxHddNum_Main_RAID0 = new Array(9, 0, 0, 0, 0);

var defMaxHddNum_Main_RAID1 = new Array(8, 0, 0, 0, 0);

var defMaxHddNum_Main_RAID5 = new Array(8, 0, 0, 0, 0);

var defMaxHddNum_Main_RAID6 = new Array(7, 0, 0, 0, 0);

var defLimitOfExtNum = new Array(5, 0, 0, 0, 0);

var defMaxHddNum_Ext_RAID0 = new Array(9, 0, 0, 0, 0);

var defMaxHddNum_Ext_RAID1 = new Array(8, 0, 0, 0, 0);

var defMaxHddNum_Ext_RAID5 = new Array(8, 0, 0, 0, 0);

var defMaxHddNum_Ext_RAID6 = new Array(7, 0, 0, 0, 0);

var defMaxHddNum_System_RAID0 = new Array(54, 0, 0, 0, 0);

var defMaxHddNum_System_RAID1 = new Array(48, 0, 0, 0, 0);

var defMaxHddNum_System_RAID5 = new Array(48, 0, 0, 0, 0);

var defMaxHddNum_System_RAID6 = new Array(42, 0, 0, 0, 0);

var defMainUnitPow = new Array(125, 0, 0, 0, 0);

var defExtUnitPow = new Array(85, 0, 0, 0, 0);

var defSizeAtUnit = new Array(3, 0, 0, 0, 0);

var defValRatio = new Array(4, 0, 0, 0, 0);

var CALC_AUDIO_AACLC = 0.064;

var DISP_AUDIO_AACLC = 0.0625;

var CALC_AUDIOENC_AACLC = 0.03569;

var DISP_AUDIOENC_AACLC = 0.03485;

var CALC_AUDIOSELECT_AACLC = 0;

var CALC_AUDIOSELECT_G726 = 1;

var CALC_AUDIOAACLDSELECTED = false;
var CALC_AUDIOAACLDSELECTED_prestat = 0; 

var CALC_AUDIO = 0.032;

var DISP_AUDIO = 0.03125;

var CALC_AUDIO_360 = 2.048;

var DISP_AUDIO_360 = 2;

var CALC_SUBSTREAM_H265 = 0.512;

var DISP_SUBSTREAM_H265 = 0.5;

var CALC_SUBSTREAM_H264 = 0.768; 

var DISP_SUBSTREAM_H264 = 0.75;  

var CALC_ENCDATA = 0;

var DISP_ENCDATA = 0;

var CALC_HTTPS = 1.0042;

var DISP_HTTPS = 1.0041;

var AUDIOADDDATA = 0.016;

var CALC_VMDINFO = 0.006;

var DISP_VMDINFO = 0.005859375;

var NX400_NORMAL_LIM_MBPS = 6;

var NX400_LIM_MBPS = 14;

var defGetaJpeg = 1.15;

var defNXtimelineTB = 0.024;

var SubStream = true;

var Secure = true;

var VbrJa = false;

var List_BurstRate = [
    [64, 2],
    [128, 2],
    [256, 2],
    [384, 2],
    [512, 2],
    [768, 1.75],
    [1024, 1.75],
    [1536, 1.75],
    [2048, 1.75],
    [3072, 1.5],
    [4096, 1.5],
    [6144, 1.5],
    [8192, 1.5],
    [10240, 1.3],
    [12288, 1.3],
    [14336, 1.3],
    [16384, 1.3]
];

var camRecAudio = [
    [s_scene_audio_aaclc],
    [s_scene_audio_g726]
];

var RecMngAreaSize = 320;
var RecFileSize = 20;
var RecFileMngSize = 1.125;

var defHXE400SizeAtUnit = 3; 

var NXE40 = 0;
var NXE41 = 1;


var CAM_TYPENUM_H265 = 4;
var CAM_TYPENUM_H264 = 4;
var CAM_TYPENUM_JPEG = 4;
var CAM_TYPENUM_H264VBR = 3;
var CAM_TYPENUM_H265VBR = 3;

var CAM_TYPENUM_ALL =
    (CAM_TYPENUM_H265 + CAM_TYPENUM_H264 + CAM_TYPENUM_JPEG + CAM_TYPENUM_H264VBR + CAM_TYPENUM_H265VBR);
