$(document).ready(
	
	function() 
	{
		var songs = new Array();
		songs[0] = 'Robert_Butler_Alt_N.mp3';
		songs[1] = 'Robert_Butler_C.mp3';

		$("#jquery_jplayer").jPlayer()
		.jPlayerId("play", "play")
		.jPlayerId("pause", "pause")
		.jPlayerId("stop", "stop");

		$("#track-01").click(function() {
			$(this).find('img').each(function(i) {
				if ($(this).attr('rel') == 'white')
				{
					$(this).attr('src', 'images/narratives_red.png');
					$(this).attr('rel', 'red');
					$('img#commercial').attr('src', 'images/commercial.png');
					$('img#commercial').attr('rel', 'white');
					$("#jquery_jplayer").setFile(songs[0]).play();
				}
				else
				{
					$(this).attr('src', 'images/narratives.png');
					$(this).attr('rel', 'white');
					$("#jquery_jplayer").stop();
				}
			});

			return false;
		});

		$("#track-02").click(function() {
			$(this).find('img').each(function(i) {
				if ($(this).attr('rel') == 'white')
				{
					$(this).attr('src', 'images/commercial_red.png');
					$(this).attr('rel', 'red');
					$('img#narratives').attr('src', 'images/narratives.png');
					$('img#narratives').attr('rel', 'white');
					$("#jquery_jplayer").setFile(songs[1]).play();
				}
				else
				{
					$(this).attr('src', 'images/commercial.png');
					$(this).attr('rel', 'white');
					$("#jquery_jplayer").stop();
				}
			});

			return false;
		});
});
