No there is not. JavaScript is not supported in emails (thank God!).
Also, why do you even want to do that? Every email programm has that functionality already.
Edit: OK, there are some exceptions that actually support JavaScript. But this does not mean you should even think about adding JavaScript to your emails.