If you have Flash 8 it has a publishing option to create the detection code for you. Look in the publish settings under HTML (HTML option must be selected for the tab to be present). You will likely want to do some tweaking to the code to modify text if viewer does not have Flash, but that is fairly easy to figure out. I also recommend reading a good article at Macromedia under Developers/Flash about the latest in Flash detection. It's a great help.