var images = [];



function switchImage(imgName, newImg){
  document[imgName].src = images[newImg].src;
  document[imgName].width = images[newImg].width;


}

function preload(imgName, imgUrl, width, height){
  images[imgName] = new Image(width, height);
  images[imgName].src = imgUrl;
}

