$(document).ready(function(){

	if ($('#tweets').length){
		
		$('#tweets').load(window.location + 'twitter/');
		$('.vevent:eq(4)').addClass('last');

		// $('#dispatches').height($('#main').height());
		
		// jplayer 
		
		$("#jquery_jplayer_1").jPlayer({
			ready: function () {
				$(this).jPlayer("setMedia", {
					mp3: "http://www.mergerecords.com/audio/amordedias/bunhill_fields.mp3"
				});
			},
			swfPath: window.location + "assets/swf",
			solution: 'html, flash',
			supplied: "mp3"
		});
		
		$('.jp-play, #song').click(function() {
			 $("#jquery_jplayer_1").jPlayer("play");
			$('.jp-play').hide();
			$('.jp-pause').show();
			return false;
		});
		
		$('.jp-pause').dblclick(function() {
			 $("#jquery_jplayer_1").jPlayer("pause", 0);
			$('.jp-play').show();
			$('.jp-pause').hide();
			return false;
		});
		
		$('.jp-pause').click(function() {
			 $("#jquery_jplayer_1").jPlayer("pause");
			$(this).hide();
			$('.jp-play').show();
			return false;
		});
			
		$("#jquery_jplayer_1").bind($.jPlayer.event.timeupdate, function(event) { // Add a listener to report the time play began
			$(".jp-current-time").text($.jPlayer.convertTime(event.jPlayer.status.currentTime));
		});
	
	}

});

