window.popupExists=false;
window.titreCourant="";
window.titreTimerCompteur=0;
window.volume=100;
var timer=setInterval("mettre_ouvrir()",2000);

function mettre_ouvrir()
	{
	time=new Date();
	if (time.getTime()-document.player.time.value>5000)
		{
		document.getElementById("lecture").style.display='none';
		document.getElementById("ouverture").style.display='block';
		}
	}

function mettre_lecture()
	{
	document.getElementById("lecture").style.display='block';
	document.getElementById("ouverture").style.display='none';
	}

function ouvrirPlayer()
	{
	if (window.popup==undefined)
		{
		window.popup=open('../player/player.php','player',"Height=150,Width=350,scrollbars=no, resizable=no",false);
		}
	window.popupExists=true;
	}

function suivantPlayer()
	{
	window.popup.callAS3('next');
	}

function lecturePlayer()
	{
	window.popup.callAS3('play');
	document.getElementById("play").style.display='none';
	document.getElementById("stop").style.display='block';
	}

function stopPlayer()
	{
	window.popup.callAS3('stop');
	document.getElementById("play").style.display='block';
	document.getElementById("stop").style.display='none';
	clearInterval(window.titreTimer);
	document.player.titre_aff.value=window.titreCourant;
	window.titreCourant="";
	}

function changementMsg(msg)
	{
//	if (document.getElementById("message").innerHTML.value==msg)
//		{
		document.getElementById("message").innerHTML=msg;
//		}
	}

function changementDuree(duree)
	{
	document.player.duree_aff.value=duree;
	}

function changementTitre(titre)
	{
	if (window.titreCourant!=titre)
		{
		window.titreTimerCompteur=0;
		window.titreCourant=titre;
		window.titreTimer=setInterval("defileur()",500);
		}
	}

function defileur()
	{
	string="                                          "+window.titreCourant;
	if (window.titreTimerCompteur>string.length)
		{
		window.titreTimerCompteur=0
		}
	window.titreTimerCompteur++;
	document.player.titre_aff.value=string.substr(window.titreTimerCompteur,string.length-window.titreTimerCompteur);
	}


function calledFromAs32(volume)
	{
	window.volume=volume;
	window.popup.callAS3('louder'+Math.round(volume))
	}

function callAS32(var2pass)
	{
	if (var2pass!=window.volume)
		{
		if(navigator.appName.indexOf("Microsoft") != -1)
			{
				jsAS32.calledFromJs(var2pass);
			}
			else
			{
				window.document.jsAS32.calledFromJs(var2pass);
			}
		}
	}
