Code to detect and redirect if flash plugin is installed?

I have two versions of my website, flash and non-flash.

Does anyone know the code to detect if a user’s browser has the flash plug-in installed, and then automatically redirect them to a different webpage if they do?

The way I plan to do it is to send everyone to the non-flash website by default, but immediately, if flash plugin is detected, then they are redirected to the flash website.

Thanks in advance guys.