When the page loads, use an onload function to fade in the images, taking the id of the div as a parameter. So something like this:
function initImage(elementId) {
image = document.getElementById(elementId);
setOpacity(image, 0);
image.style.visibility = 'visible';
fadeIn(imageId,0);
}
Then you would create a new function something like the following:
function fadeImage(){
initImage(element1);
initImage(element2);
initImage(element3);
}
Then your onload function call becomes this:
window.onload = function() {fadeImage()}
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdo
m will come to you that way" - Christopher Hitchens