The answer is no, Google does not punish for links hidden for a better user experience. They frown upon malicious hidden text that can never be visible to a user, but understand obviously that JavaScript is frequently used to display content when certain events happen on the page. Below is a link from Google clarifying this. One suggestion they have is to
Place the same content from the JavaScript in a
<noscript>
tag. If you use this method, ensure the contents are exactly the same as what’s contained in the JavaScript, and that this content is shown to visitors who do not have JavaScript enabled in their browser.
http://support.google.com/webmasters/bin/answer.py?hl=en&topic=15263&answer=66353
In addition, here is a resource from a person that actually tested if Google indexed hidden elements: http://seotesttool.com/blog/does-the-google-bot-index-css-hidden-divs/