jQuery(function($) {
	
	// profile pic switch
	$('#mb h1')
		.hover(
		  function () {
		    $(this).animate({ backgroundPosition: "0px -131px"}, 200);
		  }, 
		  function () {
		    $(this).animate({ backgroundPosition: "0 0"}, 400);
		  });
	
	//Song Nav
		$('#songs-c2').css({
						position: 'absolute',
						top: '0',
						marginLeft: '363px'
					});
		
		$('.nextSongs, .previousSongs').show();
	
		$('a.nextSongs').click(function(e){
			e.preventDefault();	
			$('#songs').animate({marginLeft: "-363px"});		
		});
	
		$('a.previousSongs').click(function(e){
			e.preventDefault();	
			$('#songs').animate({marginLeft: "0"});		
		});


		$('.post:not(:has(.more)) .showMore').remove();
		
		//show more	
		$('.showMore').click(function(e) {
			//$('.more').slideUp();
			e.preventDefault();	
			$(this).parents('.post').siblings().each(function() {
			    $('.more', this).slideUp();
			  });
			$(this).parents('.post').children('.more').slideToggle();
		});
	
	$('.post')
		.hover(
		  function () {
		   	$('.showMore', this).css({opacity: 0, visibility: "visible"}).animate({opacity: 1}, 200);
		  }, 
		  function () {
		    $('.showMore', this).animate({opacity: 0}, 300);
		  });
	
	//news loader
	$('#loader').css({opacity: '0', display: 'block'})
	var newsP = function() {	
		$('#news-pagination a').click(function(e){
			var $el = $(this);
			var $news = $('#news-inside');
			var URL = $el.attr("href");
			e.preventDefault();	
			
			$news.animate({ 
				opacity: 0,
				marginTop: "-10px"
				}, 250, function() {
					$('#loader').animate({ opacity: 1}, 200);		
					$(this).css({marginTop: '20px'});
					URL = URL + " #news-inside";	
					$news.load(URL, function() {
						$('#loader').animate({ opacity: 0}, 200);
						$news.animate({ 
							opacity: 1,
							marginTop: "10px"											
							}, 250);
					  	newsP();
					});	
			});	
		});				
	}
	newsP();	
});
