One of the first keys to your success here is to separate the JavaScript from your HTML content.
The easiest way to do this is to give the image a unique identifier so that the script can then easily refer to that image tag. This can be later on removed depending on how the rest of the your images are structured.
<img id="hover" src="uploads/products/thumbs/glamorous-6989-63824-1-catalog.jpg" />
Each of those online events gets assigned to a function, so this will result in the same existing behavior, with the ability to extend things to achieve better flexibility.
var img = document.getElementById('hover');
img.onmouseover = function () {
this.src = 'uploads/products/thumbs/1532687679back_dt_0045.jpg';
};
img.onmouseout = function () {
this.src = 'uploads/products/thumbs/glamorous-6989-63824-1-catalog.jpg';
};
Since it’s preferable to keep things like image links in with the content, we can easily make the script more generic by using some data tags on the image.
<img id="hover" src="uploads/products/thumbs/glamorous-6989-63824-1-catalog.jpg" data-hover="uploads/products/thumbs/1532687679back_dt_0045.jpg" />
We can now have the script set a data-image value so that it can easily switch back to the original image when the mouseout event occurs, which allows the script to switch the image now without needing to have any URL links in the script.
var img = document.getElementById('hover');
img.setAttribute('data-image', img.src);
img.onmouseover = function () {
this.src = this.getAttribute('data-hover');
};
img.onmouseout = function () {
this.src = this.getAttribute('data-image');
};
This is now a technique that can be applied for multiple images.
Where we go from here though depends on what is meant by:
Are you wanting to setup several images so that only the one that you hover over is the image that changes?
or, are you wanting to hover over an image and have several other images change at the same time?