function getShockwaveVersion()
{
  // Set local variables to avoid crashing bug
  var thearray = navigator.plugins;
  var arraylength = thearray.length;
  
  var version = 0;
  for (i=0; i<arraylength; i++)
  {
    theplugin = thearray[i];
    // Retrieve the plugin
    thename   = theplugin.name;
    // Get the plugin name
    thedesc   = theplugin.description;
    // Get the plugin description
      // If the plugin is the Shockwave Player...
      if (thedesc.indexOf("Shockwave")
        != -1 && thedesc.indexOf("Director") != -1)
        { 
        // ...parse out the version...
        versionString = thedesc.substring(thedesc.indexOf("version ") + 8);
        // ...pet the major version...
        majorVersion = parseInt(versionString);
        // ...and return it.
        version =  majorVersion;
        
        return version;
        } 
   }
   // If we've went through the whole list of plugins without
   // finding Shockwave, we return zero.
   version =  0;
   return version;
}

