jQuery Functions

jQuery Functions

Hi Guys,

I'm relatively new to jQuery however i am struggling at the moment with a function to allow me to use a script across my site for toggling things. My code (below) does not seem to run the instructions. Please would you mind ponting out where i am going wrong with this script. Thanks

James

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="jquery-1.3.1.js"></script>
<script>
$(document).ready(function() {
   function toggleme(whichthing) {
   $("#msg").click(function() {
      $(whichthing).toggle("slow");
   });
   }
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
<button id="msg" onclick="toggleme("#para")">Toggle</button>
<p id="para" style="display:none;">A Message that will be toggled</p>
</body>
</html>