soundManager.url = jsDirectory + "/soundmanager2";

soundManager.onload = function() {
  $("a[href$='.mp3']").each(function(link) {
    var link = this;
    this.sound = soundManager.createSound({
      id: this.text,
      url: this.href,
      onfinish: function() {
        link.style.color = "red";
      }
    });
    this.sound.onfinish = function() {
      
    };
  }).click(function(evt) {
    evt.preventDefault();
    this.sound.togglePause();
    var color = (this.style.color == "green") ? "red" : "green";
    this.style.color = color;
  });
};