Need Help with Image Replacement Script

Need Help with Image Replacement Script

I am trying to make a Picture Gallery Page. On the left is a 5 x 7 set of thumbnail pictures and on the right is room for a full size image. By clicking on one of the thumbnails, I want the full size version to get placed into the right area. I am having some problems with what to code as my script.

The page is laid out as follows:

  1. <table border="5" width="1000px" cellspacing="5" cellpadding="5" rules="all" align="center" frame="border">
  2.             <tr>
  3.                 <td  width="100px">
  4.                     <a class='thumb' href="#"><img src="thumbs/t1.jpg" alt="" />
  5.                 </a></td>
  6.                 <td  width="100px">
  7.                     <a class='thumb' href="#"><img src="thumbs/t2.jpg" alt="" />
  8.                 </a></td>
  9.                 <td  width="100px">
  10.                     <a class='thumb' href="#"><img src="thumbs/t3.jpg" alt="" />
  11.                 </a></td>
  12.                 <td  width="100px">
  13.                     <a class='thumb' href="#"><img src="t4.jpg" alt="" />
  14.                 </a></td>
  15.                 <td  width="100px">
  16.                     <a class='thumb' href="#"><img src="thumbs/t5.jpg" alt="" />
  17.                 </a></td>
  18.                 <td rowspan="7" width="500px">
  19.                      <img src="images/p1.jpg" alt="" id="image" width="500" />
  20.                  </td>
  21.             </tr>
  22.             6 more sets of <tr>....</tr>
  23.          </table>

and the script that I trying to get right is:

  1. $(document).ready(function() {
  2. $(".thumb").click() {
  3. var field  = $(this).find("img");
  4. var image = $("#image");
  5. $src=field.attr("src");
  6. $jpg=split($src,6);
  7. $src="images"+$jpg;
  8. image.attr("src",$src);
  9. }); // end click
  10. }); // end ready

I am obviously doing something wrong with the select or something. The intent is to identify the thumbnail being clicked on, get its src and change the thumb/x.jpg to images/x.jpg and use that as the src of of the id="image" img tag).