Detecting flash just to view user's stats?

hey guys,

i am working on a site that may/may not contain flash elements, depending on how large a percentage of my clients users have it installed, as well as what version they have installed.

how can i go about putting in some code on my page to detect if the person has flash installed, and what version they’re using, and then be able to view a report where i can see this info on my client’s users?