$(document).ready(function() {
	//Newsletter drop-down
	$('div#newsletter').find('a').click(function(){
		$('div#newsletter_form').slideToggle();
	});
	//Streaming modal
	$('a.load-stream').click(function(){
		var title = $('<p>').append('<strong>').text($(this).attr('title'));
		var popup = $(this).attr('rel').replace('.txt', '.html');
		/*var link = $('<a>').attr('href', '#').attr('id', 'stream_popup').text('Open in a separate window').click(function(){
			$('div#player').empty();
			window.open(popup, $(this).attr('title'), 'width=220,height=220,scrollbars=no,toolbar=no,resizable=no,location=no,status=no,menubar=no');
			return false;
		});*/
		$('div#player').empty();
		$('div#player').append('<div class="embed"><p>Loading...</p></div>').prepend(title); //.append(link);
		$('div#player').find('div.embed').load($(this).attr('rel'));
		return false;
	});
	
	//homepage download
	$('a.open-dl').click(function(){
		$('ul.dl-list').fadeOut();
		$(this).next().fadeIn();
	});
});