It can be very complicated or very simple - the easiest one I know is this:
Look for imageswap.zip in the downloads folder on your CD or download the html and two images here:
http://osprey.unisa.ac.za/toby/vdyktj/imageswap.zip
<html>
<head>
<title>Random Images</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
image1 = new Image();
image1.src = "red.gif";
image2 = new Image();
image2.src = "yellow.gif";
// End -->
</script>
</head>
<body>
<h1>Stroke the square</h1>
<a href="imageswap.htm"
onmouseover="image2.src='yellow.gif';"
onmouseout="image2.src='red.gif';">
<img name="image2" src="red.gif" border=0></a>
</body>
</html>