function randomNum(lim)
{
  return Math.floor(Math.random()*lim);
}

function randomImage(theimages)
{
  r=randomNum((theimages.length));
  source=theimages[r][0];
  href=theimages[r][1];
  document.write('<a href="'+href+'"><img src='+source+'></a>');
}

