//***************************
// For detecting the ActiveX for ie win.
// Requires vbscript function below to be included on
// the page to do the actual checking.
// Returns version found or 0.0.
// This function can return a boolean or a floating point value.
// If you supply a reqVer value (number) it will return true or false
// depending on if that version or higher was found.
// If you don't supply a parameter it will return the found version number.

// vb detection - i.e. win
/*
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('Function VBGetShockwaveVer(i)');
document.write('on error resume next');
document.write('Dim swControl, swVersion');
document.write('swVersion = "0.0"');
document.write('set swControl = CreateObject("SWCtl.SWCtl." + CStr(i))');
document.write('if (IsObject(swControl)) then');
document.write('swVersion = CStr(i) + ".0"');
document.write('swVersion = CStr(swControl.ShockwaveVersion(""))');
document.write('end if');
document.write('VBGetShockwaveVer = swVersion');
document.write('End Function');
document.write('</SCR' + 'IPT\> \n');
*/


function shockwaveDetectAxVer(reqVer) {
  // this function returns a floating point value which should be the version of the Shockwave control or 0.0
  // this function should only be called from Internet Explorer for Windows

  if (ie && win) {
    // loop backwards through the versions until we get a bite
    for (i=8;i>0;i--) {
      versionString = VBGetShockwaveVer(i);
      if (versionString != "0.0") {
        // if we get 1.0 we assume it is actually 6.0
        versionNum = (versionString == "1.0" ? 6.0 : parseFloat(versionString))
        return (reqVer ? versionNum >= reqVer : versionNum);
      }
    }
  }
  return (reqVer ? false : 0.0);
}
