$(document).ready(function(){
	
	$.ajaxSetup({cache:false});
	
	$('.page-item-5').hover(
		function () { 
			$('.page-item-5 a').addClass('hover');
			$('#mn_equipe').css('display','block');
			$('#mn_equipe').animate({
			opacity: 1,
			top: '45px'
			}, 200, function() {
				// Animation complete.
			});
		},
		function () {
			$('.page-item-5 a').removeClass('hover');
			$('#mn_equipe').animate({
			opacity: 0,
			top: '20px'
			}, 100, function() {
				$('#mn_equipe').css('display','none');
			});
	}
	);
	
	var tagHeight = $(".tag_list").height();
	
	if(tagHeight == undefined){
		tagHeight = 20;
	}
	
	$('.footer_artigo').css('height',tagHeight + 70 +'px');
	
	
	
	$('#bgBlack').css('height',$(window).height() +'px');
	$('.postUnico').css('min-height',$('#secondaryContent').height() - 101 +'px');
	$('.pageUnica').css('min-height',$('#secondaryContent').height() - 202 +'px');
	
	$(window).resize(function() {
		$('#bgBlack').css('height',$(window).height() +'px');
	});
	
	
	
	$('.bt_fullscreen').toggle(
	function () {
		$('.pageUnica').css('min-height','200px');
		$('.bt_fullscreen').addClass('hover');			
		$('#bgBlack').fadeIn();
		$('.box_comentarios').fadeOut();
		
		$('.footer_artigo').animate({
			height: '120px'
		}, 400);
		
		$('.em-location-map').animate({
			width: '520px'
		}, 400);
				
		$('#primaryContent').animate({
			width: '980px'
		}, 400);
		$('.shadow').animate({
			width: '980px'
		}, 400);
		$('.contentBox').animate({
			paddingLeft: '70px',
			paddingRight: '70px'
		}, 400);
		$('#primaryContent h2').animate({
			paddingLeft: '70px',
			paddingRight: '70px'
		}, 400);
		$('#secondaryContent').animate({
			width: '0',
			opacity: '0',
		}, 200, function() {
  			$('.bgBoxContent').css('box-shadow','3px 3px 5px #161616');
			$('#secondaryContent').css('display','none');
			$('.autor .nome_autor').css('color','#fff');
			$('.autor h1').css('text-shadow','1px 1px #000');
			$('.autor .nome_autor').css('text-shadow','1px 1px #000');
			$('.tag a').css('color','#fff');
			$('.tag a').css('text-shadow','1px 1px #000');
			$('.tag h1').css('text-shadow','1px 1px #000');
  			}
		);	
		$('.info_list').animate({
			width: '660px'
		}, 400);	
	},
	function () {
		$('.pageUnica').css('min-height',$('#secondaryContent').height() - 404 +'px');
		$('#secondaryContent').css('display','block');
		$('.bt_fullscreen').removeClass('hover');
		$('#bgBlack').fadeOut();
		$('#primaryContent').animate({
			width: '670px'
		}, 200, function() {
			$('.bgBoxContent').css('box-shadow','none');
			$('.autor .nome_autor').css('color','#333');
			$('.autor h1').css('text-shadow','1px 1px #fff');
			$('.autor .nome_autor').css('text-shadow','1px 1px #fff');
			$('.tag a').css('color','#666');
			$('.tag a').css('text-shadow','1px 1px #fff');
			$('.tag h1').css('text-shadow','1px 1px #fff');
			$('.box_comentarios').fadeIn();
  		});
		$('.shadow').animate({
			width: '670px'
		}, 200);
		
		$('.em-location-map').animate({
			width: '400px'
		}, 200);
		
		$('.footer_artigo').animate({
			height: '90px'
		}, 200);
		
		$('#primaryContent h2').animate({
			paddingLeft: '35px',
			paddingRight: '35px'
		}, 200);
		$('.contentBox').animate({
			paddingLeft: '35px',
			paddingRight: '35px'
		}, 200);
		$('#secondaryContent').animate({
			width: '295px',
			opacity: '1'
		}, 400);
		$('.info_list').animate({
			width: '440px'
		}, 400);
	});

	
	$('#perfil_completo').toggle(
	function () {
		$('.bio_completa').slideDown();
		$('#perfil_completo').addClass('hover');
		$('#perfil_completo span').remove();
		$('#perfil_completo').append('<span>ESCONDER PERFIL</span>');
	},
	function () {
		$('.bio_completa').slideUp();
		$('#perfil_completo').removeClass('hover');
		$('#perfil_completo span').remove();
		$('#perfil_completo').append('<span>VER PERFIL COMPLETO</span>');
	});
	
	
	$('.list_autores li').hover(
		function () {
			$('.last_post_autor',this).css('display','block');
			$('.last_post_autor',this).animate({
				opacity: 1
			}, 100);
			
			$(this).animate({
				height: $('.last_post_autor',this).height() + 125+ 'px'
			}, 100);
		}, 
		function () {
			$('.last_post_autor',this).css('display','none');;
			$(this).animate({
				height: '85px'
			}, 50);
		}
	);
	
	
});
