给你些代码参考一下,剩下的工作自己做吧
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/javascript">
  function hover(obj){
  alert(obj.id);
          home.src = "img/menuHomeSwap.jpg";
}
  </script>
</head><body>
<table border="0" cellspacing="0" cellpadding="0">
 <tr>
   <td width="74"><img id="home" src="img/menuHome.jpg" width="74" height="40" onMouseOver="hover(this)"></td>
   <td width="74"><img id="sp" src="img/menuSP.jpg" width="74" height="40" onMouseOver="hover(this)"></td>
 </tr>
</table>
</body>
</html>

解决方案 »

  1.   

    <script language="JavaScript" type="text/javascript">
      function hover(pic){
              home.src = pic
    }
      </script>// pic 为图片的路径
      

  2.   

    <img src="1.gif" pic1="1.gif" pic2="2.gif" style="cursor:hand" onmouseover="javascript:this.src=this.pic2;" onmouseout="javascript:this.src=this.pic1">
    <img src="3.gif" pic1="3.gif" pic2="4.gif" style="cursor:hand" onmouseover="javascript:this.src=this.pic2;" onmouseout="javascript:this.src=this.pic1">