/*********************************************************************
 *
 * Built to add to a modified 2000 Macromedia Flash Dispatcher -- a scriptable detector for Flash Player
 * This takes an object I build in the Dispatcher and creates diagnostics screens for display.
 * The original Dispatcher redirects to other locations. This version retains the info and displays it.
 * Dave Stacey
 *********************************************************************/

var gSWDispatchVars = new Object();
var MM_SWControlInstalled ;

// Build the gScreenItems object with all the text for the screen.
// Then write out the screen table

function checkDirector( contentVersion, installURL) {

	// SW Checker:
	var ShockMode = 0;
// 01- check for Navigator and director
	if (navigator.mimeTypes && navigator.mimeTypes["application/x-director"] && navigator.mimeTypes["application/x-director"].enabledPlugin) { 
 // 02- check for plugin and the version
		if (navigator.plugins && navigator.plugins["Shockwave for Director"] && (versionIndex = navigator.plugins["Shockwave for Director"].description.indexOf(".")) != - 1) {	
	// The Plugin Exists and has a description ...
		var versionString = navigator.plugins["Shockwave for Director"].description.substring(versionIndex-1, versionIndex);
		var subVersionString = navigator.plugins["Shockwave for Director"].description.substring(versionIndex+1, versionIndex+2);
		versionIndex = parseInt( versionString );
		subVersionIndex = parseInt(subVersionString);


		gSWDispatchVars.version = versionIndex ;
		gSWDispatchVars.subVersion = subVersionIndex ;
			if ( versionIndex == 8 ) {
				if (subVersionIndex >= 5) {
					ShockMode = 1;
				} else if ( versionIndex >8 ) {
					ShockMode = 1;
				}
			}
		}// close 02
	}// close Navigator check


	// Check for IE...
	if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.	indexOf("Windows NT")>=0 )) {
   
   		gSWDispatchVars.implementation = "ActiveX control";
		gSWDispatchVars.autoInstallable = true;

		// vars from SWDispatcher.vbs
		if (MM_SWControlInstalled != null )
		{ 	 
		
			ShockMode = 1;
			// SWDispatcher.vbs ran and found Object SWCtl.SWCtl.8.5
			gSWDispatchVars.installed = MM_SWControlInstalled;

			// unreliable-- gSWDispatchVars.version = MM_SWControlVersion;
		}
	} // Close Check for IE...

	bName=navigator.appName;
	bVer=parseInt(navigator.appVersion);
	
	if ((bName=="Netscape" && bVer>=4))
	{
		if(shockwaveDetectNsVer() > 0)
		{
			gSWDispatchVars.dirmarkStatusSym = "isPresent" ;
			writeFinal();
		}
		else
				{
			gSWDispatchVars.dirmarkStatusSym = "notPresent" ;
			 writeFinal();
				}
	}
	else if (ShockMode) {
		//---------// Version is GOOD
		gSWDispatchVars.dirmarkStatusSym = "isPresent" ;
		writeFinal();
	}
	else if (!ShockMode) {
		//---------// Version is NOT GOOD
		gSWDispatchVars.dirmarkStatusSym = "notPresent" ;
		writeFinal() ;
	}
} // close checkDirector


function writeFinal() {
	///////////// Final READOUT 
		// Check Mark Graphic
		var htm = "";
		htm += '<div class="sysTypeWrapper">';
					
      	htm += '<div class="shockWave"></div>';
      	htm += '<div class="shockWaveContent">';
  		htm += '<div><b>Macromedia Shockwave Player</b></div>';
		htm += '<div class="' + gSWDispatchVars.dirmarkStatusSym + '" id="shockTag">You have Shockwave Player.</div>';
		htm += '</div>';
		htm += '</div>';
		
	document.write( htm ) ;
}





