//Modified by Abhishek Pol on 7-May-09 to implement MrSid with firefox code
//	
//	MrSID Plugin Detector
//


function write( str )	{ document.write( str ); }
function writeln( str )	{ document.writeln( str ); }

var WM_startTagFix = '</';
var msie_windows = 0;
  
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1))
{
	msie_windows = 1;

	writeln('<script language="VBscript">');
	writeln('\'This will scan for plugins for all versions of Internet Explorer that have a VBscript engine version 2 or greater.');
	writeln('\'This includes all versions of IE4 and beyond and some versions of IE 3.');
	writeln('Dim WM_detect_through_vb');
	writeln('WM_detect_through_vb = 0');
	writeln('If ScriptEngineMajorVersion >= 2 then');
	writeln('  WM_detect_through_vb = 1');
	writeln('End If');

	writeln('Function WM_activeXDetect(activeXname)');
	writeln('  on error resume next');
	writeln('  If ScriptEngineMajorVersion >= 2 then');
	writeln('     WM_activeXDetect = False');
	writeln('     WM_activeXDetect = IsObject(CreateObject(activeXname))');
	writeln('     If (err) then');
	writeln('        WM_activeXDetect = False');
	writeln('     End If');
	writeln('   Else');
	writeln('     WM_activeXDetect = False');
	writeln('   End If');
	writeln('End Function');
	writeln(WM_startTagFix + 'script>');
}

function SID_pluginDetect(activeXname)
{
	var	plugin_undetectable=0;
	
	// Check to see if it's an MSIE browser that you can actually
	// check for the plugin in question. 
	//alert (WM_detect_through_vb)
	if (msie_windows && WM_detect_through_vb) {
		plugin_undetectable = 0;
	}
	else {
		plugin_undetectable = 1;
	}
	
	if((msie_windows == 1) && !plugin_undetectable) {
		return WM_activeXDetect(activeXname);
	}
	else 
	{ 	
			if ((navigator.userAgent.indexOf("Firefox")!=-1) ||  (navigator.userAgent.indexOf("Chrome")!=-1) ||  (navigator.userAgent.indexOf("Safari")!=-1))
			{
				for (i=0; i < navigator.plugins.length; i++)
				{
					if (navigator.plugins[i].name=="Express View")
					{
						return true;
					}
				}
			}
			else
			{
				return 0;
			}
			//return 0;
	}
}

