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

	var playItem = 0;

	var myPlayList = [
		{name:"Grove Rd",mp3:"http://www.johnfoti.com/audio/mp3/01-Grove-Rd.mp3",ogg:"http://www.johnfoti.com/audio/ogg/01-Grove-Rd.ogg"},
		{name:"Charlie, Keep Me Up",mp3:"http://www.johnfoti.com/audio/mp3/02-Charlie-Keep-Me-Up.mp3",ogg:"http://www.johnfoti.com/audio/ogg/02-Charlie-Keep-Me-Up.ogg"},
		{name:"Dallas",mp3:"http://www.johnfoti.com/audio/mp3/03-Dallas.mp3",ogg:"http://www.johnfoti.com/audio/ogg/03-Dallas.ogg"},
		{name:"Missouri",mp3:"http://www.johnfoti.com/audio/mp3/04-Missouri.mp3",ogg:"http://www.johnfoti.com/audio/ogg/04-Missouri.ogg"},
		{name:"Cross the Country",mp3:"http://www.johnfoti.com/audio/mp3/05-Cross-the-Country.mp3",ogg:"http://www.johnfoti.com/audio/ogg/05-Cross-the-Country.ogg"},
		{name:"South",mp3:"http://www.johnfoti.com/audio/mp3/06-South.mp3",ogg:"http://www.johnfoti.com/audio/ogg/06-South.ogg"},
		{name:"Grey Skirt",mp3:"http://www.johnfoti.com/audio/mp3/07-Grey-Skirt.mp3",ogg:"http://www.johnfoti.com/audio/ogg/07-Grey-Skirt.ogg"},
		{name:"I'm Just a Boy",mp3:"http://www.johnfoti.com/audio/mp3/08-Im-Just-a-Boy.mp3",ogg:"http://www.johnfoti.com/audio/ogg/08-Im-Just-a-Boy.ogg"},
		{name:"On a Bench, In a Park",mp3:"http://www.johnfoti.com/audio/mp3/09-On-a-Bench-In-a-Park.mp3",ogg:"http://www.johnfoti.com/audio/ogg/09-On-a-Bench-In-a-Park.ogg"},
		{name:"Don't Wanna Work No More",mp3:"http://www.johnfoti.com/audio/mp3/10-Dont-Wanna-Work-No-More.mp3",ogg:"http://www.johnfoti.com/audio/ogg/10-Dont-Wanna-Work-No-More.ogg"},
		{name:"Quarter to One",mp3:"http://www.johnfoti.com/audio/mp3/11-Quarter-to-One.mp3",ogg:"http://www.johnfoti.com/audio/ogg/11-Quarter-to-One.ogg"},
		{name:"Riverside",mp3:"http://www.johnfoti.com/audio/mp3/12-Riverside.mp3",ogg:"http://www.johnfoti.com/audio/ogg/12-Riverside.ogg"}
	];

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

	$("#jquery_jplayer").jPlayer({
		ready: function() {
			displayPlayList();
			playListInit(true); // Parameter is a boolean for autoplay.
		},
		oggSupport: true
	})
	.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 );
	}
});
-->
