We use menu block a lot to create sidebar menus with specific depths, starting points, etc. The following snippet shows how we can use jQuery to turn a normal <h2> tag into a link. The link's destination will be the same as the first child link.
The following snippet is one way to determine if a jQuery plugin is loaded an available. There are probably other ways to achieve the same behavior, however this one never seems to fail me.
if (jQuery().jcarousel) {
// The plugin is here, do something with it.
$('.jcarousel-enabled').jcarousel();
}
There are several ways to add javascript code to a page in Drupal. The method outlined below involves a modification to your theme's template.php file. You'll be editing (and un-commenting if necessary) your theme's preprocess_page function. This basically lets you modify the variables that are available in your page.tpl.php file(s).