
Function AgentInstalled()
  On Error Resume Next

  Dim AIN

  If ScriptEngineMajorVersion < 2 Then
    AgentInstalled = False
  Else
    Set AIN = CreateObject("Agent.Control.2")
    AgentInstalled = IsObject(AIN)
  End If
End Function

Function WriteAgentObject()
  If AgentInstalled() Then
    Document.WriteLn "<Object ID=""Agent"" Width=""0"" Height=""0"""
    Document.WriteLn "  ClassID=""CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F"""
    Document.WriteLn "  CodeBase=""#VERSION="">"
    Document.WriteLn "</Object>"
  End If
End Function

