var bWin32IE;
if ((navigator.userAgent.indexOf("IE") > -1) && (navigator.platform == "Win32"))
     bWin32IE = true;
else
     bWin32IE = false;

function changeVideoSource(mySrc){
myNewSrc = "<object classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715\" type=\"application/x-oleobject\" width=\"240\" height=\"180\" hspace=\"0\" vspace=\"0\" id=\"WMPlayer\" name=\"WMPlayer\"  standy=\"Chargement en cours...\"  >";
myNewSrc = myNewSrc +"<param name=\"AutoStart\" value=\"true\"><param name=\"AnimationatStart\" value=\"False\"><param name=\"TransparentatStart\" value=\"True\"><param name=\"ShowControls\" value=\"false\"><param name=\"FileName\" value=\""+mySrc+"\">";
myNewSrc = myNewSrc +"<embed src=\""+mySrc+"\" width=\"240\" height=\"180\" hspace=\"0\" vspace=\"0\" type=\"application/x-mplayer2\"  pluginspage=\"http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&\"  ShowControls=\"0\" ShowDisplay=\"0\" ShowStatusBar=\"0\"></embed></object> ";
document.getElementById('mediaPlayerZone').innerHTML=myNewSrc ;
}

function WMOK(){
	if (document.WMPlayer.CurrentPosition!=-1)
		return true;
	else
		return false;
}

function set_volume(Vol){
	if (bWin32IE){
		document.images['moins'].alt = 'Diminuer le volume - Volume ' + Vol + ' %';
		document.images['plus'].alt ='Augmenter le volume - Volume ' + Vol + ' %';
	}
	return;
}

function WMStop(){
	if(bWin32IE){
	document.getElementById('WMPlayer').Stop();
		if(WMOK()){WMPlayer.CurrentPosition=0;}
	}else{
	document.WMPlayer.Stop();
	document.WMPlayer.SetCurrentPosition(0);
	}
	if (document.getElementById("headerPlayer") != null) {
		document.getElementById("headerPlayer").innerHTML = '&nbsp;';
	}
}

function WMPlay(){
	if(bWin32IE){
		if (WMOK()){WMPlayer.Play();}
	}else{
		document.WMPlayer.Play();
	}
}

function WMPause(){ 
	if(bWin32IE){
		if (WMOK()){WMPlayer.Pause();}
	}else{
		if (document.WMPlayer.Pause) {
			document.WMPlayer.Pause();
		}
	}
}

function WMMute() {
	if (bWin32IE){
		if(WMOK()){
			if (WMPlayer.Mute==false){
				WMPlayer.Mute=true;
				document.getElementById('zapControl').src="http://media.mth.net/infosport/images/home/zap1.gif";
			}else{
				WMPlayer.Mute=false;
				document.getElementById('zapControl').src="http://media.mth.net/infosport/images/home/zap.gif";
			}
		}	
	}else{
		if (document.getElementById('WMPlayer').settings.mute == true){
			document.getElementById('WMPlayer').SetMute(false);
				document.getElementById('zapControl').src="http://media.mth.net/infosport/images/home/zap.gif";
		}
		else{
			document.getElementById('WMPlayer').SetMute(true);
				document.getElementById('zapControl').src="http://media.mth.net/infosport/images/home/zap1.gif";
		}
	}
	WMPlay();
}