' ACG_Detect.vb
' -------------------------------------------------------------------
' -------------------------------------------------------------------
'
'do a one-time test for a version of VBScript that can handle this code
'
g_bDetectableWithVB = False
If ScriptEngineMajorVersion >= 2 then
  g_bDetectableWithVB = True
End If

' -------------------------------------------------------------------
' Function DetectActiveXControlVB( activeXControlName )
'
' This next function will detect most plugins.
' -------------------------------------------------------------------
Function DetectActiveXControlVB( activeXControlName )
  on error resume next
  DetectActiveXControlVB = False
  If g_bDetectableWithVB Then
     DetectActiveXControlVB = IsObject( CreateObject( activeXControlName ) )
  End If
End Function

' -------------------------------------------------------------------
' Function DetectMP64ControlVB()
'
' Use the 'FileName' property of the MP object to determine if MP 6.4
' is installed.
' -------------------------------------------------------------------
Function DetectMP64ControlVB()
  on error resume next
  DetectMP64ControlVB = False
  If g_bDetectableWithVB Then
  	 set player = CreateObject( "MediaPlayer.MediaPlayer.1" )
	 If IsObject( player ) Then
		 DetectMP64ControlVB = (player.FileName="")
	 End If
  End If
End Function

' -------------------------------------------------------------------
' Function DetectMP7ControlVB( byref Version )
'
' Use the 'URL' property of the MP object to determine if MP 7+
' is installed.
' -------------------------------------------------------------------
Function DetectMP7ControlVB( byref Version )
  on error resume next
  DetectMP7ControlVB = False
  If g_bDetectableWithVB Then
  	 set player = CreateObject( "WMPlayer.OCX.7" )
	 If IsObject( player ) Then
		DetectMP7ControlVB = (player.URL="")
		If DetectMP7ControlVB Then
			Version = player.versionInfo
		Else
			Version = 0
		End If
	 End If
  End If
End Function


' -------------------------------------------------------------------
' Function DetectMP7VersionVB()
'
' Returns the version of the MP 7+ object.
' -------------------------------------------------------------------
Function DetectMP7VersionVB()
  on error resume next
  DetectMP7ControlVB = False
  If g_bDetectableWithVB Then
  	 set player = CreateObject( "WMPlayer.OCX.7" )
	 If IsObject( player ) Then
		DetectMP7ControlVB = (player.URL="")
		If DetectMP7ControlVB Then
			DetectMP7VersionVB = player.versionInfo
		Else
			DetectMP7VersionVB = 0
		End If
	 End If
  End If
End Function


' -------------------------------------------------------------------
' Function DetectQuickTimeActiveXControl()
'
' -------------------------------------------------------------------
Function DetectQuickTimeActiveXControl()
  on error resume next
  detectQuickTimeActiveXControl = False
  If detectableWithVB Then
    detectQuickTimeActiveXControl = False
    hasQuickTimeChecker = false
    Set hasQuickTimeChecker = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1")
    If IsObject(hasQuickTimeChecker) Then
      If hasQuickTimeChecker.IsQuickTimeAvailable(0) Then 
        detectQuickTimeActiveXControl = True
      End If
    End If
  End If
End Function

