		var lst_extraits = new Array;
		var ptr_extraits,nbr_extraits;
		var timerDefilementPlayer;
		var leftPlayer;
		// ajout patrice 12/1/7
		var timeoutActif = null;
		// fin ajout patrice 12/1/7
			var PlayerOrig_x=-1;
			var PlayerOrig_y=-1;
			var temp_pos;
			
		function extraits() {
			ptr_extraits=0;
  			nbr_extraits = arguments.length;
  			lst_extraits.length=0;
  			for (var i = 0; i < nbr_extraits; i++)
      		{
    			lst_extraits[i] = arguments[i];
      		}
      		extrait_suivant();	
		}
		
		function extrait_suivant() {
			// Si on a encore au moins deux arguments dans la liste on lance l ?coute
			if(ptr_extraits<=(nbr_extraits-2)) {
				extrait(lst_extraits[ptr_extraits++],lst_extraits[ptr_extraits++]);
			}
			// Si il reste encore des arguments apr?s ca on relance le timer
			if(ptr_extraits<nbr_extraits) {
				
				// modif patrice 12/1/7
				//setTimeout("extrait_suivant()",25000);
				clearTimeout(timeoutActif);
				timeoutActif = setTimeout("extrait_suivant()",28000);
				// fin modif patrice 12/1/7
				
			}
		}
		
		function extrait(id,key) {
			// Fonction Javascript qui lance l'?coute des extraits
			var url_extrait;
			var divplayer,divcourant;
			
			
			//if (document.timerDefilementPlayer){
				clearTimeout(timerDefilementPlayer);
				leftPlayer=5;
			//}

			url_extrait="http://" + ServerName + "/extrait" + id + "-" + key + ".mp3";

			// ici on peut afficher qqchose (un bouton, une jaquette ...)		
			//divcourant=document.getElementById("jaquette");
			//divcourant.style.visibility='visible';
			
			if(window.maj_infos_titre)
				maj_infos_titre(id);
			
			eval('domElement=' + window.divplayer); // + ';domElement.innerHTML=window.PlayerHTML.replace("#MP3#", url_extrait);');			
			domElement.innerHTML=window.PlayerHTML.replace('#MP3#', url_extrait);
}

		/**
		 * Fonction appel?e par le player flash lors de son ?v?nement 
		 * StopRelease (bouton stop relach?).
		 */
		function player_mp3_onStopRelease() {
			clearTimeout(timeoutActif);
			//if (document.timerDefilementPlayer)
			clearTimeout(timerDefilementPlayer);
			leftPlayer=5;
			if  (window.maj_infos_titre)
			document.getElementById("infosPlayer").style.left = leftPlayer + "px";
		}
		
		/**
		 * Fonction appel?e par le player flash lors de son ?v?nement 
		 * PauseRelease (bouton stop relach?).
		 */
		function player_mp3_onPauseRelease() {
			clearTimeout(timeoutActif);
			//if (document.timerDefilementPlayer)
			clearTimeout(timerDefilementPlayer);
			leftPlayer=5;
			if  (window.maj_infos_titre)
			document.getElementById("infosPlayer").style.left = leftPlayer + "px";
		}
		
		/**
		 * Fonction appel?e par le player flash lors de son ?v?nement 
		 * PlayRelease (bouton play cliqu?).
		 * Pour le moment, cette fonction n est pas g?r?e
		 */
		function player_mp3_onPlayRelease(restant) {
			clearTimeout(timeoutActif);
			timeoutActif = setTimeout("extrait_suivant()",restant);
			var taille = window.document.getElementById("infosPlayer").innerHTML;
			if ((taille.length >= 27) && (window.maj_infos_titre)){
				leftPlayer=5;
				document.getElementById("infosPlayer").style.left = leftPlayer + "px";
				var sizeInfo = 5*(taille.length);
				scrollwindowPlayer("droite",sizeInfo);
			}
		}

		var lst_trailers = new Array;
		var ptr_trailers,nbr_trailers;
		var VtimeoutActif = null;
		var img_url="";
		var fmt_trailers="flash";
		var trailers_target="_blank";
		
		function trailers() {
			ptr_trailers=0;
  			nbr_trailers = arguments.length-3;
  			lst_trailers.length=0;
  			img_url=arguments[nbr_trailers];
  			fmt_trailers=arguments[nbr_trailers+1];
  			trailers_target=arguments[nbr_trailers+2];
  			
  			for (var i = 0; i < nbr_trailers; i++)
      		{
    			lst_trailers[i] = arguments[i];
      		}
      		trailer_suivant();	
		}
		
		function trailer_suivant() {
			// Si il nous reste encore une paire id / key on lance le trailer
			if(ptr_trailers<=(nbr_trailers-2)) {
				trailer(lst_trailers[ptr_trailers++],lst_trailers[ptr_trailers++]);
			}
			// Si il y a encore des arguments on relance le timer
			if(ptr_trailers<nbr_trailers) {
				clearTimeout(VtimeoutActif);
				VtimeoutActif = setTimeout("trailer_suivant()",60000);
			}
		}
		
		function DelPopupTrailer(){
			var theDiv;
			theDiv=document.getElementById('trailer_popup'); 
			if(theDiv){
				//thePlayer=document.getElementById('trailer_flash_object');
				//if(!thePlayer)
				//	thePlayer=document.getElementById('trailer_flash_ctrl');
				//if(thePlayer)
				//	thePlayer.SetVariable("player:jsStop", ""); // Pour faire STOP
				theDiv.parentNode.removeChild(theDiv);
			}
		}
		
		function ClosePopupTrailer(){
			thePlayer=document.getElementById('trailer_flash_object');
			if(!thePlayer)
				thePlayer=document.getElementById('trailer_flash_ctrl');
			thePlayer.SetVariable("player:jsStop", ""); // Pour faire STOP
			theDiv=document.getElementById('trailer_popup'); 
			theDiv.parentNode.removeChild(theDiv);
			return false;
		}
		
		function trailer(id,key) {
			// Fonction Javascript qui lance le trailer
			var url_trailer;
			var divtrailer,divcourant;
  			if(trailers_target!="_blank")
  				divtrailer=document.getElementById(trailers_target);
  			else {
  				if(!(divtrailer=document.getElementById("trailer_popup_body"))){
  					popuptraildiv=document.createElement('div');
  					popuptraildiv.id="trailer_popup";
  					popuptrailhead=document.createElement('div');
  					popuptrailhead.id="trailer_popup_head";
  					popuptrailbody=document.createElement('div');
  					popuptrailbody.id="trailer_popup_body";
  					popuptrailclosebox=document.createElement('div');
  					popuptrailclosebox.id="trailer_popup_close_box";
  					popuptrailcloseanc=document.createElement('a');
  					popuptrailcloseanc.id="trailer_popup_close_anc";
  					popuptrailcloseanc.innerHTML="X";
  					popuptrailcloseanc.onclick=ClosePopupTrailer;
  					popuptrailcloseanc.href="#";
  					popuptrailclosebox.appendChild(popuptrailcloseanc);
 					popuptrailhead.appendChild(popuptrailclosebox);
  					popuptraildiv.appendChild(popuptrailhead);
  					popuptraildiv.appendChild(popuptrailbody);
  					document.body.appendChild(popuptraildiv);
  					//new Draggable('trailer_popup');
  					divtrailer=document.getElementById("trailer_popup_body");
  				}
  			}
			url_trailer="http://" + ServerName + "/trailer" + id + "-" + key + ".flv";

			if(fmt_trailers=="flash"){
				divtrailer.innerHTML=TrailerHTML.replace('#FLV#', url_trailer).replace('#JPG#', img_url);
			}else{
				divtrailer.innerHTML="<object classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6' id='MediaPlayer' name='MediaPlayer' type='application/x-oleobject' viewastext='' standby='Loading Microsoft Windows Media Player components...' height='200' width='250'><param name='url' value='" + url_trailer + ".wmv'><param name='enabled' value='true' /><param name='defaultframe' /><param name='enablecontextmenu' value='true' /><param name='stretchtofit' value='true' /><param name='windowlessvideo' value='true' /><param name='autostart' value='true' /><param name='ShowPositionControls' value='False' /><param name='uimode' value='mini' /><param name='volume' value='30' /><embed src='" + url_trailer + ".wmv' type='application/x-oleobject' height='200' width='250' ShowPositionControls='0' ></object>";
			}
		}
		
		/**
		 * Fonction appel?e par le player flash lors de son ?v?nement 
		 * 'StopRelease' (bouton stop relach?).
		 */
		function trailer_flv_onStopRelease() {
			clearTimeout(VtimeoutActif);
		}

