
MinimalAudioPlayer = new Class({
  $audio: null,
  initialize: function($control, $audio)
  {
    /*alert($control);
    alert($audio);*/

    //-- fallback flash
    /*if (!document.createElement('audio').canPlayType)
    if (true)
    {

      swfobject.embedSWF("js/invisible-player.swf", "flash_audio_player", "1", "1", "9.0.0", null, {
        src: "medias/01-La-vie-en-rose.mp3",
        autoplay: true
      }, {}, {});


      $control.addEvent('click', function(e) {
        alert('lala : ' + $('flash_audio_player'));
        if (this.hasClass('stopped'))
        {
          $('flash_audio_player').play();
          this.removeClass('stopped');
        }
        else
        {
          $('flash_audio_player').pause();
          this.addClass('stopped');
        }
        e.preventDefault();
      })
    }
    else
    {*/
      $control.addEvent('click', function(e) {
        if ($audio.paused)
        {
          $audio.play();
          this.removeClass('stopped');
        }
        else
        {
          $audio.pause();
          this.addClass('stopped');
        }
        e.preventDefault();
      });
    //}

    this.$audio = $audio;

  }
});
