// VBScript Document

<!--
on error resume next
//the actual detect. check if MSDetect is true. If it is, execute the rest of the VBScript.
If MSDetect = "true" Then
//create objects. Flash 2 is called ShockwaveFlash.ShockwaveFlash.2, 
//Flash 3 is called ShockwaveFlash.ShockwaveFlash.3 etc. 
//So create all these objects and see which one of them doesn't give an error.
//go through the versions
	For i = 2 to 7
		//create an object for Flash version i
		If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then
		//If the object can be created and is present, 
		//you've found the installed Flash version. 
		//set flashinstalled to 2 and flashversion to i.
		Else
			flashinstalled = 2
			flashversion = i
		//End all. required in VBScript. equivalent of closing brackets } in JavaScript.
		End If
	Next
End If

//If, after checking all possible versions, flashinstalled is still 0, 
//it means that Flash is not installed. 
//so make it 1.  
If flashinstalled = 0 Then
	flashinstalled = 1
End If
//-->