Where do I add a jQuery UI in Drupal 7? I have a view where I want to use the jQuery UI slider.
For the moment, I've just put the following in my template.php:

drupal_add_library('system', 'ui.slider');


This doesn't feel right.  

Is there a better place to put something like that, or at least do a check so it only get loaded when it is needed?
Ok, you can use preprocess functions for views.


Drupal 6 - Add Javascript to a View
Programmatically set a css class of a view
Using views preprocesses to add css and js to a view