var playlist = [
	// object {url:string url, title:string title, artist: string artist]
	// or
	// string url
	{url:'http://www.labrador.se/overandover/mp3_ab/01_You_won.mp3',title:'1. You Won',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/02_Seconds_away.mp3',title:'2. Seconds Away',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/03_Always_the_same.mp3',title:'3. Always The Same',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/04_Monday_to_Saturday.mp3',title:'4. Monday To Saturday',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/05_Heartbeats.mp3',title:'5. Heartbeats',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/06_Dancefloor.mp3',title:'6. Dancefloor',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/07_Turn_away.mp3',title:'7. Turn Away',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/08_Recife.mp3',title:'8. Recife',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/09_Over_and_over.mp3',title:'9. Over And Oover',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/10_Jump.mp3',title:'10. Jump',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/11_Something_strange_will_happen.mp3',title:'11. Something Strange Will Happen',artist:'The Legends'},
	{url:'http://www.labrador.se/overandover/mp3_ab/12_Touch.mp3',title:'12. Touch',artist:'The Legends'}

];

var player = new SoundPlayer({
	autostart:true,
	playlist:playlist,
	seekbarSpcStyle: {'position':'relative','background-color':'#fff','height':'3px','width':'100%','margin-top':'4px','overflow':'hidden'},
	seekbarStyle: {'position':'absolute','background-color':'#d8d6d3','height':'3px','width':'0%','cursor':'pointer','z-index':'10'},
	positionStyle: {'position':'absolute','left':'0%','width':'3px','height':'3px','background-color':'#f2f0ec','z-index':'15'}
});

player.addEvent('ready', function() {
	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.artist + ' - ' + track.title,
			'styles':{'cursor':'pointer'},
			'events':{
				'click': function(){
		        	allSoundKeys = this.sounds.getKeys();
					sound = this.sounds.get(track.url);
					this.currentKey = allSoundKeys.indexOf(track.url);
					this.currentSound = sound;
					this.playCurrentSound();
		        }.bind(this)
			}
		}).inject(tmpLi);;
	},this);
	mainUl.inject($('soundplayer_playlist'));
});
