function majradio(nomradio)
{
 $.ajax({
   type: "POST",
   url: "/inforadio.php",
   data: "radio="+nomradio,
   success: function(msg){
   var	my_jPlayer = $("#jquery_jplayer_1")
	my_jPlayer.jPlayer("setMedia", {
			mp3: msg,
			title: "Vous écoutez: "+nomradio
		}).jPlayer("play");
     
   }
 });	
}

$(document).ready(function(){ 
$('select').selectmenu({style:'dropdown',width:'170'}); 
$("#jquery_jplayer_1").jPlayer({
		ready: function (event) {
			$(this).jPlayer("setMedia", {
			mp3: "http://vipicecast.yacast.net/bfm" 	 
				
			});
		},
		swfPath: "js",
		supplied: "mp3",
		wmode: "window"

});
	$("#radio").hide();
  $("#selectradio").msDropDown({
   rowHeight:40,  
mainCSS:'dd2'    
  }).data("dd"); 
	$('#Button1').button({
		text: "Lecture",
		icons: { primary: 'ui-icon-play' }
	})
	.click(function() {
		majradio($("#selectradio").val()); 
	});


	$('#Button2').button({
		text: "Stop",
		icons: { primary: 'ui-icon-stop' }
	})
	.click(function() {
		majradio();
	});
	
}); 
