/*********************************************************************
 * Macromedia Flash Dispatcher -- a scriptable detector for Flash Player
 * copyright (c) 2000 Macromedia, Inc.
 
 * This version was shortened for our needs by spdl@mosaic.ca 2001
 * Get the original Kit at
 * http://www.macromedia.com/support/flash/player/flash_deployment_readme/
 *********************************************************************/

 /*********************************************************************
 * I only want to know, if there is Flash 4/5 or not.
 * I don't care the revision as well.
 *********************************************************************/

 
/*
 * MM_FlashInfo() -- construct an object representing Flash Player status

 *	new MM_FlashInfo()

 *	installed		true if player is installed (undefined if undetectable)
 *	implementation	the form the player takes in this browser: "ActiveX control" or "Plug-in"
 *	version			player version if installed
 *
 */

var MM_FlashControlInstalled;	// is the Flash ActiveX control installed?
var MM_FlashControlVersion;	// ActiveX control version if installed

function MM_FlashInfo()
{
    if (navigator.plugins && navigator.plugins.length > 0)
    {
	this.implementation = "Plug-in";
	this.autoInstallable = false;	// until Netscape SmartUpdate supported

	// Check whether the plug-in is installed:

	if (navigator.plugins["Shockwave Flash"])
	{
	    this.installed = true;

	    // Get the plug-in version and revision:

	    var words =
		navigator.plugins["Shockwave Flash"].description.split(" ");

	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;

		this.version = words[i];

		this.revision = parseInt(words[i + 1].substring(1));
	    }
	}
	else
	{
	    this.installed = false;
	}
    }
    else if (MM_FlashControlInstalled != null)
    {
	this.implementation = "ActiveX control";
	this.installed = MM_FlashControlInstalled;
	this.version = MM_FlashControlVersion;
	this.autoInstallable = true;
    }

    this.canPlay = MM_FlashCanPlay;
}


/*
 * MM_FlashCanPlay() -- check whether installed Flash Player can play content

 *	MM_FlashCanPlay(contentVersion)
 *
 *	Arguments:
 *	    contentVersion		version of Flash software used to author content
 *
 *	Returns:
 *	    true if the installed player can play the indicated content;
 *	    false otherwise.
 */

function MM_FlashCanPlay(contentVersion, requireLatestRevision)
{
    var canPlay;

    if (this.version)
    {
	canPlay = (parseInt(contentVersion) <= this.version);
    }
    return canPlay;
}


function getURLInfo() {
	currentLoc 	= new String(window.location);
	locArray 	= currentLoc.split("//");
	locArray	= locArray[1];
	pos 		= locArray.indexOf("/");
	
	baseURL		= "http://" + locArray.substr(0, pos+1);
	pageLink	= locArray.substr(pos+1);
	
	returnArray = new Array();
	returnArray[0] = baseURL;
	returnArray[1] = pageLink;
	
	return returnArray;
}

