/*
 * @(#)plugins.js        			1.0 08/04/2003
 */

/*
  Modification History;

  Modified by		Date 		Description
  ----------- 		---  		------------
  Manoj K Kushwaha	20030804	Created
*/

/**
 * This script detects Flash Plugin and Windows Media Player
 
 * @author  Manoj K Kushwaha
 * @version 1.0, 08/04/03
 */
 
//REUSED CODE FOR TESTING THE PLUGIN
//===============================================================================================================================

var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));

//Detects the Plugin based on ClassID and name for Internet Explorer
function DetectIE(ClassID,name) 
{ 
	result = false; 
	document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return '';
}//End DetectIE(ClassID,name)

//Detects the Plugin based on ClassID and name for Netscape Navigator
function DetectNS(ClassID,name) 
{ 
	n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; 
}//End DetectNS(ClassID,name)


//Opens a new window
function PopUpWindow() 
{
	lft = (screen.width-590)/2;
	tp = (screen.height-125)/2;
	settings='fullscreen=no,toolbar=no,titlebar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,width=590,height=125,left=' + lft + ',top=' + tp + ',resizable=yes'; 
	MyNewerWindow=window.open("plugins.htm",'',settings);
}//End PopUpWindow()

if (ie && win) 
{
	pluginlist = DetectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash"); 
	//alert(pluginlist )
}

if (ns || !win) 
{
	nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
	pluginlist = DetectNS("application/x-shockwave-flash","Shockwave Flash");
}

if (pluginlist.length > 0)
{
	//Removing the ',' at the end of pluginlist
	pluginlist = pluginlist.substring(0,pluginlist.length-1);
}

if (pluginlist.indexOf("Windows Media Player")==-1)
{
	bWMPlayer=false;
}
if ((pluginlist.indexOf("Flash")==-1))
{
	PopUpWindow();
}
//END OF REUSED CODE
//==================================================================================================================
