<!--
var strips = 85;
var boolTotalTimeIsSet = 0;
var thisLpInt = 0;
var lastId;
$(document).ready(function(){

	// Stores the value of percentage of track loaded
	var global_lp = 0;
	var idPlayed = 0;

	$("#jquery_jplayer").jPlayer({
		ready: function () {
			//alert(this.element.attr('id'));
			//this.element.jPlayer("setFile", "tracks/discapitalize/01_Launcher.mp3").jPlayer("play");
			
			// Draw the control bar
			drawControlBar();
		},
		customCssIds: true,
		swfPath: "libs/thePlayer"
	})
	.jPlayer("onProgressChange", function(lp,ppr,ppa,pt,tt) {
 		var lpInt = parseInt(lp);
 		var ppaInt = parseInt(ppa);
 		var thisLpInt = Math.round((strips*lpInt)/100);
 		var thisPpaInt = Math.round((strips*ppaInt)/100);
 		global_lp = thisLpInt;
 		var loadBar = "";
 		
 		var id;
 		for (l=0; l <= thisLpInt; l++){
 			id = "#lb-"+l;
 			if($(id).hasClass('toPlay')) { //set progressbar to loaded
				$(id).removeClass('toPlay');
				$(id).addClass('loaded');
				$(id).attr({"src":"libs/thePlayer/skin/progress_loaded.gif"});
			}
			
			for (i=0; i < l; i++){
				id = "#lb-"+i;
				if(i < thisPpaInt) {					
					if($(id).hasClass('loaded')) { //set progressbar to played
						$(id).removeClass('loaded');
						$(id).addClass('played');
						$(id).attr({"src":'libs/thePlayer/skin/progress_played.gif'});
						lastId = thisPpaInt;
					}else if($(id).hasClass('played') && thisPpaInt < lastId) {//set progressbar to played if skipped backwards
						for(j=thisPpaInt; j < lastId; j++) {
							id = "#lb-"+j;
							$(id).removeClass('played');
							$(id).addClass('loaded');
							$(id).attr({"src":"libs/thePlayer/skin/progress_loaded.gif"});
						}
						lastId = thisPpaInt;
					}
				}
			}
 		}
 		
 		if(thisLpInt == strips && boolTotalTimeIsSet == 0) {
			$('#player_time').text(jQuery.jPlayer.convertTime(tt));
			boolTotalTimeIsSet = 1;
 		}
	})
/*	.jPlayer("onSoundComplete", function() {
		this.element.jPlayer("play");
	});
*/
	$("#player_play").click( function() {
		$('#jquery_jplayer').jPlayer("play");
		$(this).blur();
		return false;
	});

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

	$("#player_stop").click( function() {
		boolTotalTimeIsSet = 0;
		$('#jquery_jplayer').jPlayer("stop");
		drawControlBar();
		$(this).blur();
		return false;
	});

	$("#player_progress_ctrl_bar img").live( "click", function() {
		$("#jquery_jplayer").jPlayer("playHead", this.id.substring(3)*(100.0/global_lp));
		$(this).blur();
		return false;
	});

});

function drawControlBar() {
	var ctrlBar = "";
	for (i=0; i < strips; i++) {
 		ctrlBar = ctrlBar + "<image id='lb-"+i+"' src='libs/thePlayer/skin/progress_toPlay.gif' class='toPlay'>";
	}
	$('#player_progress_ctrl_bar').html(ctrlBar);
}

function callSong(file)
{
	$('#player_container').slideDown('slow');
	drawControlBar();
	file = file.replace(/_/g, " ");
	$("#jquery_jplayer").jPlayer("setFile", file).jPlayer("play");
	var strDspTrack = file.substr(file.lastIndexOf("/") + 1, file.length);
	strDspTrack = strDspTrack.substr(0 , strDspTrack.lastIndexOf("."));
	var track = strDspTrack;
	$('#player_head').text(track);
	$("#player_controls").show("slow");
	$("#player_progress").show("slow");
	boolTotalTimeIsSet = 0;
	content.boolPlayerIsPlaying = true;
}

function callErrorFlash()
{
	var strOnClick = "newWindow('https://addons.mozilla.org/de/firefox/browse/type:7', 300, 200, 300, 300, 'yes', 'yes');";
	var strHtml = "";
	strHtml += "<font class=\"txtNormal\">To hear any music your browser should use the flash-plugin!</font>\n";
	document.getElementById("radioInfo").innerHTML = strHtml;
 	document.getElementById("radioInfo").style.visibility = "visible";
}
-->
