For the simple code that I provided above, you do not need to include anything in the header. You do not need any <script> tags anywhere. You just put it in the onclick outright.

As for enabling/disabling on startup, I would just do that with PHP. If you want to disable something to begin with (ie, the check box is not checked by default), add disabled="disabled" as an attribute for the textarea.