function flashExists()
{
    // initialise vars
    flashinstalled = 0;
    flashversion = 0;

    if (navigator.plugins && navigator.plugins.length)
    {
        // user using netscape
        //   plugins.length is checked so that we avoid ie

        x = navigator.plugins["Shockwave Flash"];

        if (x)
        {
            // flash definitely exists

            flashinstalled = 2;
            if (x.description)
            {
                // get flash version

                y = x.description;
                flashversion = y.charAt(y.indexOf('.')-1);
		flashversion = 10;
		//if (flashversion == 0)
		//{
		//	flashversion = 10;
		//}
            }
        }
        else
        {
            // flash doesn't exist

            flashinstalled = 1;
        }

        if (navigator.plugins["Shockwave Flash 2.0"])
        {
            // special case for flash 2.0

            flashinstalled = 2;
            flashversion = 2;
        }
    }
    else if (navigator.mimeTypes && navigator.mimeTypes.length)
    {
        // user using other browser apart from netscape or ie
        //   mimeTypes.length is checked so that we avoid ie

        x = navigator.mimeTypes['application/x-shockwave-flash'];
        if (x && x.enabledPlugin)
        {
            flashinstalled = 2;
        }
        else
        {
            flashinstalled = 1;
        }
    }
    else
    {
        // user using ie
        document.writeln('<script language="VBScript">');
        document.writeln('on error resume next');
        document.writeln('For i = 2 to 10');
        document.writeln('    If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then');
        document.writeln('    Else');
        document.writeln('        flashinstalled = 2');
        document.writeln('        flashversion = i');
        document.writeln('    End If');
        document.writeln('Next');
        document.writeln('If flashinstalled = 0 Then');
        document.writeln('    flashinstalled = 6');
        document.writeln('    flashversion = 6');
        document.writeln('End If');
        document.writeln('</script>');
    }


    if (flashinstalled < 2)
    {
        // return 0:don't know if flash installed, or
        //        1:flash not installed
        return flashinstalled;
    }
    else
    {
        // flash installed, return the version number
        return flashversion;
    }
}
