You should have the following the in the header file for your theme if you want to use jQuery.. (don't know regarding UI)..
<?php wp_enqueue_script('jquery');?>
<?php wp_head(); ?>
<?php wp_head(); ?> should already be there, you need to make sure the enqueue script is placed before wp_head.
You also need to rename your functions or use no conflict mode.
This is a snippet (so incomplete) from my "working" header file..
<?php wp_enqueue_script('jquery');?>
<?php wp_head(); ?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function() {
<?php if(is_search()) { ?>
jQuery('#toggle_options').css('cursor','pointer')
.click(
function() {
// Toggle the class on the item toggling the hidden content
jQuery(this).prev('div').toggleClass('hide');
jQuery(this).prev('div').toggleClass('show');
}
);
<?php } ?>
Just to give you an idea of what some basic jQuery may look like in the file...
I'm using 2.8.4 ...
NOTE: There is a conflict when loading jQuery tools externally alongside the above though. I don't use jQuery tools now, but i did have it for something else previously and happened to notice the problem, so felt it worth a mention "just incase".