var ap_instances = new Array();

function ap_stopAll(playerID) {
  for (var i = 0; i < ap_instances.length; i++) {
    try {
      if (ap_instances[i] != playerID) {
        document.getElementById('audioplayer' + ap_instances[i].toString()).SetVariable('closePlayer', 1);
      } else {
        document.getElementById('audioplayer' + ap_instances[i].toString()).SetVariable('closePlayer', 0);
      }
      
    } catch (errorObject) {
    }
  }
}

function ap_registerPlayer(playerID) {
  if (playerID.indexOf('audioplayer') == 0) {
    ap_instances[ap_instances.length] = playerID.substring(11, playerID.length);
  }
}

