// Returns a random integer between min and max
// Using Math.round() will give you a non-uniform distribution!
function getRandomInt(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

// function that positions and sets up pony
function doPony() {
  // list of poses
  var poses = [
    {src: 'grazing-left.png', width: 200, height: 132},
    {src: 'grazing-right.png', width: 200, height: 132},
    {src: 'walking-left.png', width: 207, height: 132},
    {src: 'walking-left.png', width: 207, height: 132}/*,
    {src: 'standing-left.png', width: 188, height: 132},
    {src: 'standing-right.png', width: 188, height: 132}*/
  ];
  
  var ponyImg = document.getElementById('pony');
  var ponyData = poses[getRandomInt(1, poses.length) - 1];
  
  ponyImg.style.marginLeft = getRandomInt(1, 360) + 'px';
  ponyImg.src = '/archive/journal/wp-content/themes/isolated-pony/ponies/' + ponyData.src;
  ponyImg.style.width = ponyData.width + 'px';
  ponyImg.style.height = ponyData.height + 'px';
}