Insert JavaScript in a blog post or a new page?

Have a look at wp_enqueue_script.

EDIT : Here are two plugins that may accomplish what you need