Prova questo:
Codice PHP:
<html>
<head><title>Using more DOM</title>
<script type="text/javascript">
var pimg = new Array('uno0.gif','uno1.gif','uno2.gif');
function changeImage(target)
{
var ran = Math.floor(pimg.length * Math.random());
var newsImg=document.createElement('img');
newsImg.setAttribute("src", pimg[ran]);
target.appendChild(newsImg);
}
window.onload= function()
{
var target= document.getElementById('boxImg');
changeImage(target);
}
</script>
</head>
<body>
<div id="boxImg"></div>
</body>
</html>

PS.
Benvenuto nel forum