Google couldn't do that reliably until, hmm, two years ago, ish?  (GoogleBot still doesn't execute all Javascript, but it is getting smarter about both heuristic evaluation and limited execution.  Test if you're skeptical, for example, by linking to pages "obviously" from within Javascript, linking to them using something a wee bit tricky like Prototype -&#62; AJAX load a static file with the link in it, and then try with something where you need full execution to evaluate the link URL.  Then see which pages Googlebot visits.  For best results do this from a well-loved page.)