function PreloadImages(prefix, images) { for (var i = 0; i < images.length; i++) { new Image().src = prefix + images[i]; } } function PreloadImagesDOM(prefix, images, element_id) { var elem = document.getElementById(element_id); if(elem){ for (var i = 0; i < images.length; i++) { var img = document.createElement('img'); img.style.border = "none"; img.src = prefix + images[i]; img.width = 1; img.height = 1; elem.appendChild(img); } } } function PreloadImagesDOMFinish(element_id) { var elem = document.getElementById(element_id); if(elem) elem.innerHTML = ''; }