Problem passing old javascript obtrusive function to jquery

Problem passing old javascript obtrusive function to jquery

I have some images like this:
<a href="#" onclick="showPics('new_car', 'h')"><img src="images/new_car.jpg" width="150" height="224" alt="My new car" title="My new car" border="0"/></a>

The function:
function showPics(target, position)
{
   $('#foto_frame').show();
   if(position == 'v')
   {
      $('#foto_frame').html("<img src='images/full/"+target+".jpg' width='286' heigth='428'>");
   }
   if(position == 'h')
   {
      $('#foto_frame').html("<img src='images/full/"+target+".jpg' width='640' heigth='428'>");
   }
}

The only way I wonder it may work is this:
<a href="#" id="new_car" width="150" height="224" alt="My new car" title="My new car" border="0"/></a>

And then:
$('document').ready(function()
{
          $("#new_car").click(function(event)
   {
       showPics('new_car', 'h');
   });
});

Is this the smartest way to achieve it or is there any more functional solution?