//////////////////////////////////////////////////////////////////////////////////
//  File:         featurset.js
//  Descruption:  This file contains feature set information. it should contain
//                the same set of information as FeatureSet.java. It gets its
//                values through the StatusFeatureSet API handler in 
//                FeatureSetHandler.java
//  Created By:   Jonathan J. Smith (jonathan.smith@polycom.com)
//////////////////////////////////////////////////////////////////////////////////

function getDocCameraID ()
{
  return (getMaxNoOfCameras () <= 2 || isReagan) ? -1 : 2
}

function getVCRCameraID ()
{
  var nMaxCameras = getMaxNoOfCameras ()
  if (isReagan || nMaxCameras < 2) return -1
  return (nMaxCameras == 2) ? 2 : 3
}

function getAUXCameraID ()
{
  if (isReagan) return 2
  else return (getMaxNoOfCameras () < 4) ? -1 : 4
}

function getAUX2CameraID ()
{
  return (getMaxNoOfCameras () < 5) ? -1 : 5
}

function getMaxNoOfCameras ()
{
  if (IsVSeries ()|| IsSSeries ()) return 1
  if (Is3000Family () || Is5000Family () ||
     Is6000Family () || isReagan) return 2
  if (isTruman || isIke) return 4
  if (isRoosevelt) return 5
  else return 3
}

function isVCRInputAvailable ()
{
  return getVCRCameraID () > 0
}

function IsFIPSSupported ()
{
  return (doesSupportEncryption && 
     !(is7000 || (is3000 && !is3000A) || IsVSeries () || is6000))
}

function IsSimH323SIPSupported ()
{
  return (is8000 || is7000e || is7000S || is7000A || is8000A || is6000A || is5000 || is3000A || is700)
}

function getNumSerialPorts ()
{
  if (!IsSSeries ())
  {
    if (is8000A) return 3
    else if (is8000 || isRoosevelt || isGuadalupe) return 2
    else if (Is5000Family () || Is6000Family () ||
             Is7000Family () || isTruman || isIke) return 1
  }
  return 0
}

// Camera 1 is ether always PTZ or never PTZ
function isCamera1PTZCapable ()
{
  return !(Is3000Family () || IsVSeries ())
}

function isSingleMonitorVGACapable () {return IsCharlesFamily () || Is8000Family () || is5000 || isNG}
// from HDX function isSubwooferCapable () {return Is7000Family () || is5000}
function isSubwooferCapable () {return !IsSSeries () && !Is6000Family() && !isHDX}
function isVGAOutputConfigurable () {return is8000 || is7000e || is7000S || is6000A || is5000 || Is9000Family () || isIke}
function needToMonitorVisualConcertAudioInputOption () {return Is8000Family () || isNG}
function isPOTSCapable () {return !(IsSSeries () || Is3000Family () || IsVSeries ())}
function isSystemEmbeddedVisualConcertCapable () {return Is8000Family () || isNG}
function isConferenceLinkCapable () {return !(IsVSeries () || Is3000Family() || isNG)}
function IsContentSupported ()
{
  return isConferenceLinkCapable () || isSystemEmbeddedVisualConcertCapable ()
}
function isUsingFixedCamera () {return IsVSeries () || Is3000Family() || is5000 || isReagan}
function isMultiPointCapable () {return !(IsVSeries () || IsSSeries () || is5000 || Is6000Family())}
function getMaxConference () {return 1}

// These functions are not static and must be in a html or ssi file
//function getMaxEndpointsPerConference () {return }
//function getMaxVideoEndpointsPerConference () {return }
//function getMaxAudioEndpointsPerConference () {return }

function isStereoCapable () {return !(IsVSeries ())}
function isPathNavigatorCapable () {return true}
function isOuputSpeakerCapable () {return !(IsVSeries () || Is3000Family () || is5000 || is6000 || isReagan)}
function getMaxSpeed () {return (is400 ? 384 :(is500 || is700 || is5000 || is6000 || is6000A) ? 768 : 1920)}
function isCameraTrackingCapable () {return Is8000Family () || isNG}
function getEchoCancellerFieldName ()
{
  if (is7000S || is7000e) return "lineinechocanceller"
  if (is8000 || isNG) return "echocanceller"
  else return "lineinredechocanceller"
}
function hasMidRangeSpeakers () {return is6000 || is7000 || is7000S}
function shouldSecondMonitorRequireOptionKey () {return is5000 || is6000A}
function isOptionKeyRequiredForPPCIP () {return !(is8000 || is8000A || isNG)}
function hasOrionCamera () {return is5000}
function isWeathermanCapable () {return isG3}

// These functions are not used on the embedded side
function HasSerialPort (){return (getNumSerialPorts() > 0)}
function IsEnternalMP () {return (isMultiPointCapable () && g_IsEnternalMP)}
function IsMP () {return (g_IsPNAvail || IsEnternalMP ())}
function NeedsMPKey () {return isMultiPointCapable ()}
function NeedsHDVideoIOKey () {return isIke}
function NeedsPPCIPContentKey () {return isIke || isReagan}
function IsStreamingCapable () {return !is500 && !is400 && !isG3 && !IsSSeries ()}
// Feature variables
function HasVOC () {return !isMarley}
function HasInternalRinger () {return (IsVSeries () || is3000)}
function SupportsPolcyomMics () {return (!IsVSeries () && !is3000)}

function MaxMonitors ()
{
  if (Is3000Family () || isReagan || IsVSeries ()) return 1
  if (isIke || isTruman) return 3
  if (isRoosevelt) return 4
  else return 2
}
function HasRestrictedVCRDVDOut () {return isIke}
function Is2ndMonCapable () {return (!isReno && !IsVSeries ())}
function IsPCVGACapable () {return (!isReno && !IsVSeries ())}
function IsPCASCapable () {return (!is400)}//V400 does not have PCAS support
function IsStereoCapable () {return !isTahoe && !is400}

// Option key stuff
function NeedsPCVGAKey () {return (IsPCVGACapable () && (isSabreMinusC || isCharlesMinusC || isGuadalupe))}
function NeedsPPCIPKey () {return (!isAnglefire)}
function Needs2ndMonKey () {return (is5000 || is6000A || is6000Ac)}

function IsCam1Configurable () {return !isMarley && !IsVSeries ()}
function IsProMotionCapable () {return (!isMarley && !IsVSeries () && !Is6000Family ())}
function IsMon1Configurable () {return !isReno && !is700}
function IsMon1SourceConfigurable () {return IsMon1Configurable() && !is6000 && !isTahoe && !is7000 && !is400}
function IsMon2Configurable () {return !NeedsHDVideoIOKey || g_IsHDVideoIOEnabled}
function IsSecondInputCapable () {return getMaxNoOfCameras () > 1}
function IsDigitCamera () {return (isReno || isMarley || IsVSeries ())}
function IsFTPSupported () {return !isNG}

function DoWeYahoo() {return false}
function AreCamerasConfigurable () {return  !IsVSeries ()}
function GetMaxCallsSupported ()
{
  if (isRoosevelt) return 7
  else if (isMultiPointCapable ()) return 3
  else return 1
}
function GetMaxLineRateSupported ()
{
  if (isRoosevelt) return 6
  else if (isTruman || isIke || isReagan) return 4
  else return 2
}
function HasBuiltInMics ()
{
  return isReagan
}
function HasVCROut (){return Is8000Family() || isSabreCharles}
function AreSessionVarsSupported () {return isHDX}
function IsWebUpgradable () {return isHDX}
function IsWebLogCapable () {return isHDX}
function IsTranscodingSupported () {return isHDX}
function IsDialingAllowed () {return !IsSSeries ()}
function Is323Supported () {return !IsSSeries ()}
function Is320Supported () {return !Is6000Family () && !IsSSeries ()}
function GetMaxSIPServers () {return 1}
function IsMidrangeCapable () {return !IsSSeries ()}
function IsLDAPSupported () {return IsSSeries ()}
function IsEAPSupported () {
  return IsSimH323SIPSupported () && ("True" != "True")
}


