I need to write a script that detects if a person has flash installed and if they do then do something, if not do something else.

I can do this no problem with javascript - except for the detecting flash part. I have no idea how to have a js detect flash - or even if its possible.