var movingpic = null; // object

function doMove() {
  bottom_px = parseInt(movingpic.style.bottom);
  height_px = parseInt(movingpic.style.height);
  if (parseInt(movingpic.style.bottom) > 170){
    bottom_px = -99;
    movingpic.style.height = '1px';
    height_px = 1;
  }
  if (parseInt(movingpic.style.height) < 101){movingpic.style.height = height_px+2+'px'}
  movingpic.style.bottom = bottom_px+1+'px';
  setTimeout(doMove,100); // call doMove in 20msec
}

function init() {
  movingpic = document.getElementById('movingPicture'); // get the "foo" object
  movingpic.style.bottom = '-99px'; // set its initial position
  movingpic.style.height = '1px';
  doMove(); // start animating
}


window.onload = init;
