How to add inline script in WordPress

Hi,

How do you add an inline script for WordPress?
I have this code -> http://pastie.org/10934969

and I am not sure if I added it correctly mixing jquery with php…

anyone can advice me?

Thank you very much!