$(document).ready(function() {
	// hide tracklistings
	$(".tracklisting-container").hide();
	
	// loads an episode into the player, scrolls and changes ep text.
	
	$('.play').click(function(e) {
	  e.preventDefault(); // stop the link from working
	  $('html, body').animate({scrollTop:0}, 'slow'); 
	  $("#ajaxplayer").load($(this).attr('href'));
//	  $("#eptext").text("Episode " + $(this).attr('rel'));
	  $("#eptext").fadeOut('slow');
	});
	
	// shows/hides the tracklists.
	
	$('.showtracklist').click(function(e) {
		e.preventDefault(); // stop the link from working
		$('#tracklisting-' + $(this).attr('rel')).slideToggle(400);
	return false;
	});
});

 function show_player()
	 {
	 	
		$("#loading-placeholder").hide();
		 $("#player").show();
	}
	
	function hide_player()
	{
		$('#ajaxplayer').hide();
		$("#loading-placeholder").show();
		 $("#player").hide();
	
	}
	