Hey,
i was pulling my hair out with this for a while.
I've been using custom JavaScript sideshows etc in my sites, but they stop working on pages with "image gallery" or "userdefinedforms" etc.
anyway, the solution was the JavaScript libraries conflicting with the use of "$"
putting this as the very end of my code solved it:
<script>
jQuery.noConflict();
jQuery(document).ready(function($){
$("#example").autocomplete();
});
</script>
I hope this helps others!