$(document).ready(function(){

   $("#jquery_jplayer").jPlayer({
		ready: function () {
			playTrack("none",$("#").text());
		},
		customCssIds: true
	})
	.jPlayer("onProgressChange", function(lp,ppr,ppa,pt,tt) {
 		$("#pcent").text(parseInt(ppa)+"%");
	});


	function playTrack(t,n)
	{
		$("#jquery_jplayer").jPlayer("setFile", t).jPlayer("play");

		$("#trackname").fadeOut(function(){
			$("#trackname").text(n);
			$("#trackname").fadeIn();
		});

		$("#pcent").fadeOut(function(){
			$("#pcent").fadeIn();
		});

		return false;
	}

	$("#radio1").click(function() {
		$(this).blur();
 		return(playTrack("audio/radio1.mp3",$("#radio1").text()));
	});

	$("#radio2").click(function() {
		$(this).blur();
		return(playTrack("audio/radio2.mp3",$("#radio2").text()));
	});

	$("#radio3").click(function() {
		$(this).blur();
		return(playTrack("audio/radio3.mp3",$("#radio3").text()));
	});

	$("#play").click(function() {
		$("#jquery_jplayer").jPlayer("play");
		$(this).blur();
		return false;
	});

	$("#pause").click(function() {
		$("#jquery_jplayer").jPlayer("pause");
		$(this).blur();
		return false;
	});

	$("#stop").click(function() {
		$("#jquery_jplayer").jPlayer("stop");
		$(this).blur();
		return false;
	});

	$("#vmax").click(function() {
		$("#jquery_jplayer").jPlayer("volume", 100);
		$(this).blur();
		return false;
	});

	$("#vmute").click(function() {
		$("#jquery_jplayer").jPlayer("volume", 0);
		$(this).blur();
		return false;
	});

	$("#vhalf").click(function() {
		$("#jquery_jplayer").jPlayer("volume", 50);
		$(this).blur();
		return false;
	});

});
