$(document).ready(function(){
	
	// Email newsletter signup label fade
	$('#utpld-utpld').focus(function(){
		$('.newsletter #extra').show('fast');
	});
	$('#utpld-utpld').focusout(function(){
		var value = $('#utpld-utpld').val();
		if (!value) {
			$('.newsletter #extra').hide('fast');
		}
	});
	
	// Make dropdown work on click/touch
	$('#header .nav li ul').hide();
	$('#header .nav .mickie-community > a').click(function(){
		$('#header .nav .mickie-community ul').slideToggle('fast');
		return false;
	});
	$('#header .nav .store > a').click(function(){
		$('#header .nav .store ul').slideToggle('fast');
		return false;
	});
	
	// Audio player
	$('#playlist .go').click(function() {
		$('#playlist .go').removeClass('playing');
		$(this).addClass('playing');
		$('.player .title span').text('Now Playing:');
		var nowplaying = $('#playlist .playing').html();
		$('.player .title span').append(' '+nowplaying);
		$('#audio_player').get()[0].sendEvent('LOAD', $(this).attr('href'));
		$('#audio_player').get()[0].sendEvent('PLAY', $(this).attr('href'));
		return false;
	});
	
	$('#twitter').social({
		network:'twitter',
		user:'MickieJames',
		count:1,
		loadingText:'<p>Loading tweets &hellip;</p>',
		twitter:{output:'<span class="tweet">{text}</span> <span class="time">Posted <a href="{tweet_url}">{time}</a></span>'}
		
	});
	
	$('#footer .section').prepend('<div id="ie-footer"></div>');
	
});






