// JavaScript Document
window.addEvent('domready',function(){
  $$('.mp3-player').each(function(container){
    links = container.getElements('a');
    params = new Hash();
    params['count'] = 0;
    params['movie'] = 'http://flash-mp3-player.net/medias/player_mp3_multi.swf';
    params['FlashVars'] = 'mp3=';
    params['title'] = '&title='
    links.each(function(a){
      
      if(this['count'] > 0){ this['FlashVars'] += '|';this['title'] += '|';}
      this['FlashVars'] += a.getAttribute('href');
      this['title'] += a.get('text');
      this['count']++;
    }.bind(params));
    //alert(params['FlashVars']);
    
    player = new Swiff(params['movie'], { 
      'width' : 200,
      'height': 100,
      'params': {
        'bgcolor':'#220000',
        'FlashVars': params['FlashVars']+params['title'],
      
      }
    });
    links.destroy();
    container.empty();
    player.inject(container);
    
  
  });
});
