function demoInstanceInfo(myPlayer, myInfo) {
	var jPlayerInfo = "<p>This jPlayer instance is running in your browser using ";

	if(myPlayer.jPlayer("getData", "usingFlash")) {
		jPlayerInfo += "<strong>Flash</strong> with ";
	} else {
		jPlayerInfo += "<strong>HTML5</strong> with ";
	}
	
	if(myPlayer.jPlayer("getData", "usingMP3")) {
		jPlayerInfo += "<strong>MP3</strong>";
	} else {
		jPlayerInfo += "<strong>OGG</strong>";
	}
	
	
	jPlayerInfo += " files.<br />This instance is using the constructor options:<br /><code>$(\"#" + myPlayer.jPlayer("getData", "id") + "\").jPlayer({<br />";
	
	jPlayerInfo += "&nbsp;&nbsp;&nbsp;nativeSupport: " + myPlayer.jPlayer("getData", "nativeSupport");
	jPlayerInfo += ", oggSupport: " + myPlayer.jPlayer("getData", "oggSupport");
	jPlayerInfo += ", customCssIds: " + myPlayer.jPlayer("getData", "customCssIds");
	
	jPlayerInfo += "<br />});</code></p>";
	myInfo.html(jPlayerInfo);
}

function demoStatusInfo(myPlayer, myInfo) {
	var jPlayerStatus = "<p>jPlayer is ";
	jPlayerStatus += (myPlayer.jPlayer("getData", "diag.isPlaying") ? "playing" : "stopped");
	jPlayerStatus += " at time: " + Math.floor(myPlayer.jPlayer("getData", "diag.playedTime")) + "ms.";
	jPlayerStatus += " (tt: " + Math.floor(myPlayer.jPlayer("getData", "diag.totalTime")) + "ms";
	jPlayerStatus += ", lp: " + Math.floor(myPlayer.jPlayer("getData", "diag.loadPercent")) + "%";
	jPlayerStatus += ", ppr: " + Math.floor(myPlayer.jPlayer("getData", "diag.playedPercentRelative")) + "%";
	jPlayerStatus += ", ppa: " + Math.floor(myPlayer.jPlayer("getData", "diag.playedPercentAbsolute")) + "%)</p>"
	myInfo.html(jPlayerStatus);
}




$(document).ready(function(){

  $("#jquery_jplayer").jPlayer({
		ready: function () {
			this.element.jPlayer("setFile", "http://teszt.clubprince.hu/zenek%20az%20oldalra/Discord%20-%20Heat%20(Original%20Mix)%20Made%20Inn%20Music%20003).mp3").jPlayer("play");
			$('#player_play').hide();
		},
		volume: 50
	});
	
	$('#player_stop').click(function(){
	  $("#jquery_jplayer").jPlayer('stop');
	  $('#player_play').show();
	  $('#player_pause').hide();
	});
	
	$('#player_pause').click(function(){
	  $("#jquery_jplayer").jPlayer('pause');
	  $('#player_play').toggle();
	  $('#player_pause').toggle();
	});
	
	$('#player_play').click(function(){
	  $("#jquery_jplayer").jPlayer('play');	  
	  $('#player_pause').toggle();
	  $('#player_play').toggle();
	});
	
	
  
	// Local copy of jQuery selectors, for performance.
	/*var jpPlayTime = $("#jplayer_play_time");
	var jpTotalTime = $("#jplayer_total_time");
	var jpStatus = $("#demo_status"); // For displaying information about jPlayer's status in the demo page

	$("#jquery_jplayer").jPlayer({
		ready: function () {
			this.element.jPlayer("setFile", "http://www.miaowmusic.com/mp3/Miaow-07-Bubble.mp3").jPlayer("play");
			demoInstanceInfo(this.element, $("#demo_info")); // This displays information about jPlayer's configuration in the demo page
		},
		volume: 50
	})
	.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
	//	jpPlayTime.text($.jPlayer.convertTime(playedTime));
	//	jpTotalTime.text($.jPlayer.convertTime(totalTime));

		demoStatusInfo(this.element, jpStatus); // This displays information about jPlayer's status in the demo page
	})
	.jPlayer("onSoundComplete", function() {
		this.element.jPlayer("play");
	});
  */
  /*
	var playItem = 0;

	var myPlayList = [
		{name:"Cogita - Bad Fat Man",
    mp3:"http://clubprince.hu/zenek%20az%20oldalra/Cogita-Bad%20Fat%20Man.mp3"}
	];


	$("#jquery_jplayer").jPlayer({
		ready: function() {
			displayPlayList();
			playListInit(true); // Parameter is a boolean for autoplay.
			demoInstanceInfo($(this), $("#jplayer_info"));
		}
	})
	.jPlayerId("play", "player_play")
	.jPlayerId("pause", "player_pause")
	.jPlayerId("stop", "player_stop")
	.jPlayerId("loadBar", "player_progress_load_bar")
	.jPlayerId("playBar", "player_progress_play_bar")
	.jPlayerId("volumeMin", "player_volume_min")
	.jPlayerId("volumeMax", "player_volume_max")
	.jPlayerId("volumeBar", "player_volume_bar")
	.jPlayerId("volumeBarValue", "player_volume_bar_value")
	.onProgressChange( function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
		var myPlayedTime = new Date(playedTime);
		var ptMin = (myPlayedTime.getUTCMinutes() < 10) ? "0" + myPlayedTime.getUTCMinutes() : myPlayedTime.getUTCMinutes();
		var ptSec = (myPlayedTime.getUTCSeconds() < 10) ? "0" + myPlayedTime.getUTCSeconds() : myPlayedTime.getUTCSeconds();
		$("#play_time").text(ptMin+":"+ptSec);

		var myTotalTime = new Date(totalTime);
		var ttMin = (myTotalTime.getUTCMinutes() < 10) ? "0" + myTotalTime.getUTCMinutes() : myTotalTime.getUTCMinutes();
		var ttSec = (myTotalTime.getUTCSeconds() < 10) ? "0" + myTotalTime.getUTCSeconds() : myTotalTime.getUTCSeconds();
		$("#total_time").text(ttMin+":"+ttSec);
	})
	.onSoundComplete( function() {
		playListNext();
	});

	$("#ctrl_prev").click( function() {
		playListPrev();
		return false;
	});

	$("#ctrl_next").click( function() {
		playListNext();
		return false;
	});

	function displayPlayList() {
		for (i=0; i < myPlayList.length; i++) {
			$("#playlist_list ul").append("<li id='playlist_item_"+i+"'>"+ myPlayList[i].name +"</li>");
			$("#playlist_item_"+i).data( "index", i ).hover(
				function() {
					if (playItem != $(this).data("index")) {
						$(this).addClass("playlist_hover");
					}
				},
				function() {
					$(this).removeClass("playlist_hover");
				}
			).click( function() {
				var index = $(this).data("index");
				if (playItem != index) {
					playListChange( index );
				} else {
					$("#jquery_jplayer").play();
				}
			});
		}
	}

	function playListInit(autoplay) {
		if(autoplay) {
			playListChange( playItem );
		} else {
			playListConfig( playItem );
		}
	}

	function playListConfig( index ) {
		$("#playlist_item_"+playItem).removeClass("playlist_current");
		$("#playlist_item_"+index).addClass("playlist_current");
		playItem = index;
		$("#jquery_jplayer").setFile(myPlayList[playItem].mp3);
	}

	function playListChange( index ) {
		playListConfig( index );
		$("#jquery_jplayer").play();
	}

	function playListNext() {
		var index = (playItem+1 < myPlayList.length) ? playItem+1 : 0;
		playListChange( index );
	}

	function playListPrev() {
		var index = (playItem-1 >= 0) ? playItem-1 : myPlayList.length-1;
		playListChange( index );
	}*/
});
