create an event handler that runs on page load! this can be added to a feature to turn off and on!
within the event handler you can add:
you can call the above method on the page load event! do it like so:
so when you first add the wsp you can activate the feature, the feature will run on each page load event. obviously you need to have a case statment or if function to check what page its on! if its on a specific page you can then bind the JS to the masterpage!