I know you can add css / js with the drupal_add_css() or drupal_add_js(). Is there a way to define dependancies ?
Use Case Example:
I need a custom tabs/carousel jquery plugin working. I need jquery and jquery ui to load first. In order to ensure that i'd like it to load after jquery and jquery ui.
How would one do that?
Also, is there a way to declare if a script / library is already loaded? i.e. if i load two jquery (1.4 vs 1.8.1) libraries it'll conflict.
Or would this discussion be better suited for the drupal core issue queue?