var playlist = [
	// object {url:string url, title:string title, artist: string artist]
	// or
	// string url
	{url:'raygunnradio.mp3',title:'Ray Gunn Radio',artist:'The Franks'}
	
];

var player = new SoundPlayer({
	playlist:playlist,
	swfLocation:"scripts/SoundPlayer.swf",
	controlImages:{previous:"images/player/previous.png",next:"images/player/next.png",play:"images/player/play.png",pause:"images/player/pause.png"},
	seekbarSpcStyle: {'position':'relative','background-color':'#3A2936','height':'2px','width':'270px','margin-top':'4px','overflow':'hidden'},
	seekbarStyle: {'position':'absolute','background-color':'#996666','height':'2px','width':'0%','cursor':'pointer','z-index':'10'},
	positionStyle: {'position':'absolute','left':'0%','width':'2px','height':'2px','background-color':'#000','z-index':'15'}
});

player.addEvent('ready', function() {
	$('soundplayerspc').getElement('div.title').set('html','&nbsp;');
	
	var mainUl = new Element('ol',{'styles':{'padding':0,'margin':0,'list-style-type':'decimal-leading-zero'}}).inject(this.controls);
	this.options.playlist.each(function(track,index) { 
		var tmpLi = new Element('li',{'styles':{'list-style-position':'inside'}}).inject(mainUl);
		var tmpSpan = new Element('span',{
			text:track.title,
			'styles':{'cursor':'pointer'},
			'events':{
				'click': function(){
					if (this.currentSound) {
						this.stopCurrentSound();
					}
		        	allSoundKeys = this.sounds.getKeys();
					sound = this.sounds.get(track.url);
					this.currentKey = allSoundKeys.indexOf(track.url);
					this.currentSound = sound;
					this.currentSound.sound.position = 0;
					this.playCurrentSound();
		        }.bind(this)
			}
		}).inject(tmpLi);;
	},this);
	mainUl.inject($('soundplayer_playlist'));
});
