var imgArray = new Array( "", "", "", "", "", "" ); var imageFile = imgArray[Math.floor(Math.random()*6)]; document.write(imageFile);