How to check if ScriptX is installed

Upon the window.onload event, test whether or not the object property of the ScriptX or the Security Manager object returns as a valid object. The way to do that is shown in the script snippet below.

<!-- MeadCo Security Manager - using the evaluation license -->
<object id="secmgr" viewastext style="display:none"
classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
codebase="smsx.cab#Version=8,0,0,56
">
  <param name="GUID" value="{C4DB5D29-BE52-46B9-9DDF-46A167170F81}
">
  <param name="Path" value="sxlic.mlf">
  <param name="Revision" value="0">
</object>

<!-- MeadCo ScriptX -->
<object id="factory" viewastext style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
</object>

<script >
function window.onload() {
  if ( !factory.object ) {
    alert("MeadCo's ScriptX Control is not properly installed!");
    navigate("scriptx-install-error.htm");
    return;
  }
  if ( !secmgr.object ) {
    alert("MeadCo's Security Manager is not properly installed!");
    navigate("secmgr-install-error.htm");
    return;
  }
  if ( !secmgr.validLicense ) {
    alert("The license is invalid or has been declined by the user!");
    navigate("license-error.htm");
    return;
  }
  alert("Ready to script MeadCo's ScriptX!")
}
</script>