var currentlyPlaying = null;
function play(element) {
  player = document.getElementById('player');

  if ( currentlyPlaying ) {
    currentlyPlaying.src = '/images/play.png';
    player.sendEvent('STOP');
  }
  if ( currentlyPlaying != element ) {
    element.src = '/images/stop.png';
    currentlyPlaying = element;
    player.sendEvent('LOAD', '/sample/amazon/' + element.id);
    setTimeout("player.sendEvent('PLAY', 'true')", 2000);
    currentlyPlaying = element;
  } else {
    currentlyPlaying = null;
  }

  return false;
}
