Image changing problem

Image changing problem

I have problem with this script. It should change images according to on which link you hover. I suppose it is written good and I have no idea why it doesn't work ..
  1. $(document).ready(function() {
  2.     $(".byt").bind("mouseenter",function() {
  3.          stary_byt = $("#patro").attr("src");
  4.          novy_byt = $(this).attr("id");
  5.         $("#patro").attr({src : "patra/"+novy_byt+".gif"});
  6.     }).bind("mouseleave",function() {
  7.         $("#patro").attr({src : stary_byt});
  8.     });
  9. });