//***************************
// For detecting the shockwave plugin for Netscape.
// 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.

function shockwaveDetectNsVer(reqVer) {
  // This function returns a floating point value which should be the version of the Shockwave plugin or 0.0
  // This function only returns useful information if called from Netscape or IE Mac 5.0+

  if (!navigator.plugins) return (reqVer ? false : 0.0); // IE Mac 4.5 and lower don't have a plugins array.

  // Set these local variables to avoid the Netscape 4 crashing bug.
  thearray = navigator.plugins
  arraylen = thearray.length

  // Step through each plugin in the array.
  for (i=0; i < arraylen; i++) {
    // Set these local variables to avoid the Netscape 4 crashing bug.
    theplugin = thearray[i]
    thename   = theplugin.name
    thedesc   = theplugin.description

    // If the plugin is Shockwave...
    if (thename.indexOf("Shockwave") != -1 && thename.indexOf("Director") != -1) {
      // ...extract the version information
      versionString = thedesc.substring(thedesc.indexOf("version ") + 8);
      if (versionString.indexOf(".") > 0) {
        versionMajor = versionString.substring(0,versionString.indexOf("."));
        versionMinor = versionString.substring(versionString.indexOf(".") + 1);
        if (versionMinor.indexOf(".") > 0)
          versionMinor = versionMinor.substring(0,versionString.indexOf("."))
                         + versionMinor.substring(versionMinor.indexOf(".") + 1);   
        versionString = parseInt(versionMajor) + "." + versionMinor;
      }
      return (reqVer ? (parseFloat(versionString) >= reqVer) : parseFloat(versionString));
    } 
  }
  return (reqVer ? false : 0.0);
}