Avoiding repitition

Avoiding repitition

Hi everyone. I'm pretty new to javascript and I can get the following example to work but repeating it over and over seems senseless. What am I missing?
  1. <img src=/images/map/1.png class="rm1" />
  2. <img src=/images/map/2.png class="rm2" />

  3. <ul>
  4.       <li class='rm1'><a href="">Room 1</a></li>
  5.       <li class='rm2'><a href="">Room 2</a></li>
  6. </ul>

  7. <script>
  8.       jQuery(document).ready(function(jQuery){
  9.             jQuery('.rm1').hover(
  10.                   function(){ jQuery('.rm1').addClass('show') },
  11.                   function(){ jQuery('.rm1').removeClass('show') }
  12.                   )
  13.             }); 
  14.       jQuery(document).ready(function(jQuery){
  15.             jQuery('.rm2').hover(
  16.                   function(){ jQuery('.rm2').addClass('show') },
  17.                   function(){ jQuery('.rm2').removeClass('show') }
  18.                   )
  19.             }); 
  20. </script>

I use it so I can have a list of links and a map. All the map elements are hidden until I hover over the link.

Unfortunately it works, but I can't stand to look at it (I know its inefficient).

OK, time to poke fun at the new kid.