﻿soundManager.url='swf/';soundManager.debugMode=false;soundManager.waitForWindowLoad=true;soundManager.onerror=function(){	document.getElementById("tagid3").innerHTML="<i>Lecture indisponible</i>";};var playlist=[];var current=0;var act_vol=soundManager.defaultOptions.volume;var loop="none";var next=false;var prev=false;var imgButtonPlay="png/play.png";var imgButtonPause="png/pause.png";var imgButtonStop="png/stop.png";var statusStopped = "<i>Lecture arr&ecirc;t&eacute;e</i>";var statusPlaying = "<i>Lecture...</i>";soundManager.onload=function(){	var vol=document.getElementById("volume");	var list=document.getElementById("playlist").getElementsByTagName("a");	for(var i=0;i<list.length;i++){		list[i].rel=i;		var sp=document.createElement("span");		list[i].parentNode.insertBefore(sp,list[i]);		list[i].onclick=function(){			soundManager.stopAll();			current=this.rel;			lire_current();			return false;		};		(function(titre){			playlist[i]=soundManager.createSound({				id:"piste"+i,				url:list[i].href+".mp3",				onstop:function(){					playlist[current].unload();					},				onfinish:function(){					playlist[current].unload();					if(!prev&&!next){						if(loop=="one"){							lire_current();						}else if(loop=="all"){								bouton_next();							}else{								if(current<playlist.length-1){									bouton_next();								}else{									current=0;								}							}						}					},				onid3:function(){					var chaine_tag="";					if(this.id3["songname"]){						chaine_tag+=" "+this.id3["songname"]+" ";					}					document.getElementById("tagid3").innerHTML=chaine_tag;					}				});			})(list[i]);}}function lire_current(){	soundManager.stopAll();	playlist[current].setPosition(0);	playlist[current].setVolume(act_vol);	playlist[current].play();	document.getElementById("play").src=imgButtonStop;	document.getElementById("play").title="Stop";}function bouton_play(){	if(playlist[current].playState){		playlist[current].stop();		document.getElementById("play").src=imgButtonPlay;		document.getElementById("play").title="Lecture";		document.getElementById("tagid3").innerHTML=statusStopped;	}else{		lire_current();		document.getElementById("play").src=imgButtonStop;		document.getElementById("play").title="Stop";		document.getElementById("tagid3").innerHTML=statusPlaying;	}}function bouton_stop(){	playlist[current].stop();	document.getElementById("play").src=imgButtonPlay;	document.getElementById("play").title="Lecture";	document.getElementById("tagid3").innerHTML=statusStopped;}function bouton_next(){	next=true;	current++;	if(current>=playlist.length){		current=0;	}	document.getElementById("tagid3").innerHTML=statusPlaying;	lire_current();	next=false;}
