function OnOCXError ()
{
  document.location.href = "../../Files/OCXError.htm";
}

/* We call this function as a test to verify control is properly loaded and working */
function OnPageLoad ()
{
  try
  {
    WebSignature.Clear();
  }
  catch(e)
  {
    /* If the control has not been loaded - we open ActiveX installation page */
    document.location.href = "../../Files/PPCInstall.htm";
  }
}

function InsertWebSign(sAttrs, sParams)
{
  document.writeln('<OBJECT id="WebSignature" name="WebSignature" ' + sAttrs);
  document.write('onerror="OnOCXError()"');
  document.write('classid="clsid:4E534257-3000-4E22-83A5-AD614CB96642"');
  try
  {
    if (window.navigator.platform == "Win64")
      document.write('CODEBASE="../../Files/WebSign.x64.CAB#version=1,0,10">');
    else
      document.write('CODEBASE="../../Files/WebSign.x86.CAB#version=1,0,10">');
  }
  catch(e)
  {
    document.write('CODEBASE="../../Files/WebSign.i386.CAB#version=1,0,10">');
  }
  document.write(sParams);
  document.writeln('</OBJECT>');
}

function OnSubmit (sURL, sPar)
{
  WebSignature.Submit(sURL, sPar);
}

function OnClear ()
{
  WebSignature.Clear();
}
