You can use the function in the example you have given, you will just need to pass in the correct image path for both images, rather than just changing the file name.
$(function() {
$("img")
.mouseover(function() {
$(this).attr("src", "fullImageUrl/whateverOver.gif");
})
.mouseout(function() {
$(this).attr("src", "fullImageUrl/whatever.gif");
});
});