<!--
$(document).ready(function(){

	var playItem = 0;

	var myPlayList = [
		{name:"Leave It All To Me - iCarly Theme Song",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=leave_it_all_to_me"},
		{name:"Found A Way - Drake &amp; Josh Theme Song",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=found_a_way"},
		{name:"The Troop - The Troop Theme Song",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=the_troop"},
		{name:"Shades Of Grey - The Backhouse",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=shades_of_grey"},
		{name:"Get It Right - The Backhouse",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=get_it_right"},
		{name:"Do What You Want - The Backhouse",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=do_what_you_want"},
		{name:"Christmas Promise - Merry Christmas Drake &amp; Josh",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=christmas_promise"},
		{name:"Super Hero Movie Theme Song - The Backhouse",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=superhero_movie"},
		{name:"Tennessee - The Backhouse",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=tennessee"},
		{name:"Feels Good To Feel Right - The Backhouse",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=feels_good_to_feel_right"},
		{name:"I Know - The Backhouse",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=i_know"},
		{name:"OK - The Backhouse",mp3:"http://thebackhouse.net/mp3/pmp3.php?ID=ok"}
		
		
	];

	// Local copy of jQuery selectors, for performance.
	var jpPlayTime = $("#jplayer_play_time");
	var jpTotalTime = $("#jplayer_total_time");

	$("#jquery_jplayer").jPlayer({
		ready: function() {
			displayPlayList();
			playListInit(false); // Parameter is a boolean for autoplay.
		},
		oggSupport: false
	})
	.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
		jpPlayTime.text($.jPlayer.convertTime(playedTime));
		jpTotalTime.text($.jPlayer.convertTime(totalTime));
	})
	.jPlayer("onSoundComplete", function() {
		playListNext();
	});

	$("#jplayer_previous").click( function() {
		playListPrev();
		$(this).blur();
		return false;
	});

	$("#jplayer_next").click( function() {
		playListNext();
		$(this).blur();
		return false;
	});

	function displayPlayList() {
		$("#jplayer_playlist ul").empty();
		for (i=0; i < myPlayList.length; i++) {
			var listItem = (i == myPlayList.length-1) ? "<li class='jplayer_playlist_item_last'>" : "<li>";
			listItem += "<a href='#' id='jplayer_playlist_item_"+i+"' tabindex='1'>"+ myPlayList[i].name +"</a></li>";
			$("#jplayer_playlist ul").append(listItem);
			$("#jplayer_playlist_item_"+i).data( "index", i ).click( function() {
				var index = $(this).data("index");
				if (playItem != index) {
					playListChange( index );
				} else {
					$("#jquery_jplayer").jPlayer("play");
				}
				$(this).blur();
				return false;
			});
		}
	}

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

	function playListConfig( index ) {
		$("#jplayer_playlist_item_"+playItem).removeClass("jplayer_playlist_current").parent().removeClass("jplayer_playlist_current");
		$("#jplayer_playlist_item_"+index).addClass("jplayer_playlist_current").parent().addClass("jplayer_playlist_current");
		playItem = index;
		$("#jquery_jplayer").jPlayer("setFile", myPlayList[playItem].mp3, myPlayList[playItem].ogg);
	}

	function playListChange( index ) {
		playListConfig( index );
		$("#jquery_jplayer").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 );
	}
});
-->

