<script>
var snd1 = new Audio("swish.mp3"); //1
$(document).ready(function(){ //2
$("#img").mouseover(function(){ //3
var dWidth = $(document).width() - 100, // 100 = image width
dHeight = $(document).height() - 100, // 100 = image height
nextX = Math.floor(Math.random() * dWidth),
nextY = Math.floor(Math.random() * dHeight);
$(this).animate({ left: nextX + 'px', top: nextY + 'px' });
snd1.play(); //4
snd1.currentTime=0; //5
});
});
</script>
1 the first line creates a JS audio object
2 the document.ready part wait until the DOM is created to set up your event listener
3 The mouseover function works as expected - sets a mouseover event listener on #img
4 .play() plays the sound
5 .currentTime=0 re-queues the sound to the beginning for next use