---- Matt Cutts: Googlebot Can Now Execute AJAX/JS
flatfile - 8:13 pm on Nov 2, 2011 (gmt 0)
If I understood this video from Matt Cutts, something like that would probably be considered cloaking, which could possibly get you into trouble.
Edit Just saw the last part of the video. Guess I'll be changing my pages.