/*******************************************************************************
FILE NAME    :flashck.js
DEPENDENCIES :browser.js
********************************************************************************
____________________________ API DOCUMENTATION BEGIN ___________________________
````````````````````````````````````````````````````````````````````````````````
Plugin detection code for browsers supporting navigator.plugins array.

The global variables below are also visible to the flashck.vbs file.
Please see the documentation in that file for more detailed information.

The code in this file only checks for the Flash player for the specified
browsers. The Flash player for IE on windows gets checked by flashck.vbs. If 
the browser being used is not specified or cannot be identified then the
variable flashInstalled is set to "unknown".

Navigator has a Plug-in object for each plug-in installed in the browser. You
can reference these objects as elements of the navigator.plugins array. 
Remember that each plug-in object has its own array of elements that indicate 
the mimeTypes handled by the plug-in. First we check for the plug-in and if 
the plug-in is installed then we check if a particular mimeType was installed 
for that plug-in. The plug-ins and mimeTypes arrays are both indexed 
(numerically) and associative arrays (lets you check for the existence of a 
particular plugin without having to loop through the array numerically by 
checking every element). IE 4 and above will always return empty when checking 
the plugins and mineTypes arrays because it is not compatable (use VBsript 
to detect activeX controlls in IE). 

navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin

The code above tells us if the flash content in a page will be handled by the 
plugin, the browser itself or a helper application. If "enabledPlugin" returns 
true than a plugin will be handling the content.

VBscript:
Only supported on a windows machine in all versions of IE. You will get errors 
if you try using VBscript in IE on a Mac.

Plug-in array support:
The code in this file uses the plug-in and mimeTypes arrays to sniff for a 
plug-in. This code will only work in browsers that support these arrays. The 
following are the browsers that support these arrays:

All versions of Netscape on both windows and mac
IE 5 on mac

All versions of IE earlier than 5 on a mac do not support the plug-in arrays
and also do not support VBscript. Therefore it is not possible to detect the 
flash plug-in in these browsers unless you use flash to detect flash.

````````````````````````````````````````````````````````````````````````````````
_____________________________ API DOCUMENTATION END ____________________________
*******************************************************************************/

//-- global variables begin ----------------------------------------------------
flashInstalled = false; //flash player installed status
flashVersion   = 0; //flash plug-in version default
//-- global variables end ------------------------------------------------------

if(!(gBrowser.isWin && gBrowser.ie)) //abort if windows IE 
{
 if(gBrowser.ns || gBrowser.safari || gBrowser.opera || (gBrowser.isMac && gBrowser.ie && gBrowser.majorVersion >=5))
 {
  if(navigator.plugins["Shockwave Flash"] && navigator.mimeTypes["application/x-shockwave-flash"])
  {
   flashInstalled = true;
   flashVersion = parseInt(navigator.plugins["Shockwave Flash"].description.substring(16));
  }
 }
 else flashInstalled = "unknown"; //can't identify browser
}

//---END