function onPlay()
{
	if((NSPlay.ReadyState==4) && (NSPlay.PlayState==0)) {
		try { 
			NSPlay.Play();	
		} catch(error) {
			window.setTimeout('NSPlay.Play();',1000);
		}
		
	}
	changement_status("lecture");
} 
 
function onStop()
{ 
	if((NSPlay.ReadyState==4) && (NSPlay.PlayState==2)) {
		NSPlay.Stop();
		
	}
} 
 
function onPause()
{
	if((NSPlay.ReadyState==4) && (NSPlay.PlayState==2)) NSPlay.Pause();
} 
 
function onMute()
{
	if((NSPlay.ReadyState==4) && (NSPlay.PlayState==2)) {
		if (NSPlay.Mute == true)
		{
			NSPlay.Mute = false;
		}
		else
		{
			NSPlay.Mute = true;
		}
	}
} 
 
function onSetVolume(value) { NSPlay.Volume = value; } 
function onVolumeUP() { if (NSPlay.Volume+200<=0) NSPlay.Volume = NSPlay.Volume + 200; else NSPlay.Volume=0; changeVolumeImage(NSPlay.Volume)} 
function onVolumeDOWN() { if (NSPlay.Volume-200>=-4000) NSPlay.Volume = NSPlay.Volume - 200; else NSPlay.Volume=-4000; changeVolumeImage(NSPlay.Volume)} 
function changeVolumeImage(volume) {
	var valeur = Math.round((volume/200)+20);
}
 
function changement_status(etat)
{
	switch(etat) {
		case "lecture":
			document.getElementById('div_Status').innerHTML = 'En Lecture';
			$("#btPlay").attr("src","images/btPlay.png");
			$("#btStop").attr("src","images/btStop_off.png");
			$("#vuled").fadeIn(300);
			$("#content").focus();
			break;
		case "stop":
			document.getElementById('div_Status').innerHTML = 'Lecture stoppée';
			$("#btPlay").attr("src","images/btPlay_off.png");
			$("#btStop").attr("src","images/btStop.png");
			$("#vuled").fadeOut(300);
			$("#content").focus();
			break;
		case "connect":
			document.getElementById('div_Status').innerHTML = 'Connexion...';
			$("#btPlay").attr("src","images/btPlay.png");
			$("#btStop").attr("src","images/btStop_off.png");
			$("#vuled").fadeOut(300);
			$("#content").focus();
			break;
		case "chargement":
			document.getElementById('div_Status').innerHTML = 'Connexion au serveur...';
			$("#btPlay").attr("src","images/btPlay.png");
			$("#btStop").attr("src","images/btStop_off.png");
			$("#vuled").fadeOut(300);
			$("#content").focus();
			break;
		case "vide":
			document.getElementById('div_Status').innerHTML = '';
			break;
		default:
			document.getElementById('div_Status').innerHTML = etat;
			break;			
	}
}