$(function(){
	// pour l'ajout en favoris
	$('[name^=ajout_favori_]').click(function() {
		//console.log($(this));
		//var zListeRecetteId = $(this).attr("id");
		var videoFichierFlv = $(this).attr('name').split('_')[2];

		var tListeId = '';
		var titre = 'Video';
		favoris(videoFichierFlv, tListeId, titre);
	})
	
	$('[name^=ajout_son_]').click(function() {
		//console.log($(this));
		//var zListeRecetteId = $(this).attr("id");
		var videoFichierFlv = $(this).attr('name').split('_')[2];

		var tListeId = '';
		var titre = 'Son';
		favoris(videoFichierFlv, tListeId, titre);
	})
	
	$('[name^=envoiSon_]').click(function() {
		//console.log($(this));
		//var zListeRecetteId = $(this).attr("id");
		var titre = $(this).attr('name').split('_')[1];
		$("#sonTitre").val(titre);
		
	})

})

function favoris(ivideoFichierFlv, tListeId, titre) {
//alert(tListeId);
var path = ''+j_pathUrl+j_basepath+'index.php?sVideoFlv='+ivideoFichierFlv+'&module=veauALaTele&action=veauALaTele:afficheVeauALaTele';
if ( navigator.appName != 'Microsoft Internet Explorer' ){ 
	window.sidebar.addPanel(titre,path,""); 
}else { 
	window.external.AddFavorite(path,titre); } 
}

function afficheLayer() {
	
	document.getElementById('id_nom').style.display='block';
	document.getElementById('id_prenom').style.display='block';
	document.getElementById('id_labnom').style.display='block';
	document.getElementById('id_labprenom').style.display='block';
	document.getElementById('id_labmail').style.display='block';
	document.getElementById('id_mail').style.display='block';
	document.getElementById('id_labdest').style.display='block';
	document.getElementById('id_dest').style.display='block';
	document.getElementById('id_labmessage').style.display='block';
	document.getElementById('id_message').style.display='block';
	
}

var isIE = navigator.appName.indexOf("Microsoft") != -1;
var currentMp3PlayerID = "";
	
	function mp3PlayerAction(player_id,action){
		
		if(currentMp3PlayerID != player_id && currentMp3PlayerID != ""){		
			if(isIE) document.getElementById(currentMp3PlayerID).doAction("stop");
			else document[currentMp3PlayerID].doAction("stop");		
		}
		currentMp3PlayerID = player_id;
	}

