script help

script help

I'm just starting wiht JQuery an dfound this script for a menu navigation that I like but the script is not formed well and I get an error with the $ at the beggining. Any help to make this right would be appreciated. The error is $is undefined. Can’t see to past the code in very well. Thanks

  1. <script type="text/javascript">
  2. $(function () {
  3. $('.dropdown').mouseenter(function () {
  4. $('.sublinks').stop(false, true).hide();
  5. var submenu = $(this).parent().next();
  6. submenu.css({
  7. position: 'absolute',
  8. top: $(this).offset().top + $(this).height() + 'px',
  9. left: $(this).offset().left + 'px',
  10. zIndex: 1000
  11. });
  12. submenu.stop().slideDown(300);
  13. submenu.mouseleave(function () {
  14. $(this).slideUp(300);
  15. });
  16. });
  17. });
  18. </script>