$(document).ready(function () {
    getPTZPower();
    var deviceInfo1 = getDeviceInfo();
    var deviceInfo = config.deviceInfo;
    $("#DeviceName").val(deviceInfo.DeviceName);
    $("#DeviceTypeName").val(deviceInfo.DeviceTypeName);
    $("#SerialNum").val(deviceInfo.SerialNum);
    $("#WebWareVersion").val(window.config.webVersion);
    $("#OCXVersion").val(window.config.iePlugVersion);
    $("#SoftWareVersion").val(deviceInfo.SoftWareVersion);
    $("#afVersion").val(deviceInfo1.AFBoardVersion);
    $("#VideoInputChannels").val(deviceInfo.VideoInputChannels);
    $("#AudioChannels").val(deviceInfo.AudioChannels);
    $("#AlarmInputChannels").val(deviceInfo.AlarmInputChannels);
    $("#AlarmOutputChannels").val(deviceInfo.AlarmOutputChannels);
    if (deviceInfo.TwoWayAudi == 'true') {
        $("#TwoWayAudio").val($.i18n.prop("i18n-device-support"));
    } else {
        $("#TwoWayAudio").val($.i18n.prop("i18n-device-nosupport"));
    }
});
function getPTZPower() {
    var cvurl = config.baseUrl + "/System/PTZCap";
    $.ajax({
      url: cvurl,
      type: "GET",
      async: false,
      timeout: 15000,
      beforeSend: function (xhr) {
        xhr.setRequestHeader("If-Modified-Since", "0");
      },
      success: function (xmlDoc, textStatus, xhr) {
        var Version = $(xmlDoc).find("Channel").eq(0).find('AFProfessionPTZ').eq(0).find("Version").eq(0).text();
        if (Version == "true") {
          $("#afVersionDiv").show();
        }
      },
      error: function (xhr, textStatus, errorThrown) {},
    });
  }