This has to be one of the most asked questions. There is no bullet proof way to do this so, as such, you should not rely on X functionaility for a particular porition of your site to work. What wilkanah is proposing will work...if the user has not disabled javascript.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========