This is where you need to learn more about CSS and JavaScript. :)
The script that you have looks like it should work, but it's also very messy and really hard to understand. What I've done below is a lot more elegent (I think anyway), and it keeps things easy to read and understand. Well, as easy as they can be for this anyway.
<img id="image1" src="image1.jpg" width="150" height="150" />
<script type="text/javascript">
jQuery (document).ready (function () {
var image_1 = jQuery ("#image1");
image_1.mouseover (function () {
this.src = "image2.jpg";
});
image_1.mouseout (function () {
this.src = "image1.jpg";
});
});
</script>
I've tested this and it works perfectly. You just need to have the two image files in the same folder s this and it will do what you want it to. Of coruse you can always modify it to point to where ever your image files are.