// Detect Flash

var isIE = (navigator.appName == 'Microsoft Internet Explorer');
var isWin = ( navigator.userAgent.indexOf('Windows') != -1 );

function CreateFlash(cnt) { document.write(cnt); }

var bShowFlash = false;
var flashEnabled = false;

function DetectFlash()
{
  if(isIE && isWin){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');  // Must break up tag so it doesn't break our script
	document.write('on error resume next \n');
	document.write('Dim Ver \n');
	document.write('For Ver = 6 to 15 \n');
	document.write('flashEnabled = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & CStr( Ver ))))\n');
	document.write('If flashEnabled = True Then \n');
	document.write('Break \n');
	document.write('End If \n');	
	document.write('Next \n');
	document.write('</SCR' + 'IPT\> \n'); 		// Must break up tag so it doesn't break our script
  }

  if( navigator.plugins ) {
	var plugin = navigator.plugins["Shockwave Flash"];	
	if (plugin != null && typeof(plugin) != 'undefined')
	{		
	    var flashVersion = 0;
	    var aV = plugin.description.match(/\d+\./g);	
	    if (aV.length > 0) flashVersion = parseInt(aV[0]); 
    
    	if (flashVersion >= 6)
    	{
		    var numTypes = plugin.length;
		    for (j = 0; j < numTypes; j++)
		    {
    			mimetype = plugin[j];
			    if (mimetype)
			    {
    				if (mimetype.enabledPlugin && (mimetype.suffixes.indexOf("swf") != -1))
					    flashEnabled = true;
				    // Mac wierdness
				    if (navigator.mimeTypes["application/x-shockwave-flash"] == null)
    					flashEnabled = false;
			    }
		    }
	    }
	 }
  }
  if (!flashEnabled) {
	bShowFlash=false;
  }
  else
  {
	bShowFlash=true;
  }
}

// Make flash detection now
DetectFlash();
