Javascripts can't really detect flash reliably. There is a system that can. Make a page with a meta refresh to the non flash site at say 5 seconds. Then put on that page a flash object that contains an actionscript to redirect to the flash version after say 2 seconds. If the visitor has flash, the actionscript will take them to the flash site, if not they go to the non flash site.