-Give the popup a css property of display: none.
-Grab a reference to the element you want to use to activate the popup onhover.
-When it's hovered on set the popup to display: block
-Then from here you need to grab a reference to your close link.
-When the close link is clicked upon set the popup to display: none
So taking your close link as an example it might be easiest to give it an id:
<img id="close" src="imageurl.gif" alt="close popup" />width="xx" height="xx"
var closeLink = document.getElementById('close')
See how you get on with this and come back if you're stuck