// JavaScript Document

// a more general method, allowing for variation in filenames
function selectPicBetter() {
  // create an array of all possible images
  var picArray = new Array('rose1.jpg','rose2.jpg','rose3.jpg'); 
  // select a random num between 0 and length of the array
  var randomNum = Math.floor(Math.random() * picArray.length);
  // assign a random array entry to the src of the image 
  document.getElementById("pic").src = picArray[randomNum]; 
}